Merge branch 'development' into video-stream-background

# Conflicts:
#	android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt
#	android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt
#	lib/core/service/VideoCallService.dart
#	lib/screens/patients/profile/profile_screen/patient_profile_screen.dart
merge-requests/759/head
mosazaid 3 years ago
commit eb62fdfe21

@ -64,16 +64,18 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
val generalId = call.argument<String>("generalId") val generalId = call.argument<String>("generalId")
val doctorId = call.argument<Int>("DoctorId") val doctorId = call.argument<Int>("DoctorId")
val patientName = call.argument<String>("patientName") val patientName = call.argument<String>("patientName")
val isRecording = call.argument<Boolean>("isRecording")
val sessionStatusModel = val sessionStatusModel =
GetSessionStatusModel(VC_ID, tokenID, generalId, doctorId, patientName) GetSessionStatusModel(VC_ID, tokenID, generalId, doctorId, patientName, isRecording!!)
openVideoCall(apiKey, sessionId, token, appLang, baseUrl, sessionStatusModel) openVideoCall(apiKey, sessionId, token, appLang, baseUrl, sessionStatusModel)
} }
"closeVideoCall" -> { "closeVideoCall" -> {
videoStreamService?.closeVideoCall() dialogFragment?.onCallClicked()
// videoStreamService?.closeVideoCall()
} }
"onCallConnected" -> { "onCallConnected" -> {
@ -84,32 +86,62 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
} }
} }
private fun openVideoCall( private fun openVideoCall(apiKey: String?, sessionId: String?, token: String?, appLang: String?, baseUrl: String?, sessionStatusModel: GetSessionStatusModel) {
apiKey: String?, if (dialogFragment == null) {
sessionId: String?, val arguments = Bundle()
token: String?, arguments.putString("apiKey", apiKey)
appLang: String?, arguments.putString("sessionId", sessionId)
baseUrl: String?, arguments.putString("token", token)
sessionStatusModel: GetSessionStatusModel arguments.putString("appLang", appLang)
) { arguments.putString("baseUrl", baseUrl)
val arguments = Bundle() arguments.putParcelable("sessionStatusModel", sessionStatusModel)
arguments.putString("apiKey", apiKey)
arguments.putString("sessionId", sessionId) val transaction = supportFragmentManager.beginTransaction()
arguments.putString("token", token) dialogFragment = VideoCallFragment.newInstance(arguments)
arguments.putString("appLang", appLang) dialogFragment?.let {
arguments.putString("baseUrl", baseUrl) it.setCallListener(this)
arguments.putParcelable("sessionStatusModel", sessionStatusModel) it.isCancelable = true
if (it.isAdded){
// showSoftKeyBoard(null) it.dismiss()
// start service }else {
serviceIntent = Intent(this@MainActivity, VideoStreamContainerService::class.java) it.show(transaction, "dialog")
serviceIntent?.run { }
putExtras(arguments)
startService(this)
}
} else if (!dialogFragment!!.isVisible) {
val transaction = supportFragmentManager.beginTransaction()
dialogFragment!!.show(transaction, "dialog")
} }
// bindService()
} }
// private fun openVideoCall(
// apiKey: String?,
// sessionId: String?,
// token: String?,
// appLang: String?,
// baseUrl: String?,
// sessionStatusModel: GetSessionStatusModel
// ) {
//
// val arguments = Bundle()
// arguments.putString("apiKey", apiKey)
// arguments.putString("sessionId", sessionId)
// arguments.putString("token", token)
// arguments.putString("appLang", appLang)
// arguments.putString("baseUrl", baseUrl)
// arguments.putParcelable("sessionStatusModel", sessionStatusModel)
//
//// showSoftKeyBoard(null)
// // start service
// serviceIntent = Intent(this@MainActivity, VideoStreamContainerService::class.java)
// serviceIntent?.run {
// putExtras(arguments)
// startService(this)
// }
//// bindService()
// }
/* override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { /* override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data) super.onActivityResult(requestCode, resultCode, data)
var asd = ""; var asd = "";
@ -137,6 +169,7 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
}*/ }*/
override fun onCallFinished(resultCode: Int, intent: Intent?) { override fun onCallFinished(resultCode: Int, intent: Intent?) {
dialogFragment = null
if (resultCode == Activity.RESULT_OK) { if (resultCode == Activity.RESULT_OK) {
val result: SessionStatusModel? = intent?.getParcelableExtra("sessionStatusNotRespond") val result: SessionStatusModel? = intent?.getParcelableExtra("sessionStatusNotRespond")
@ -169,6 +202,11 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
// videoStreamService!!.serviceRunning = false // videoStreamService!!.serviceRunning = false
} }
override fun errorHandle(message: String) {
dialogFragment = null
// Toast.makeText(this, message, Toast.LENGTH_LONG).show()
}
override fun minimizeVideoEvent(isMinimize: Boolean) { override fun minimizeVideoEvent(isMinimize: Boolean) {
if (isMinimize) if (isMinimize)
methodChannel.invokeMethod("onCallConnected", null) methodChannel.invokeMethod("onCallConnected", null)

@ -23,16 +23,20 @@ public class GetSessionStatusModel implements Parcelable {
@SerializedName("PatientName") @SerializedName("PatientName")
@Expose @Expose
private String patientName; private String patientName;
@SerializedName("isRecording")
@Expose
private boolean isRecording;
public GetSessionStatusModel() { public GetSessionStatusModel() {
} }
public GetSessionStatusModel(Integer vCID, String tokenID, String generalid, Integer doctorId, String patientName) { public GetSessionStatusModel(Integer vCID, String tokenID, String generalid, Integer doctorId, String patientName, boolean isRecording) {
this.vCID = vCID; this.vCID = vCID;
this.tokenID = tokenID; this.tokenID = tokenID;
this.generalid = generalid; this.generalid = generalid;
this.doctorId = doctorId; this.doctorId = doctorId;
this.patientName = patientName; this.patientName = patientName;
this.isRecording = isRecording;
} }
protected GetSessionStatusModel(Parcel in) { protected GetSessionStatusModel(Parcel in) {
@ -49,6 +53,7 @@ public class GetSessionStatusModel implements Parcelable {
doctorId = in.readInt(); doctorId = in.readInt();
} }
patientName = in.readString(); patientName = in.readString();
isRecording = in.readInt() == 1;
} }
public static final Creator<GetSessionStatusModel> CREATOR = new Creator<GetSessionStatusModel>() { public static final Creator<GetSessionStatusModel> CREATOR = new Creator<GetSessionStatusModel>() {
@ -105,6 +110,14 @@ public class GetSessionStatusModel implements Parcelable {
this.patientName = patientName; this.patientName = patientName;
} }
public boolean isRecording() {
return isRecording;
}
public void setRecording(boolean recording) {
isRecording = recording;
}
@Override @Override
public int describeContents() { public int describeContents() {
return 0; return 0;
@ -127,5 +140,6 @@ public class GetSessionStatusModel implements Parcelable {
dest.writeInt(doctorId); dest.writeInt(doctorId);
} }
dest.writeString(patientName); dest.writeString(patientName);
dest.writeInt(isRecording ? 1 : 0);
} }
} }

@ -66,6 +66,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
private var mVolRunnable: Runnable? = null private var mVolRunnable: Runnable? = null
private var mConnectedRunnable: Runnable? = null private var mConnectedRunnable: Runnable? = null
private lateinit var recordContainer: FrameLayout
private lateinit var thumbnail_container: FrameLayout private lateinit var thumbnail_container: FrameLayout
private lateinit var activity_clingo_video_call: RelativeLayout private lateinit var activity_clingo_video_call: RelativeLayout
private lateinit var mPublisherViewContainer: FrameLayout private lateinit var mPublisherViewContainer: FrameLayout
@ -79,6 +80,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
private var token: String? = null private var token: String? = null
private var appLang: String? = null private var appLang: String? = null
private var baseUrl: String? = null private var baseUrl: String? = null
private var isRecording: Boolean = true
private var isSwitchCameraClicked = false private var isSwitchCameraClicked = false
private var isCameraClicked = false private var isCameraClicked = false
@ -201,7 +203,9 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
this.videoCallResponseListener = videoCallResponseListener this.videoCallResponseListener = videoCallResponseListener
} }
private fun onCreateView(inflater: LayoutInflater, container: ViewGroup?): View { private fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?
): View {
val view = inflater.inflate(R.layout.activity_video_call, container, false) val view = inflater.inflate(R.layout.activity_video_call, container, false)
// val parentViewLayoutParam: ConstraintLayout.LayoutParams = ConstraintLayout.LayoutParams( // val parentViewLayoutParam: ConstraintLayout.LayoutParams = ConstraintLayout.LayoutParams(
@ -217,6 +221,8 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
appLang = getString("appLang") appLang = getString("appLang")
baseUrl = getString("baseUrl") baseUrl = getString("baseUrl")
sessionStatusModel = getParcelable("sessionStatusModel") sessionStatusModel = getParcelable("sessionStatusModel")
if (sessionStatusModel != null)
isRecording = sessionStatusModel!!.isRecording
} }
initUI(view) initUI(view)
requestPermissions() requestPermissions()
@ -269,6 +275,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
layoutName = view.findViewById(R.id.layout_name) layoutName = view.findViewById(R.id.layout_name)
layoutMini = view.findViewById(R.id.layout_mini) layoutMini = view.findViewById(R.id.layout_mini)
icMini = view.findViewById(R.id.ic_mini) icMini = view.findViewById(R.id.ic_mini)
recordContainer = view.findViewById(R.id.record_container)
activity_clingo_video_call = view.findViewById(R.id.activity_clingo_video_call) activity_clingo_video_call = view.findViewById(R.id.activity_clingo_video_call)
thumbnail_container = view.findViewById(R.id.thumbnail_container) thumbnail_container = view.findViewById(R.id.thumbnail_container)
@ -280,6 +287,12 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
patientName = view.findViewById<TextView>(R.id.patient_name) patientName = view.findViewById<TextView>(R.id.patient_name)
patientName.text = sessionStatusModel!!.patientName patientName.text = sessionStatusModel!!.patientName
if (isRecording) {
recordContainer.visibility = View.VISIBLE
} else {
recordContainer.visibility = View.GONE
}
cmTimer = view.findViewById(R.id.cmTimer) cmTimer = view.findViewById(R.id.cmTimer)
cmTimer.format = "mm:ss" cmTimer.format = "mm:ss"
cmTimer.onChronometerTickListener = cmTimer.onChronometerTickListener =
@ -657,6 +670,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
400, 400,
600 600
) )
} else { } else {
dialog?.window?.setLayout( dialog?.window?.setLayout(
300, 300,
@ -665,6 +679,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
} }
isCircle = !isCircle isCircle = !isCircle
if (mSubscriber != null) { if (mSubscriber != null) {
(mSubscriber!!.renderer as DynamicVideoRenderer).enableThumbnailCircle(isCircle) (mSubscriber!!.renderer as DynamicVideoRenderer).enableThumbnailCircle(isCircle)
} else { } else {
@ -706,11 +721,17 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
400, 400,
600 600
) )
recordContainer.visibility = View.GONE
} else { } else {
dialog?.window?.setLayout( dialog?.window?.setLayout(
LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT LinearLayout.LayoutParams.MATCH_PARENT
) )
if (isRecording) {
recordContainer.visibility = View.VISIBLE
} else {
recordContainer.visibility = View.GONE
}
} }
isFullScreen = !isFullScreen isFullScreen = !isFullScreen
@ -868,7 +889,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
} else { } else {
if (isCircle) { if (isCircle) {
screenWidth = 300F screenWidth = 300F
screenHeight = 300F screenHeight = 300F
layoutNameParam.height = 0 layoutNameParam.height = 0
@ -883,7 +904,12 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
controlPanelParam.height = panelHeightSmall controlPanelParam.height = panelHeightSmall
} }
controlPanel.setPadding(panelPaddingMedium, panelPaddingMedium, panelPaddingMedium, panelPaddingMedium) controlPanel.setPadding(
panelPaddingMedium,
panelPaddingMedium,
panelPaddingMedium,
panelPaddingMedium
)
} }
layoutName.layoutParams = layoutNameParam layoutName.layoutParams = layoutNameParam
@ -893,7 +919,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
var videoStreamHeight = var videoStreamHeight =
screenHeight - controlPanelParam.height - layoutNameParam.height - layoutMiniParam.height screenHeight - controlPanelParam.height - layoutNameParam.height - layoutMiniParam.height
if (isFullScreen){ if (isFullScreen) {
// videoStreamHeight -= getStatusBarHeight() / 2 // videoStreamHeight -= getStatusBarHeight() / 2
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

@ -109,6 +109,23 @@
android:src="@drawable/video_off_fill" /> android:src="@drawable/video_off_fill" />
</FrameLayout> </FrameLayout>
<FrameLayout
android:id="@+id/record_container"
android:layout_width="@dimen/local_preview_width"
android:layout_height="@dimen/local_preview_height"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:visibility="visible">
<ImageView
android:id="@+id/record_icon"
android:layout_width="@dimen/local_back_icon_size"
android:layout_height="@dimen/local_back_icon_size"
android:layout_gravity="center"
android:scaleType="centerCrop"
android:src="@drawable/ic_record" />
</FrameLayout>
<FrameLayout <FrameLayout
android:id="@+id/thumbnail_container" android:id="@+id/thumbnail_container"
android:layout_width="90dp" android:layout_width="90dp"

@ -23,19 +23,20 @@ class VideoCallService extends BaseService {
locator<LiveCarePatientServices>(); locator<LiveCarePatientServices>();
openVideo(StartCallRes startModel, PatiantInformtion patientModel, openVideo(StartCallRes startModel, PatiantInformtion patientModel,
VoidCallback onCallConnected, VoidCallback onCallDisconnected) async { bool isRecording,VoidCallback onCallConnected, VoidCallback onCallDisconnected) async {
this.startCallRes = startModel; this.startCallRes = startModel;
this.patient = patientModel; this.patient = patientModel;
DoctorProfileModel doctorProfile = DoctorProfileModel doctorProfile =
await getDoctorProfile(isGetProfile: true); await getDoctorProfile(isGetProfile: true);
await VideoChannel.openVideoCallScreen( await VideoChannel.openVideoCallScreen(
kToken: startCallRes.openTokenID, kToken: startCallRes.openTokenID,
// "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==", kSessionId: startCallRes.openSessionID,
kSessionId: startCallRes.openSessionID, kApiKey:'46209962',
// "1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg", // kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==",
// kSessionId: "1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg",
kApiKey:'46209962', //'47247954', // kApiKey:'47247954',
vcId: patient.vcId, vcId: patient.vcId,
isRecording: isRecording,
patientName: patient.fullName ?? patientName: patient.fullName ??
(patient.firstName != null (patient.firstName != null
? "${patient.firstName} ${patient.lastName}" ? "${patient.firstName} ${patient.lastName}"
@ -47,6 +48,7 @@ class VideoCallService extends BaseService {
DrAppToastMsg.showErrorToast(error); DrAppToastMsg.showErrorToast(error);
}, },
onCallConnected: onCallConnected, onCallConnected: onCallConnected,
onCallDisconnected: onCallDisconnected,
onCallEnd: () { onCallEnd: () {
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(

@ -41,9 +41,33 @@ class LiveCarePatientServices extends BaseService {
await baseAppClient.post( await baseAppClient.post(
GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP, GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_patientList.clear();
List<PatiantInformtion> localPatientList= [];
response['List_PendingPatientList'].forEach((v) { response['List_PendingPatientList'].forEach((v) {
_patientList.add(PatiantInformtion.fromJson(v)); localPatientList.add(PatiantInformtion.fromJson(v));
});
/// add new items.
localPatientList.forEach((element) {
if ((_patientList.singleWhere((it) => it.patientId == element.patientId,
orElse: () => null)) == null) {
_patientList.add(element);
}
});
/// remove items.
List<PatiantInformtion> removedPatientList= [];
_patientList.forEach((element) {
if ((localPatientList.singleWhere((it) => it.patientId == element.patientId,
orElse: () => null)) == null) {
removedPatientList.add(element);
}
});
removedPatientList.forEach((element) {
_patientList.remove(element);
}); });
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {

@ -238,4 +238,18 @@ class LiveCarePatientViewModel extends BaseViewModel {
AlternativeService(serviceID: 11, serviceName: "GASTRIC TUBE CHANGE"), AlternativeService(serviceID: 11, serviceName: "GASTRIC TUBE CHANGE"),
); );
} }
updateInCallPatient({PatiantInformtion patient, appointmentNo}){
_liveCarePatientServices.patientList.forEach((e) {
if(e.patientId == patient.patientId) {
e.episodeNo = 0 ;
e.appointmentNo = appointmentNo;
return;
}
});
setState(ViewState.Idle);
}
} }

@ -5,6 +5,7 @@ class StartCallRes {
bool isAuthenticated; bool isAuthenticated;
int messageStatus; int messageStatus;
String appointmentNo; String appointmentNo;
bool isRecording;
StartCallRes( StartCallRes(
{this.result, {this.result,
@ -12,7 +13,9 @@ class StartCallRes {
this.openTokenID, this.openTokenID,
this.isAuthenticated, this.isAuthenticated,
this.appointmentNo, this.appointmentNo,
this.messageStatus}); this.messageStatus,
this.isRecording = true,
});
StartCallRes.fromJson(Map<String, dynamic> json) { StartCallRes.fromJson(Map<String, dynamic> json) {
result = json['Result']; result = json['Result'];
@ -21,6 +24,7 @@ class StartCallRes {
isAuthenticated = json['IsAuthenticated']; isAuthenticated = json['IsAuthenticated'];
messageStatus = json['MessageStatus']; messageStatus = json['MessageStatus'];
appointmentNo = json['AppointmentNo']; appointmentNo = json['AppointmentNo'];
isRecording = json['isRecording'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -31,6 +35,7 @@ class StartCallRes {
data['IsAuthenticated'] = this.isAuthenticated; data['IsAuthenticated'] = this.isAuthenticated;
data['MessageStatus'] = this.messageStatus; data['MessageStatus'] = this.messageStatus;
data['AppointmentNo'] = this.appointmentNo; data['AppointmentNo'] = this.appointmentNo;
data['isRecording'] = this.isRecording;
return data; return data;
} }
} }

@ -1,9 +1,9 @@
// TODO : it have to be changed. // TODO = it have to be changed.
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
class PatiantInformtion { class PatiantInformtion {
final PatiantInformtion patientDetails; PatiantInformtion patientDetails;
int genderInt; int genderInt;
dynamic age; dynamic age;
String appointmentDate; String appointmentDate;
@ -79,178 +79,268 @@ class PatiantInformtion {
int vcId; int vcId;
String voipToken; String voipToken;
PatiantInformtion( PatiantInformtion({this.patientDetails,
{this.patientDetails, this.projectId,
this.projectId, this.clinicId,
this.clinicId, this.doctorId,
this.doctorId, this.patientId,
this.patientId, this.doctorName,
this.doctorName, this.doctorNameN,
this.doctorNameN, this.firstName,
this.firstName, this.middleName,
this.middleName, this.lastName,
this.lastName, this.firstNameN,
this.firstNameN, this.middleNameN,
this.middleNameN, this.lastNameN,
this.lastNameN, this.gender,
this.gender, this.dateofBirth,
this.dateofBirth, this.nationalityId,
this.nationalityId, this.mobileNumber,
this.mobileNumber, this.emailAddress,
this.emailAddress, this.patientIdentificationNo,
this.patientIdentificationNo, this.patientType,
this.patientType, this.admissionNo,
this.admissionNo, this.admissionDate,
this.admissionDate, this.createdOn,
this.createdOn, this.roomId,
this.roomId, this.bedId,
this.bedId, this.nursingStationId,
this.nursingStationId, this.description,
this.description, this.clinicDescription,
this.clinicDescription, this.clinicDescriptionN,
this.clinicDescriptionN, this.nationalityName,
this.nationalityName, this.nationalityNameN,
this.nationalityNameN, this.age,
this.age, this.genderDescription,
this.genderDescription, this.nursingStationName,
this.nursingStationName, this.appointmentDate,
this.appointmentDate, this.startTime,
this.startTime, this.appointmentNo,
this.appointmentNo, this.arrivalTime,
this.arrivalTime, this.arrivalTimeD,
this.arrivalTimeD, this.callStatus,
this.callStatus, this.callStatusDisc,
this.callStatusDisc, this.callTypeID,
this.callTypeID, this.clientRequestID,
this.clientRequestID, this.clinicName,
this.clinicName, this.consoltationEnd,
this.consoltationEnd, this.consultationNotes,
this.consultationNotes, this.appointmentType,
this.appointmentType, this.appointmentTypeId,
this.appointmentTypeId, this.arrivedOn,
this.arrivedOn, this.clinicGroupId,
this.clinicGroupId, this.companyName,
this.companyName, this.dischargeStatus,
this.dischargeStatus, this.doctorDetails,
this.doctorDetails, this.endTime,
this.endTime, this.episodeNo,
this.episodeNo, this.fallRiskScore,
this.fallRiskScore, this.genderInt,
this.genderInt, this.isSigned,
this.isSigned, this.medicationOrders,
this.medicationOrders, this.nationality,
this.nationality, this.patientMRN,
this.patientMRN, this.visitType,
this.visitType, this.fullName,
this.fullName, this.fullNameN,
this.fullNameN, this.nationalityFlagURL,
this.nationalityFlagURL, this.patientStatusType,
this.patientStatusType, this.patientStatus,
this.patientStatus, this.visitTypeId,
this.visitTypeId, this.startTimes,
this.startTimes, this.dischargeDate,
this.dischargeDate, this.status,
this.status, this.vcId,
this.vcId, this.voipToken,
this.voipToken, this.admissionDateWithDateTimeForm,
this.admissionDateWithDateTimeForm,
this.appointmentDateWithDateTimeForm}); this.appointmentDateWithDateTimeForm});
factory PatiantInformtion.fromJson(Map<String, dynamic> json) => PatiantInformtion(
patientDetails: json['patientDetails'] != null ? new PatiantInformtion.fromJson(json['patientDetails']) : null, PatiantInformtion.fromJson(Map<String, dynamic> json) {
projectId: json["ProjectID"] ?? json["projectID"], {
clinicId: json["ClinicID"] ?? json["clinicID"], patientDetails = json['patientDetails'] != null
doctorId: json["DoctorID"] ?? json["doctorID"], ? new PatiantInformtion.fromJson(json['patientDetails'])
patientId: json["PatientID"] != null : null;
projectId = json["ProjectID"] ?? json["projectID"];
clinicId = json["ClinicID"] ?? json["clinicID"];
doctorId = json["DoctorID"] ?? json["doctorID"];
patientId = json["PatientID"] != null
? json["PatientID"] is String ? json["PatientID"] is String
? int.parse(json["PatientID"]) ? int.parse(json["PatientID"])
: json["PatientID"] : json["PatientID"]
: json["patientID"] ?? json['patientMRN'] ?? json['PatientMRN'], : json["patientID"] ?? json['patientMRN'] ?? json['PatientMRN'];
doctorName: json["DoctorName"] ?? json["doctorName"], doctorName = json["DoctorName"] ?? json["doctorName"];
doctorNameN: json["DoctorNameN"] ?? json["doctorNameN"], doctorNameN = json["DoctorNameN"] ?? json["doctorNameN"];
firstName: json["FirstName"] ?? json["firstName"], firstName = json["FirstName"] ?? json["firstName"];
middleName: json["MiddleName"] ?? json["middleName"], middleName = json["MiddleName"] ?? json["middleName"];
lastName: json["LastName"] ?? json["lastName"], lastName = json["LastName"] ?? json["lastName"];
firstNameN: json["FirstNameN"] ?? json["firstNameN"], firstNameN = json["FirstNameN"] ?? json["firstNameN"];
middleNameN: json["MiddleNameN"] ?? json["middleNameN"], middleNameN = json["MiddleNameN"] ?? json["middleNameN"];
lastNameN: json["LastNameN"] ?? json["lastNameN"], lastNameN = json["LastNameN"] ?? json["lastNameN"];
gender: json["Gender"] != null gender = json["Gender"] != null
? json["Gender"] is String ? json["Gender"] is String
? int.parse(json["Gender"]) ? int.parse(json["Gender"])
: json["Gender"] : json["Gender"]
: json["gender"], : json["gender"];
fullName: json["fullName"] ?? json["fullName"] ?? json["PatientName"], fullName = json["fullName"] ?? json["fullName"] ?? json["PatientName"];
fullNameN: json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"], fullNameN =
dateofBirth: json["DateofBirth"] ?? json["dob"] ?? json['DateOfBirth'], json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"];
nationalityId: json["NationalityID"] ?? json["nationalityID"], dateofBirth = json["DateofBirth"] ?? json["dob"] ?? json['DateOfBirth'];
mobileNumber: json["MobileNumber"] ?? json["mobileNumber"], nationalityId = json["NationalityID"] ?? json["nationalityID"];
emailAddress: json["EmailAddress"] ?? json["emailAddress"], mobileNumber = json["MobileNumber"] ?? json["mobileNumber"];
patientIdentificationNo: json["PatientIdentificationNo"] ?? json["patientIdentificationNo"], emailAddress = json["EmailAddress"] ?? json["emailAddress"];
patientIdentificationNo =
json["PatientIdentificationNo"] ?? json["patientIdentificationNo"];
//TODO make 7 dynamic when the backend retrun it in patient arrival //TODO make 7 dynamic when the backend retrun it in patient arrival
patientType: json["PatientType"] ?? json["patientType"] ?? 1, patientType = json["PatientType"] ?? json["patientType"] ?? 1;
admissionNo: json["AdmissionNo"] ?? json["admissionNo"], admissionNo = json["AdmissionNo"] ?? json["admissionNo"];
admissionDate: json["AdmissionDate"] ?? json["admissionDate"], admissionDate = json["AdmissionDate"] ?? json["admissionDate"];
createdOn: json["CreatedOn"] ?? json["CreatedOn"], createdOn = json["CreatedOn"] ?? json["CreatedOn"];
roomId: json["RoomID"] ?? json["roomID"], roomId = json["RoomID"] ?? json["roomID"];
bedId: json["BedID"] ?? json["bedID"], bedId = json["BedID"] ?? json["bedID"];
nursingStationId: json["NursingStationID"] ?? json["nursingStationID"], nursingStationId = json["NursingStationID"] ?? json["nursingStationID"];
description: json["Description"] ?? json["description"], description = json["Description"] ?? json["description"];
clinicDescription: json["ClinicDescription"] ?? json["clinicDescription"], clinicDescription =
clinicDescriptionN: json["ClinicDescriptionN"] ?? json["clinicDescriptionN"], json["ClinicDescription"] ?? json["clinicDescription"];
nationalityName: json["NationalityName"] ?? json["nationalityName"] ?? json['NationalityName'], clinicDescriptionN =
nationalityNameN: json["NationalityNameN"] ?? json["nationalityNameN"] ?? json['NationalityNameN'], json["ClinicDescriptionN"] ?? json["clinicDescriptionN"];
age: json["Age"] ?? json["age"], nationalityName = json["NationalityName"] ??
genderDescription: json["GenderDescription"], json["nationalityName"] ??
nursingStationName: json["NursingStationName"], json['NationalityName'];
appointmentDate: json["AppointmentDate"] ?? '', nationalityNameN = json["NationalityNameN"] ??
startTime: json["startTime"] ?? json['StartTime'], json["nationalityNameN"] ??
appointmentNo: json['appointmentNo'] ?? json['AppointmentNo'], json['NationalityNameN'];
appointmentType: json['appointmentType'], age = json["Age"] ?? json["age"];
appointmentTypeId: json['appointmentTypeId'] ?? json['appointmentTypeid'], genderDescription = json["GenderDescription"];
arrivedOn: json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn'], nursingStationName = json["NursingStationName"];
clinicGroupId: json['clinicGroupId'], appointmentDate = json["AppointmentDate"] ?? '';
companyName: json['companyName'], startTime = json["startTime"] ?? json['StartTime'];
dischargeStatus: json['dischargeStatus'], appointmentNo = json['appointmentNo'] ?? json['AppointmentNo'];
doctorDetails: json['doctorDetails'], appointmentType = json['appointmentType'];
endTime: json['endTime'], appointmentTypeId =
episodeNo: json['episodeNo'] ?? json['EpisodeID'] ?? json['EpisodeNo'], json['appointmentTypeId'] ?? json['appointmentTypeid'];
fallRiskScore: json['fallRiskScore'], arrivedOn = json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn'];
isSigned: json['isSigned'], clinicGroupId = json['clinicGroupId'];
medicationOrders: json['medicationOrders'], companyName = json['companyName'];
nationality: json['nationality'] ?? json['NationalityNameN'], dischargeStatus = json['dischargeStatus'];
patientMRN: json['patientMRN'] ?? doctorDetails = json['doctorDetails'];
endTime = json['endTime'];
episodeNo = json['episodeNo'] ?? json['EpisodeID'] ?? json['EpisodeNo'];
fallRiskScore = json['fallRiskScore'];
isSigned = json['isSigned'];
medicationOrders = json['medicationOrders'];
nationality = json['nationality'] ?? json['NationalityNameN'];
patientMRN = json['patientMRN'] ??
json['PatientMRN'] ?? json['PatientMRN'] ??
(json["PatientID"] != null (json["PatientID"] != null
? int?.parse(json["PatientID"].toString()) ? int?.parse(json["PatientID"].toString())
: json["patientID"] != null : json["patientID"] != null ? int?.parse(
? int?.parse(json["patientID"].toString()) json["patientID"].toString()) : json["patientId"] != null ? int
: json["patientId"] != null ?.parse(json["patientId"].toString()) : '');
? int?.parse(json["patientId"].toString()) visitType = json['visitType'] ?? json['visitType'] ?? json['visitType'];
: ''), nationalityFlagURL =
visitType: json['visitType'] ?? json['visitType'] ?? json['visitType'], json['NationalityFlagURL'] ?? json['NationalityFlagURL'];
nationalityFlagURL: json['NationalityFlagURL'] ?? json['NationalityFlagURL'], patientStatusType =
patientStatusType: json['patientStatusType'] ?? json['PatientStatusType'], json['patientStatusType'] ?? json['PatientStatusType'];
visitTypeId: json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'], visitTypeId =
startTimes: json['StartTime'] ?? json['StartTime'], json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'];
dischargeDate: json['DischargeDate'], startTimes = json['StartTime'] ?? json['StartTime'];
status: json['Status'], dischargeDate = json['DischargeDate'];
vcId: json['VC_ID'], status = json['Status'];
arrivalTime: json['ArrivalTime'], vcId = json['VC_ID'];
arrivalTimeD: json['ArrivalTimeD'],
callStatus: json['CallStatus'], arrivalTime = json['ArrivalTime'];
callStatusDisc: json['CallStatusDisc'], arrivalTimeD = json['ArrivalTimeD'];
callTypeID: json['CallTypeID'], callStatus = json['CallStatus'];
clientRequestID: json['ClientRequestID'], callStatusDisc = json['CallStatusDisc'];
clinicName: json['ClinicName'], callTypeID = json['CallTypeID'];
consoltationEnd: json['ConsoltationEnd'], clientRequestID = json['ClientRequestID'];
consultationNotes: json['ConsultationNotes'], clinicName = json['ClinicName'];
patientStatus: json['PatientStatus'], consoltationEnd = json['ConsoltationEnd'];
voipToken: json['VoipToken'], consultationNotes = json['ConsultationNotes'];
admissionDateWithDateTimeForm: json["AdmissionDate"] != null patientStatus = json['PatientStatus'];
voipToken = json['VoipToken'];
admissionDateWithDateTimeForm = json["AdmissionDate"] != null
? AppDateUtils.convertStringToDate(json["AdmissionDate"]) ? AppDateUtils.convertStringToDate(json["AdmissionDate"])
: json["admissionDate"] != null : json["admissionDate"] != null ? AppDateUtils.convertStringToDate(
? AppDateUtils.convertStringToDate(json["admissionDate"]) json["admissionDate"]) : null;
: null,
appointmentDateWithDateTimeForm: appointmentDateWithDateTimeForm =
json["AppointmentDate"] != null ? AppDateUtils.convertStringToDate(json["AppointmentDate"]) : null); json["AppointmentDate"] != null ? AppDateUtils.convertStringToDate(
} json["AppointmentDate"]) : null;
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['patientDetails'] = this.patientDetails;
data["ProjectID"] = this.projectId;
data["projectID"] = this.projectId;
data["ClinicID"] = this.clinicId;
data["clinicID"] = this.clinicId;
data["DoctorID"] = this.doctorId;
data["doctorID"] = this.doctorId;
data["PatientID"] = this.patientId;
data["patientID"] = this.patientId;
data['patientMRN'] = this.patientMRN;
data['PatientMRN'] = this.patientMRN;
data['episodeNo'] = this.episodeNo;
data['EpisodeID'] = this.episodeNo;
data['EpisodeNo'] = this.episodeNo;
data["DoctorName"] = this.doctorName;
data["doctorName"] = this.doctorName;
data["DoctorNameN"] = this.doctorNameN;
data["doctorNameN"] = this.doctorNameN;
data["FirstName"] = this.firstName;
data["firstName"] = this.firstName;
data["MiddleName"] = this.middleName;
data["middleName"] = this.middleName;
data["LastName"] = this.lastName;
data["lastName"] = this.lastName;
data["FirstNameN"] = this.firstNameN;
data["firstNameN"] = this.firstNameN;
data["MiddleNameN"] = this.middleNameN;
data["middleNameN"] = this.middleNameN;
data["LastNameN"] = this.lastNameN;
data["lastNameN"] = this.lastNameN;
data["fullName"] = this.fullName;
data["fullName"] = this.fullName;
data["PatientName"] = this.fullName;
data["Gender"] = this.gender;
data["gender"] = this.gender;
data['Age'] = this.age;
data['AppointmentDate'] = this.appointmentDate.isNotEmpty?this.appointmentDate:null;
data['AppointmentNo'] = this.appointmentNo;
data['ArrivalTime'] = this.arrivalTime;
data['ArrivalTimeD'] = this.arrivalTimeD;
data['CallStatus'] = this.callStatus;
data['CallStatusDisc'] = this.callStatusDisc;
data['CallTypeID'] = this.callTypeID;
data['ClientRequestID'] = this.clientRequestID;
data['ClinicName'] = this.clinicName;
data['ConsoltationEnd'] = this.consoltationEnd;
data['ConsultationNotes'] = this.consultationNotes;
data['CreatedOn'] = this.createdOn;
data['DoctorName'] = this.doctorName;
data['Gender'] = this.gender;
data['MobileNumber'] = this.mobileNumber;
data['PatientID'] = this.patientId;
data['PatientStatus'] = this.patientStatus;
data['ProjectID'] = this.projectId;
data['VC_ID'] = this.vcId;
data['VoipToken'] = this.voipToken;
data["DateofBirth"] = this.dateofBirth;
data["dob"] = this.dateofBirth;
data['DateOfBirth'] = this.dateofBirth;
return data;
}
}

@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/home/dashboard_slider-item-widget.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_slider-item-widget.dart';
import 'package:doctor_app_flutter/screens/home/dashboard_swipe_widget.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_swipe_widget.dart';
@ -28,6 +29,7 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:sticky_headers/sticky_headers/widget.dart'; import 'package:sticky_headers/sticky_headers/widget.dart';
import '../../routes.dart';
import '../../widgets/shared/app_texts_widget.dart'; import '../../widgets/shared/app_texts_widget.dart';
class HomeScreen extends StatefulWidget { class HomeScreen extends StatefulWidget {
@ -288,7 +290,8 @@ class _HomeScreenState extends State<HomeScreen> {
child: ListView( child: ListView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: [ children: [
...homePatientsCardsWidget(model, projectsProvider), ...homePatientsCardsWidget(
model, projectsProvider),
])), ])),
SizedBox( SizedBox(
height: 20, height: 20,
@ -306,7 +309,8 @@ class _HomeScreenState extends State<HomeScreen> {
); );
} }
List<Widget> homePatientsCardsWidget(DashboardViewModel model,projectsProvider) { List<Widget> homePatientsCardsWidget(
DashboardViewModel model, projectsProvider) {
colorIndex = 0; colorIndex = 0;
List<Color> backgroundColors = List(3); List<Color> backgroundColors = List(3);
@ -334,6 +338,22 @@ class _HomeScreenState extends State<HomeScreen> {
text: text:
"${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}", "${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}",
onTap: () { onTap: () {
// PatiantInformtion patient = PatiantInformtion(
// patientStatusType: 43,
// episodeNo: 0,
// vcId: 42342,
// fullName: "mosa test",
// dateofBirth: "2000-05-01 10:42:35.790004"
// );
// Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
// "patient": patient,
// "patientType": "0",
// "isSearch": false,
// "isInpatient": false,
// "arrivalType": "0",
// "isSearchAndOut": false,
// "isFromLiveCare": true,
// });
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -355,8 +375,10 @@ class _HomeScreenState extends State<HomeScreen> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: PatientInPatientScreen(specialClinic: model.getSpecialClinic(clinicId??projectsProvider page: PatientInPatientScreen(
.doctorClinicsList[0].clinicID),), specialClinic: model.getSpecialClinic(
clinicId ?? projectsProvider.doctorClinicsList[0].clinicID),
),
), ),
); );
}, },
@ -394,14 +416,12 @@ class _HomeScreenState extends State<HomeScreen> {
backgroundIconColor: backgroundIconColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.referral_1, cardIcon: DoctorApp.referral_1,
textColor: textColors[colorIndex], textColor: textColors[colorIndex],
text: TranslationBase.of(context) text: TranslationBase.of(context).myPatientsReferral,
.myPatientsReferral,
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) => PatientReferralScreen(),
PatientReferralScreen(),
), ),
); );
}, },
@ -413,14 +433,12 @@ class _HomeScreenState extends State<HomeScreen> {
backgroundIconColor: backgroundIconColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.search, cardIcon: DoctorApp.search,
textColor: textColors[colorIndex], textColor: textColors[colorIndex],
text: TranslationBase.of(context) text: TranslationBase.of(context).searchPatientDashBoard,
.searchPatientDashBoard,
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) => PatientSearchScreen(),
PatientSearchScreen(),
)); ));
}, },
)); ));
@ -431,14 +449,12 @@ class _HomeScreenState extends State<HomeScreen> {
backgroundIconColor: backgroundIconColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.search_medicines, cardIcon: DoctorApp.search_medicines,
textColor: textColors[colorIndex], textColor: textColors[colorIndex],
text: TranslationBase.of(context) text: TranslationBase.of(context).searchMedicineDashboard,
.searchMedicineDashboard,
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) => MedicineSearchScreen(),
MedicineSearchScreen(),
)); ));
}, },
)); ));

@ -79,6 +79,7 @@ class _EndCallScreenState extends State<EndCallScreen> {
kSessionId: liveCareModel.startCallRes.openSessionID, kSessionId: liveCareModel.startCallRes.openSessionID,
kApiKey: '46209962', kApiKey: '46209962',
vcId: patient.vcId, vcId: patient.vcId,
isRecording: liveCareModel.startCallRes != null ? liveCareModel.startCallRes.isRecording: false,
patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"),
tokenID: await liveCareModel.getToken(), tokenID: await liveCareModel.getToken(),
generalId: GENERAL_ID, generalId: GENERAL_ID,

@ -146,7 +146,7 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: PatientCard( child: PatientCard(
patientInfo: model.filterData[index], patientInfo: PatiantInformtion.fromJson(model.filterData[index].toJson()),
patientType: "0", patientType: "0",
arrivalType: "0", arrivalType: "0",
isFromSearch: false, isFromSearch: false,
@ -155,7 +155,7 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
onTap: () { onTap: () {
// TODO change the parameter to daynamic // TODO change the parameter to daynamic
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": model.filterData[index], "patient": PatiantInformtion.fromJson(model.filterData[index].toJson()),
"patientType": "0", "patientType": "0",
"isSearch": false, "isSearch": false,
"isInpatient": false, "isInpatient": false,

@ -66,6 +66,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
//'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg', //'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg',
kApiKey: '46209962', kApiKey: '46209962',
vcId: widget.patientData.vcId, vcId: widget.patientData.vcId,
isRecording: tokenData != null ? tokenData.isRecording: false,
patientName: widget.patientData.fullName ?? widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-", patientName: widget.patientData.fullName ?? widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-",
tokenID: token, //"hfkjshdf347r8743", tokenID: token, //"hfkjshdf347r8743",
generalId: "Cs2020@2016\$2958", generalId: "Cs2020@2016\$2958",

@ -26,7 +26,7 @@ class InPatientPage extends StatefulWidget {
class _InPatientPageState extends State<InPatientPage> { class _InPatientPageState extends State<InPatientPage> {
TextEditingController _searchController = TextEditingController(); TextEditingController _searchController = TextEditingController();
bool isSortDes = true; bool isSortDes = false;
@override @override
void dispose() { void dispose() {

@ -1,12 +1,10 @@
import 'dart:async'; import 'dart:async';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/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/models/SOAP/PostEpisodeReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart';
import 'package:doctor_app_flutter/models/livecare/session_status_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart'; import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart';
@ -14,11 +12,8 @@ import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profi
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_other.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_other.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_search.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_search.dart';
import 'package:doctor_app_flutter/util/NotificationPermissionUtils.dart'; import 'package:doctor_app_flutter/util/NotificationPermissionUtils.dart';
import 'package:doctor_app_flutter/util/VideoChannel.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
@ -118,6 +113,10 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
callDisconnected() { callDisconnected() {
callTimer.cancel(); callTimer.cancel();
videoCallDurationStreamController.sink.add(null); videoCallDurationStreamController.sink.add(null);
setState(() {
isCallStarted = false;
});
} }
@override @override
@ -302,52 +301,73 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
: TranslationBase.of(context).initiateCall, : TranslationBase.of(context).initiateCall,
disabled: isCallStarted || model.state == ViewState.BusyLocal, disabled: isCallStarted || model.state == ViewState.BusyLocal,
onPressed: () async { onPressed: () async {
// Navigator.push(context, MaterialPageRoute( // AppPermissionsUtils
// builder: (BuildContext context) => // .requestVideoCallPermission(
// EndCallScreen(patient:patient))); // context: context,
// onTapGrant: () {
// AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){ // locator<VideoCallService>()
// locator<VideoCallService>().openVideo(model.startCallRes, patient, callConnected, callDisconnected); // .openVideo(
// }); // model.startCallRes,
// patient,
if(isCallFinished) { // false, callConnected, // model.startCallRes.isRecording
Navigator.push(context, MaterialPageRoute( // callDisconnected);
builder: (BuildContext context) => EndCallScreen(patient:patient))); // });
} else { if (isCallFinished) {
GifLoaderDialogUtils.showMyDialog(context); Navigator.push(
await model.startCall( isReCall : false, vCID: patient.vcId); context,
MaterialPageRoute(
if(model.state == ViewState.ErrorLocal) { builder: (BuildContext context) =>
GifLoaderDialogUtils.hideDialog(context); EndCallScreen(patient: patient)));
Helpers.showErrorToast(model.error); } else {
} else { GifLoaderDialogUtils.showMyDialog(context);
await model.getDoctorProfile(); await model.startCall(
patient.appointmentNo = int.parse(model.startCallRes.appointmentNo.toString()); isReCall: false, vCID: patient.vcId);
patient.episodeNo = 0;
setState(() {
isCallStarted = true;
});
GifLoaderDialogUtils.hideDialog(context);
AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){
locator<VideoCallService>().openVideo(model.startCallRes, patient, callConnected, callDisconnected);
});
}
}
}, if (model.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context);
Helpers.showErrorToast(model.error);
} else {
await model.getDoctorProfile();
patient.appointmentNo = int.parse(model
.startCallRes.appointmentNo
.toString());
patient.episodeNo = 0;
model.updateInCallPatient(
patient: patient,
appointmentNo: int.parse(model
.startCallRes.appointmentNo
.toString()));
setState(() {
isCallStarted = true;
});
GifLoaderDialogUtils.hideDialog(context);
AppPermissionsUtils
.requestVideoCallPermission(
context: context,
onTapGrant: () {
locator<VideoCallService>()
.openVideo(
model.startCallRes,
patient,
/*model.startCallRes != null ? model.startCallRes.isRecording : */ true
, callConnected,
callDisconnected);
});
}
}
},
),
),
), ),
), ),
), SizedBox(
), height: 5,
SizedBox( ),
height: 5, ],
), ),
], )
), : null,
) : null, ),
),
); );
} }
} }

@ -11,7 +11,7 @@ class VideoChannel{
/// channel name /// channel name
static const _channel = const MethodChannel("Dr.cloudSolution/videoCall"); static const _channel = const MethodChannel("Dr.cloudSolution/videoCall");
static openVideoCallScreen({kApiKey, kSessionId, kToken, callDuration, warningDuration,int vcId,String tokenID, static openVideoCallScreen({kApiKey, kSessionId, kToken, callDuration, warningDuration,int vcId,String tokenID,
String generalId,int doctorId, String patientName, Function() onCallEnd , String generalId,int doctorId, String patientName, bool isRecording = false, Function() onCallEnd ,
Function(SessionStatusModel sessionStatusModel) onCallNotRespond ,Function(String error) onFailure, VoidCallback onCallConnected, VoidCallback onCallDisconnected}) async { Function(SessionStatusModel sessionStatusModel) onCallNotRespond ,Function(String error) onFailure, VoidCallback onCallConnected, VoidCallback onCallDisconnected}) async {
onCallConnected = onCallConnected ?? (){}; onCallConnected = onCallConnected ?? (){};
@ -41,6 +41,7 @@ class VideoChannel{
"generalId": generalId, "generalId": generalId,
"DoctorId": doctorId , "DoctorId": doctorId ,
"patientName": patientName, "patientName": patientName,
"isRecording": isRecording,
}, },
); );
if(result['callResponse'] == 'CallEnd') { if(result['callResponse'] == 'CallEnd') {

Loading…
Cancel
Save