Merge branch 'flutter_vervion_2_by_elham' into 'flutter_2_developemt'

Flutter vervion 2 by elham

See merge request Cloud_Solution/doctor_app_flutter!888
merge-requests/889/merge
Elham Ali 4 years ago
commit ede9574084

@ -28,6 +28,15 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 30
// signingConfigs {
// release {
// storeFile file('C:\\Users\\admin\\Downloads\\DQKey.jks')
// storePassword 'HmGsa123'
// keyAlias 'key'
// keyPassword 'HmGsa123'
// }
// }
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
@ -50,10 +59,25 @@ android {
buildTypes {
release {
// TODO: Add your own signing config for the release build.
signingConfig signingConfigs.debug
}
debug {
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
// flavorDimensions 'environment'
// productFlavors {
// production {
// dimension 'environment'
// }
// }
//
// configurations {
// productionDebugImplementation
// productionReleaseImplementation
// }
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
@ -84,6 +108,8 @@ dependencies {
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1'
implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
implementation 'com.google.firebase:firebase-analytics:17.4.1'
}
apply plugin: 'com.google.gms.google-services'

@ -1,34 +1,77 @@
{
"project_info": {
"project_number": "157373154094",
"project_id": "hmg-doctor-app-1553688619744",
"storage_bucket": "hmg-doctor-app-1553688619744.appspot.com"
"project_number": "934365232760",
"project_id": "hmg-dr-app",
"storage_bucket": "hmg-dr-app.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:157373154094:android:daeea3a4e1f4462a1bf0bf",
"mobilesdk_app_id": "1:934365232760:android:024b3569972f1c09f9778d",
"android_client_info": {
"package_name": "COM.HMG.HMGDR"
}
},
"oauth_client": [
{
"client_id": "934365232760-bobv1r1sn222le020jeni6u1bdbjdu1v.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCpYwrmuntOBdZv6GV6KEnLj8nQRvEnZ6I"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "934365232760-bobv1r1sn222le020jeni6u1bdbjdu1v.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "934365232760-57v2ld1qqulc4nt4o5pgjfbpc47fj3qf.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "COM.HMG.HMGDR"
}
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:934365232760:android:e0e185e68c0d7690f9778d",
"android_client_info": {
"package_name": "com.hmg.hmgDr"
}
},
"oauth_client": [
{
"client_id": "157373154094-egrhbfr861l7k722g3v2gd4a0opi3r1u.apps.googleusercontent.com",
"client_id": "934365232760-bobv1r1sn222le020jeni6u1bdbjdu1v.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDX8RPwu00MyrpqC-T2zXtrUQvTQGRv1mM"
"current_key": "AIzaSyCpYwrmuntOBdZv6GV6KEnLj8nQRvEnZ6I"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "157373154094-egrhbfr861l7k722g3v2gd4a0opi3r1u.apps.googleusercontent.com",
"client_id": "934365232760-bobv1r1sn222le020jeni6u1bdbjdu1v.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "934365232760-57v2ld1qqulc4nt4o5pgjfbpc47fj3qf.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "COM.HMG.HMGDR"
}
}
]
}

@ -1,7 +0,0 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hmg.hmgDr">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>

@ -10,22 +10,30 @@
FlutterApplication and put your custom class here.
-->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.CALL_PHONE" />
<!-- Permission required to draw floating widget over other apps -->
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="28"
tools:ignore="ScopedStorage"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<application
android:name="io.flutter.app.FlutterApplication"
android:name=".AppApplication"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
tools:replace="android:name"
android:label="HMG Doctor">
<activity
android:name=".MainActivity"
@ -40,6 +48,11 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name = ".Service.VideoStreamFloatingWidgetService"
android:enabled="true"
android:exported="false"/>
<!--
Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java
@ -47,6 +60,22 @@
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<activity
android:name="com.hmg.hmgDr.globalErrorHandler.UCEDefaultActivity"
android:process=":error_activity" />
<provider
android:name="com.hmg.hmgDr.globalErrorHandler.UCEFileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>
</application>
</manifest>

@ -0,0 +1,12 @@
package com.hmg.hmgDr
import com.hmg.hmgDr.globalErrorHandler.LoggingExceptionHandler
import io.flutter.app.FlutterApplication
class AppApplication : FlutterApplication() {
override fun onCreate() {
super.onCreate()
// LoggingExceptionHandler(this, "ErrorFile")
}
}

@ -1,24 +1,40 @@
package com.hmg.hmgDr
import android.Manifest
import android.app.Activity
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.content.ServiceConnection
import android.content.pm.PackageManager
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.os.IBinder
import android.provider.Settings
import android.util.Log
import android.widget.Toast
import androidx.annotation.NonNull
import com.google.gson.GsonBuilder
import com.hmg.hmgDr.Model.GetSessionStatusModel
import com.hmg.hmgDr.Model.SessionStatusModel
import com.hmg.hmgDr.Service.VideoStreamFloatingWidgetService
import com.hmg.hmgDr.model.GetSessionStatusModel
import com.hmg.hmgDr.model.SessionStatusModel
import com.hmg.hmgDr.ui.VideoCallResponseListener
import com.hmg.hmgDr.ui.fragment.VideoCallFragment
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugins.GeneratedPluginRegistrant
import pub.devrel.easypermissions.AfterPermissionGranted
import pub.devrel.easypermissions.AppSettingsDialog
import pub.devrel.easypermissions.EasyPermissions
class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler, VideoCallResponseListener {
class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
VideoCallResponseListener {
/* Permission request code to draw over other apps */
private val DRAW_OVER_OTHER_APP_PERMISSION_REQUEST_CODE = 1222
private val CHANNEL = "Dr.cloudSolution/videoCall"
private lateinit var methodChannel: MethodChannel
@ -26,7 +42,13 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
private var call: MethodCall? = null
private val LAUNCH_VIDEO: Int = 1
private var dialogFragment: VideoCallFragment? = null
private var serviceIntent: Intent? = null
private var videoStreamService: VideoStreamFloatingWidgetService? = null
private var bound = false
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine)
@ -54,18 +76,24 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
val generalId = call.argument<String>("generalId")
val doctorId = call.argument<Int>("DoctorId")
val patientName = call.argument<String>("patientName")
val isRecording = call.argument<Boolean>("isRecording")
val sessionStatusModel = GetSessionStatusModel(VC_ID, tokenID, generalId, doctorId, patientName)
val sessionStatusModel =
GetSessionStatusModel(
VC_ID,
tokenID,
generalId,
doctorId,
patientName,
isRecording!!
)
openVideoCall(apiKey, sessionId, token, appLang, baseUrl, sessionStatusModel)
}
"closeVideoCall" -> {
dialogFragment?.onCallClicked()
}
"onCallConnected" -> {
videoStreamService?.closeVideoCall()
}
else -> {
result.notImplemented()
@ -73,65 +101,87 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
}
}
private fun openVideoCall(apiKey: String?, sessionId: String?, token: String?, appLang: String?, baseUrl: String?, sessionStatusModel: GetSessionStatusModel) {
if (dialogFragment == null) {
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)
val transaction = supportFragmentManager.beginTransaction()
dialogFragment = VideoCallFragment.newInstance(arguments)
dialogFragment?.let {
it.setCallListener(this)
it.isCancelable = true
if (it.isAdded){
it.dismiss()
}else {
it.show(transaction, "dialog")
}
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)
// start service
// serviceIntent = Intent(this@MainActivity, VideoStreamContainerService::class.java)
if (videoStreamService == null || videoStreamService?.serviceRunning == false) {
serviceIntent = Intent(this@MainActivity, VideoStreamFloatingWidgetService::class.java)
serviceIntent?.run {
putExtras(arguments)
action = VideoStreamFloatingWidgetService.ACTION_START_CALL
}
} else if (!dialogFragment!!.isVisible) {
val transaction = supportFragmentManager.beginTransaction()
dialogFragment!!.show(transaction, "dialog")
checkFloatingWidgetPermission()
}
}
private fun checkFloatingWidgetPermission() {
// Check if the application has draw over other apps permission or not?
// This permission is by default available for API<23. But for API > 23
// you have to ask for the permission in runtime.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !Settings.canDrawOverlays(this)) {
//If the draw over permission is not available open the settings screen
//to grant the permission.
val intent = Intent(
Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
Uri.parse("package:$packageName")
)
startActivityForResult(intent, DRAW_OVER_OTHER_APP_PERMISSION_REQUEST_CODE)
} else { //If permission is granted start floating widget service
startFloatingWidgetService()
}
}
/* override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
var asd = "";
if (requestCode == LAUNCH_VIDEO) {
if (resultCode == Activity.RESULT_OK) {
val result : SessionStatusModel? = data?.getParcelableExtra("sessionStatusNotRespond")
val callResponse : HashMap<String, String> = HashMap()
val sessionStatus : HashMap<String, String> = HashMap()
val gson = GsonBuilder().serializeNulls().create()
callResponse["callResponse"] = "CallNotRespond"
val jsonRes = gson.toJson(result)
callResponse["sessionStatus"] = jsonRes
private fun startFloatingWidgetService() {
startService(serviceIntent)
bindService()
}
this.result?.success(callResponse)
}
if (resultCode == Activity.RESULT_CANCELED) {
val callResponse : HashMap<String, String> = HashMap()
callResponse["callResponse"] = "CallEnd"
override fun onDestroy() {
super.onDestroy()
if (bound) {
unbindService()
}
}
result?.success(callResponse)
}
}
}*/
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (requestCode == DRAW_OVER_OTHER_APP_PERMISSION_REQUEST_CODE) {
//Check if the permission is granted or not.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (Settings.canDrawOverlays(this)) {
startFloatingWidgetService()
} else {
//Permission is not available then display toast
Toast.makeText(
this,
"Draw over other app permission not available. App won\\'t work without permission. Please try again.",
Toast.LENGTH_SHORT
).show()
}
} else {
startFloatingWidgetService()
}
} else {
super.onActivityResult(requestCode, resultCode, data)
}
}
override fun onCallFinished(resultCode: Int, intent: Intent?) {
dialogFragment = null
if (resultCode == Activity.RESULT_OK) {
val result: SessionStatusModel? = intent?.getParcelableExtra("sessionStatusNotRespond")
val callResponse: HashMap<String, String> = HashMap()
@ -145,7 +195,7 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
try {
this.result?.success(callResponse)
} catch (e : Exception){
} catch (e: Exception) {
Log.e("onVideoCallFinished", "${e.message}.")
}
} else if (resultCode == Activity.RESULT_CANCELED) {
@ -153,26 +203,82 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
callResponse["callResponse"] = "CallEnd"
try {
result?.success(callResponse)
} catch (e : Exception){
} catch (e: Exception) {
Log.e("onVideoCallFinished", "${e.message}.")
}
}
}
override fun errorHandle(message: String) {
dialogFragment = null
// Toast.makeText(this, message, Toast.LENGTH_LONG).show()
stopService(serviceIntent)
}
override fun minimizeVideoEvent(isMinimize: Boolean) {
if (isMinimize)
methodChannel.invokeMethod("onCallConnected", null)
else
else {
methodChannel.invokeMethod("onCallDisconnected", null)
unbindService()
videoStreamService?.serviceRunning = false
videoStreamService = null
}
}
override fun onBackPressed() {
super.onBackPressed()
if (videoStreamService != null && videoStreamService?.serviceRunning == true && videoStreamService?.isFullScreen!!) {
videoStreamService!!.onMinimizedClicked()
} else {
super.onBackPressed()
}
}
override fun onPause() {
if (videoStreamService != null && videoStreamService?.serviceRunning == true && videoStreamService?.isFullScreen!!) {
videoStreamService!!.onMinimizedClicked()
}
super.onPause()
}
// override fun onStart() {
// super.onStart()
// bindService()
// }
//
// override fun onStop() {
// super.onStop()
// unbindService()
// }
private fun bindService() {
serviceIntent?.run {
if (videoStreamService != null && !videoStreamService!!.serviceRunning) {
startService(this)
}
bindService(this, serviceConnection, Context.BIND_AUTO_CREATE)
}
}
private fun unbindService() {
if (bound) {
videoStreamService?.videoCallResponseListener = null // unregister
unbindService(serviceConnection)
bound = false
}
}
private val serviceConnection: ServiceConnection = object : ServiceConnection {
override fun onServiceConnected(name: ComponentName?, service: IBinder?) {
// val binder: VideoStreamContainerService.VideoStreamBinder =
// service as VideoStreamContainerService.VideoStreamBinder
val binder: VideoStreamFloatingWidgetService.VideoStreamBinder =
service as VideoStreamFloatingWidgetService.VideoStreamBinder
videoStreamService = binder.service
bound = true
videoStreamService!!.videoCallResponseListener = this@MainActivity // register
videoStreamService?.serviceRunning = true
}
override fun onServiceDisconnected(name: ComponentName?) {
bound = false
}
}
}

@ -0,0 +1,234 @@
package com.hmg.hmgDr.Service
import android.annotation.SuppressLint
import android.app.Service
import android.content.Context
import android.graphics.PixelFormat
import android.graphics.Point
import android.os.Build
import android.os.CountDownTimer
import android.util.Log
import android.view.*
import androidx.core.view.GestureDetectorCompat
import com.hmg.hmgDr.R
import com.hmg.hmgDr.util.ViewsUtil
abstract class BaseMovingFloatingWidget : Service() {
val szWindow = Point()
lateinit var windowManagerParams: WindowManager.LayoutParams
var mWindowManager: WindowManager? = null
var floatingWidgetView: View? = null
lateinit var floatingViewContainer: View
lateinit var mDetector: GestureDetectorCompat
private var xInitCord = 0
private var yInitCord: Int = 0
private var xInitMargin: Int = 0
private var yInitMargin: Int = 0
/* Add Floating Widget View to Window Manager */
open fun addFloatingWidgetView() {
mWindowManager = getSystemService(Context.WINDOW_SERVICE) as WindowManager
//Init LayoutInflater
val inflater = getSystemService(LAYOUT_INFLATER_SERVICE) as LayoutInflater
//Inflate the removing view layout we created
floatingWidgetView = inflater.inflate(R.layout.activity_video_call, null)
//Add the view to the window.
windowManagerParams =
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
WindowManager.LayoutParams(
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.TYPE_PHONE,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
PixelFormat.TRANSLUCENT
)
} else {
WindowManager.LayoutParams(
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
PixelFormat.TRANSLUCENT
)
}
//Specify the view position
windowManagerParams.gravity = Gravity.TOP or Gravity.START
}
@SuppressLint("ClickableViewAccessibility")
val dragListener: View.OnTouchListener = View.OnTouchListener { _, event ->
mDetector.onTouchEvent(event)
//Get Floating widget view params
val layoutParams: WindowManager.LayoutParams =
floatingWidgetView!!.layoutParams as WindowManager.LayoutParams
//get the touch location coordinates
val x_cord = event.rawX.toInt()
val y_cord = event.rawY.toInt()
val x_cord_Destination: Int
var y_cord_Destination: Int
when (event.action) {
MotionEvent.ACTION_DOWN -> {
xInitCord = x_cord
yInitCord = y_cord
//remember the initial position.
xInitMargin = layoutParams.x
yInitMargin = layoutParams.y
}
MotionEvent.ACTION_UP -> {
//Get the difference between initial coordinate and current coordinate
val x_diff: Int = x_cord - xInitCord
val y_diff: Int = y_cord - yInitCord
y_cord_Destination = yInitMargin + y_diff
val barHeight: Int = ViewsUtil.getStatusBarHeight(applicationContext)
if (y_cord_Destination < 0) {
y_cord_Destination = 0
// y_cord_Destination =
// -(szWindow.y - (videoCallContainer.height /*+ barHeight*/))
// y_cord_Destination = -(szWindow.y / 2)
} else if (y_cord_Destination + (floatingViewContainer.height + barHeight) > szWindow.y) {
y_cord_Destination = szWindow.y - (floatingViewContainer.height + barHeight)
// y_cord_Destination = (szWindow.y / 2)
}
layoutParams.y = y_cord_Destination
//reset position if user drags the floating view
resetPosition(x_cord)
}
MotionEvent.ACTION_MOVE -> {
val x_diff_move: Int = x_cord - xInitCord
val y_diff_move: Int = y_cord - yInitCord
x_cord_Destination = xInitMargin + x_diff_move
y_cord_Destination = yInitMargin + y_diff_move
layoutParams.x = x_cord_Destination
layoutParams.y = y_cord_Destination
//Update the layout with new X & Y coordinate
mWindowManager?.updateViewLayout(floatingWidgetView, layoutParams)
}
}
true
}
/**
* OnTouch actions
*/
class MyGestureListener(
val onTabCall: () -> Unit,
val miniCircleDoubleTap: () -> Unit
) : GestureDetector.SimpleOnGestureListener() {
override fun onSingleTapConfirmed(event: MotionEvent): Boolean {
// onTabCall()
return true
}
override fun onDoubleTap(e: MotionEvent?): Boolean {
miniCircleDoubleTap()
return super.onDoubleTap(e)
}
}
/* Reset position of Floating Widget view on dragging */
fun resetPosition(x_cord_now: Int) {
if (x_cord_now <= szWindow.x / 2) {
moveToLeft(x_cord_now)
} else {
moveToRight(x_cord_now)
}
}
/* Method to move the Floating widget view to Left */
private fun moveToLeft(current_x_cord: Int) {
val mParams: WindowManager.LayoutParams =
floatingWidgetView!!.layoutParams as WindowManager.LayoutParams
mParams.x =
(szWindow.x - current_x_cord * current_x_cord - floatingViewContainer.width).toInt()
try {
mWindowManager?.updateViewLayout(floatingWidgetView, mParams)
} catch (e: Exception) {
Log.e("windowManagerUpdate", "${e.localizedMessage}.")
}
val x = szWindow.x - current_x_cord
object : CountDownTimer(500, 5) {
//get params of Floating Widget view
val mParams: WindowManager.LayoutParams =
floatingWidgetView!!.layoutParams as WindowManager.LayoutParams
override fun onTick(t: Long) {
val step = (500 - t) / 5
// mParams.x = 0 - (current_x_cord * current_x_cord * step).toInt()
mParams.x =
(szWindow.x - current_x_cord * current_x_cord * step - floatingViewContainer.width).toInt()
try {
mWindowManager?.updateViewLayout(floatingWidgetView, mParams)
} catch (e: Exception) {
Log.e("windowManagerUpdate", "${e.localizedMessage}.")
}
}
override fun onFinish() {
mParams.x = -(szWindow.x - floatingViewContainer.width)
try {
mWindowManager?.updateViewLayout(floatingWidgetView, mParams)
} catch (e: Exception) {
Log.e("windowManagerUpdate", "${e.localizedMessage}.")
}
}
}.start()
}
/* Method to move the Floating widget view to Right */
private fun moveToRight(current_x_cord: Int) {
object : CountDownTimer(500, 5) {
//get params of Floating Widget view
val mParams: WindowManager.LayoutParams =
floatingWidgetView!!.layoutParams as WindowManager.LayoutParams
override fun onTick(t: Long) {
val step = (500 - t) / 5
mParams.x =
(szWindow.x + current_x_cord * current_x_cord * step - floatingViewContainer.width).toInt()
try {
mWindowManager?.updateViewLayout(floatingWidgetView, mParams)
} catch (e: Exception) {
Log.e("windowManagerUpdate", "${e.localizedMessage}.")
}
}
override fun onFinish() {
mParams.x = szWindow.x - floatingViewContainer.width
mWindowManager?.updateViewLayout(floatingWidgetView, mParams)
}
}.start()
}
/***
* Utils
*/
fun getWindowManagerDefaultDisplay() {
val w = mWindowManager!!.defaultDisplay.width
val h = mWindowManager!!.defaultDisplay.height
szWindow[w] = h
}
}

@ -1,8 +1,8 @@
package com.hmg.hmgDr.Service;
import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel;
import com.hmg.hmgDr.Model.GetSessionStatusModel;
import com.hmg.hmgDr.Model.SessionStatusModel;
import com.hmg.hmgDr.model.ChangeCallStatusRequestModel;
import com.hmg.hmgDr.model.GetSessionStatusModel;
import com.hmg.hmgDr.model.SessionStatusModel;
import retrofit2.Call;

@ -0,0 +1,91 @@
package com.hmg.hmgDr.Service
import android.app.Service
import android.content.Intent
import android.os.Binder
import android.os.Bundle
import android.os.IBinder
import com.hmg.hmgDr.MainActivity
import com.hmg.hmgDr.ui.VideoCallResponseListener
import com.hmg.hmgDr.ui.fragment.VideoCallFragment
class VideoStreamContainerService : Service(), VideoCallResponseListener {
var videoCallResponseListener: VideoCallResponseListener? = null
var mActivity: MainActivity? = null
set(value) {
field = value
if (field != null) {
setDialogFragment()
}
}
var arguments: Bundle? = null
var serviceRunning: Boolean = false
private val serviceBinder: IBinder = VideoStreamBinder()
private var dialogFragment: VideoCallFragment? = null
override fun onBind(intent: Intent?): IBinder {
return serviceBinder
}
private fun setDialogFragment() {
mActivity?.run {
if (dialogFragment == null) {
val transaction = supportFragmentManager.beginTransaction()
dialogFragment = VideoCallFragment.newInstance(arguments!!)
dialogFragment?.let {
it.setCallListener(this@VideoStreamContainerService)
it.isCancelable = true
if (it.isAdded) {
it.dismiss()
} else {
it.show(transaction, "dialog")
}
}
} else if (!dialogFragment!!.isVisible) {
val transaction = supportFragmentManager.beginTransaction()
dialogFragment!!.show(transaction, "dialog")
} else {
// don't do anything
}
}
}
fun closeVideoCall(){
dialogFragment?.onCallClicked()
}
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
if (intent != null && intent.extras != null) {
arguments = intent.extras
}
// Toast.makeText(this, "Service started by user.", Toast.LENGTH_LONG).show()
return START_STICKY
}
override fun onDestroy() {
super.onDestroy()
// Toast.makeText(this, "Service destroyed by user.", Toast.LENGTH_LONG).show()
}
inner class VideoStreamBinder : Binder() {
val service: VideoStreamContainerService
get() = this@VideoStreamContainerService
}
override fun onCallFinished(resultCode: Int, intent: Intent?) {
dialogFragment = null
videoCallResponseListener?.onCallFinished(resultCode, intent)
}
override fun errorHandle(message: String) {
dialogFragment = null
// Toast.makeText(this, message, Toast.LENGTH_LONG).show()
}
override fun minimizeVideoEvent(isMinimize: Boolean) {
videoCallResponseListener?.minimizeVideoEvent(isMinimize)
}
}

@ -0,0 +1,39 @@
package com.hmg.hmgDr.globalErrorHandler
import android.os.Environment
import java.io.BufferedWriter
import java.io.File
import java.io.FileWriter
import java.io.IOException
import java.text.SimpleDateFormat
import java.util.*
object FileUtil {
val sdf = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")
fun pushLog(body: String?) {
try {
val date = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()).format(Date())
val time = SimpleDateFormat("HH:MM:SS", Locale.getDefault()).format(Date())
val root =
File(Environment.getExternalStorageDirectory(),"error_log_dir")
// if external memory exists and folder with name Notes
if (!root.exists()) {
root.mkdirs() // this will create folder.
}
val oldFile = File(root, "error" + sdf.format(Date()).toString() + ".txt") // old file
if (oldFile.exists()) oldFile.delete()
val filepath = File(root, "error$date.txt") // file path to save
val bufferedWriter = BufferedWriter(FileWriter(filepath, true))
bufferedWriter.append("\r\n")
bufferedWriter.append("\r\n").append(body).append(" Time : ").append(time)
bufferedWriter.flush()
} catch (e: IOException) {
e.printStackTrace()
} catch (e: IllegalStateException) {
e.printStackTrace()
}
}
}

@ -0,0 +1,39 @@
package com.hmg.hmgDr.globalErrorHandler
import android.content.Context
import android.content.Intent
import com.hmg.hmgDr.MainActivity
import com.hmg.hmgDr.globalErrorHandler.FileUtil.pushLog
class LoggingExceptionHandler(private val context: Context, ErrorFile: String) :
Thread.UncaughtExceptionHandler {
private val rootHandler: Thread.UncaughtExceptionHandler
override fun uncaughtException(t: Thread, e: Throwable) {
object : Thread() {
override fun run() {
pushLog("UnCaught Exception is thrown in $error$e")
try {
sleep(500)
val intent = Intent(context, MainActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
context.startActivity(intent)
} catch (e1: Exception) {
e1.printStackTrace()
}
}
}.start()
rootHandler.uncaughtException(t, e)
}
companion object {
private val TAG = LoggingExceptionHandler::class.java.simpleName
lateinit var error: String
}
init {
error = "$ErrorFile.error "
rootHandler = Thread.getDefaultUncaughtExceptionHandler()
Thread.setDefaultUncaughtExceptionHandler(this)
}
}

@ -0,0 +1,6 @@
package com.hmg.hmgDr.globalErrorHandler
import androidx.appcompat.app.AppCompatActivity
class UCEDefaultActivity : AppCompatActivity() {
}

@ -0,0 +1,6 @@
package com.hmg.hmgDr.globalErrorHandler
import androidx.core.content.FileProvider
class UCEFileProvider : FileProvider() {
}

@ -0,0 +1,280 @@
package com.hmg.hmgDr.globalErrorHandler
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.ref.WeakReference;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayDeque;
import java.util.Date;
import java.util.Deque;
import java.util.Locale;
import kotlin.system.exitProcess
class UCEHandler(val builder: Builder) {
val EXTRA_STACK_TRACE = "EXTRA_STACK_TRACE"
val EXTRA_ACTIVITY_LOG = "EXTRA_ACTIVITY_LOG"
private val TAG = "UCEHandler"
private val UCE_HANDLER_PACKAGE_NAME = "com.rohitss.uceh"
private val DEFAULT_HANDLER_PACKAGE_NAME = "com.android.internal.os"
private val MAX_STACK_TRACE_SIZE = 131071 //128 KB - 1
private val MAX_ACTIVITIES_IN_LOG = 50
private val SHARED_PREFERENCES_FILE = "uceh_preferences"
private val SHARED_PREFERENCES_FIELD_TIMESTAMP = "last_crash_timestamp"
private val activityLog: Deque<String> = ArrayDeque(MAX_ACTIVITIES_IN_LOG)
var COMMA_SEPARATED_EMAIL_ADDRESSES: String? = null
@SuppressLint("StaticFieldLeak")
private var application: Application? = null
private var isInBackground = true
private var isBackgroundMode = false
private var isUCEHEnabled = false
private var isTrackActivitiesEnabled = false
private var lastActivityCreated: WeakReference<Activity?> = WeakReference(null)
fun UCEHandler(builder: Builder) {
isUCEHEnabled = builder.isUCEHEnabled
isTrackActivitiesEnabled = builder.isTrackActivitiesEnabled
isBackgroundMode = builder.isBackgroundModeEnabled
COMMA_SEPARATED_EMAIL_ADDRESSES = builder.commaSeparatedEmailAddresses
setUCEHandler(builder.context)
}
private fun setUCEHandler(context: Context?) {
try {
if (context != null) {
val oldHandler = Thread.getDefaultUncaughtExceptionHandler()
if (oldHandler != null && oldHandler.javaClass.name.startsWith(
UCE_HANDLER_PACKAGE_NAME
)
) {
Log.e(TAG, "UCEHandler was already installed, doing nothing!")
} else {
if (oldHandler != null && !oldHandler.javaClass.name.startsWith(
DEFAULT_HANDLER_PACKAGE_NAME
)
) {
Log.e(
TAG,
"You already have an UncaughtExceptionHandler. If you use a custom UncaughtExceptionHandler, it should be initialized after UCEHandler! Installing anyway, but your original handler will not be called."
)
}
application = context.getApplicationContext() as Application
//Setup UCE Handler.
Thread.setDefaultUncaughtExceptionHandler(Thread.UncaughtExceptionHandler { thread, throwable ->
if (isUCEHEnabled) {
Log.e(
TAG,
"App crashed, executing UCEHandler's UncaughtExceptionHandler",
throwable
)
if (hasCrashedInTheLastSeconds(application!!)) {
Log.e(
TAG,
"App already crashed recently, not starting custom error activity because we could enter a restart loop. Are you sure that your app does not crash directly on init?",
throwable
)
if (oldHandler != null) {
oldHandler.uncaughtException(thread, throwable)
return@UncaughtExceptionHandler
}
} else {
setLastCrashTimestamp(application!!, Date().getTime())
if (!isInBackground || isBackgroundMode) {
val intent = Intent(application, UCEDefaultActivity::class.java)
val sw = StringWriter()
val pw = PrintWriter(sw)
throwable.printStackTrace(pw)
var stackTraceString: String = sw.toString()
if (stackTraceString.length > MAX_STACK_TRACE_SIZE) {
val disclaimer = " [stack trace too large]"
stackTraceString = stackTraceString.substring(
0,
MAX_STACK_TRACE_SIZE - disclaimer.length
) + disclaimer
}
intent.putExtra(EXTRA_STACK_TRACE, stackTraceString)
if (isTrackActivitiesEnabled) {
val activityLogStringBuilder = StringBuilder()
while (!activityLog.isEmpty()) {
activityLogStringBuilder.append(activityLog.poll())
}
intent.putExtra(
EXTRA_ACTIVITY_LOG,
activityLogStringBuilder.toString()
)
}
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
application!!.startActivity(intent)
} else {
if (oldHandler != null) {
oldHandler.uncaughtException(thread, throwable)
return@UncaughtExceptionHandler
}
//If it is null (should not be), we let it continue and kill the process or it will be stuck
}
}
val lastActivity: Activity? = lastActivityCreated.get()
if (lastActivity != null) {
lastActivity.finish()
lastActivityCreated.clear()
}
killCurrentProcess()
} else oldHandler?.uncaughtException(thread, throwable)
})
application!!.registerActivityLifecycleCallbacks(object :
Application.ActivityLifecycleCallbacks {
val dateFormat: DateFormat =
SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US)
var currentlyStartedActivities = 0
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
if (activity.javaClass !== UCEDefaultActivity::class.java) {
lastActivityCreated = WeakReference(activity)
}
if (isTrackActivitiesEnabled) {
activityLog.add(
dateFormat.format(Date())
.toString() + ": " + activity.javaClass
.getSimpleName() + " created\n"
)
}
}
override fun onActivityStarted(activity: Activity) {
currentlyStartedActivities++
isInBackground = currentlyStartedActivities == 0
}
override fun onActivityResumed(activity: Activity) {
if (isTrackActivitiesEnabled) {
activityLog.add(
dateFormat.format(Date())
.toString() + ": " + activity.javaClass
.simpleName + " resumed\n"
)
}
}
override fun onActivityPaused(activity: Activity) {
if (isTrackActivitiesEnabled) {
activityLog.add(
dateFormat.format(Date())
.toString() + ": " + activity.javaClass
.simpleName + " paused\n"
)
}
}
override fun onActivityStopped(activity: Activity) {
currentlyStartedActivities--
isInBackground = currentlyStartedActivities == 0
}
override fun onActivitySaveInstanceState(
activity: Activity,
outState: Bundle
) {}
override fun onActivityDestroyed(activity: Activity) {
if (isTrackActivitiesEnabled) {
activityLog.add(
dateFormat.format(Date())
.toString() + ": " + activity.javaClass
.simpleName + " destroyed\n"
)
}
}
})
}
Log.i(TAG, "UCEHandler has been installed.")
} else {
Log.e(TAG, "Context can not be null")
}
} catch (throwable: Throwable) {
Log.e(
TAG,
"UCEHandler can not be initialized. Help making it better by reporting this as a bug.",
throwable
)
}
}
/**
* INTERNAL method that tells if the app has crashed in the last seconds.
* This is used to avoid restart loops.
*
* @return true if the app has crashed in the last seconds, false otherwise.
*/
private fun hasCrashedInTheLastSeconds(context: Context): Boolean {
val lastTimestamp = getLastCrashTimestamp(context)
val currentTimestamp: Long = Date().getTime()
return lastTimestamp <= currentTimestamp && currentTimestamp - lastTimestamp < 3000
}
@SuppressLint("ApplySharedPref")
private fun setLastCrashTimestamp(context: Context, timestamp: Long) {
context.getSharedPreferences(SHARED_PREFERENCES_FILE, Context.MODE_PRIVATE).edit()
.putLong(SHARED_PREFERENCES_FIELD_TIMESTAMP, timestamp).commit()
}
private fun killCurrentProcess() {
// Process.killProcess(Process.myPid())
exitProcess(10)
}
private fun getLastCrashTimestamp(context: Context): Long {
return context.getSharedPreferences(SHARED_PREFERENCES_FILE, Context.MODE_PRIVATE)
.getLong(SHARED_PREFERENCES_FIELD_TIMESTAMP, -1)
}
fun closeApplication(activity: Activity) {
activity.finish()
killCurrentProcess()
}
inner class Builder(context: Context) {
val context: Context
var isUCEHEnabled = true
var commaSeparatedEmailAddresses: String? = null
var isTrackActivitiesEnabled = false
var isBackgroundModeEnabled = true
fun setUCEHEnabled(isUCEHEnabled: Boolean): Builder {
this.isUCEHEnabled = isUCEHEnabled
return this
}
fun setTrackActivitiesEnabled(isTrackActivitiesEnabled: Boolean): Builder {
this.isTrackActivitiesEnabled = isTrackActivitiesEnabled
return this
}
fun setBackgroundModeEnabled(isBackgroundModeEnabled: Boolean): Builder {
this.isBackgroundModeEnabled = isBackgroundModeEnabled
return this
}
fun addCommaSeparatedEmailAddresses(commaSeparatedEmailAddresses: String?): Builder {
this.commaSeparatedEmailAddresses = commaSeparatedEmailAddresses ?: ""
return this
}
fun build() {
return UCEHandler(this)
}
init {
this.context = context
}
}
}

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

@ -0,0 +1,16 @@
package com.hmg.hmgDr.model
/** Represents standard data needed for a Notification. */
open class NotificationDataModel(
// Standard notification values:
var mContentTitle: String,
var mContentText: String,
var mPriority: Int ,
// Notification channel values (O and above):
var mChannelId: String,
var mChannelName: CharSequence,
var mChannelDescription: String,
var mChannelImportance: Int ,
var mChannelEnableVibrate: Boolean ,
var mChannelLockscreenVisibility: Int
)

@ -0,0 +1,35 @@
package com.hmg.hmgDr.model
import android.app.Notification
import android.app.NotificationManager
import android.os.Build
import androidx.annotation.RequiresApi
import androidx.core.app.NotificationCompat
class NotificationVideoModel constructor(
mContentTitle: String,
mContentText: String,
mChannelId: String,
mChannelName: CharSequence,
mChannelDescription: String,
mPriority: Int = Notification.PRIORITY_MAX,
mChannelImportance: Int = NotificationManager.IMPORTANCE_LOW,
mChannelEnableVibrate: Boolean = true,
mChannelLockscreenVisibility: Int = NotificationCompat.VISIBILITY_PUBLIC,
// Unique data for this Notification.Style:
var mBigContentTitle: String = mContentTitle,
val mBigText: String = mContentText,
var mSummaryText: String
) : NotificationDataModel(
mContentTitle,
mContentText,
mPriority,
mChannelId,
mChannelName,
mChannelDescription,
mChannelImportance,
mChannelEnableVibrate,
mChannelLockscreenVisibility
) {
}

@ -1,4 +1,4 @@
package com.hmg.hmgDr.Model;
package com.hmg.hmgDr.model;
import android.os.Parcel;
import android.os.Parcelable;

@ -1,8 +1,8 @@
package com.hmg.hmgDr.ui;
import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel;
import com.hmg.hmgDr.Model.GetSessionStatusModel;
import com.hmg.hmgDr.Model.SessionStatusModel;
import com.hmg.hmgDr.model.ChangeCallStatusRequestModel;
import com.hmg.hmgDr.model.GetSessionStatusModel;
import com.hmg.hmgDr.model.SessionStatusModel;
public interface VideoCallContract {
@ -13,6 +13,7 @@ public interface VideoCallContract {
void onCallChangeCallStatusSuccessful(SessionStatusModel sessionStatusModel);
void onFailure();
}
interface VideoCallPresenter {

@ -1,8 +1,8 @@
package com.hmg.hmgDr.ui;
import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel;
import com.hmg.hmgDr.Model.GetSessionStatusModel;
import com.hmg.hmgDr.Model.SessionStatusModel;
import com.hmg.hmgDr.model.ChangeCallStatusRequestModel;
import com.hmg.hmgDr.model.GetSessionStatusModel;
import com.hmg.hmgDr.model.SessionStatusModel;
import com.hmg.hmgDr.Service.AppRetrofit;
import com.hmg.hmgDr.Service.SessionStatusAPI;
@ -59,7 +59,6 @@ public class VideoCallPresenterImpl implements VideoCallContract.VideoCallPresen
public void onResponse(@NotNull Call<SessionStatusModel> call, @NotNull Response<SessionStatusModel> response) {
if (!response.isSuccessful())
view.onFailure();
}
@Override

@ -6,7 +6,7 @@ interface VideoCallResponseListener {
fun onCallFinished(resultCode : Int, intent: Intent? = null)
fun errorHandle(message: String)
fun errorHandle(message: String){}
fun minimizeVideoEvent(isMinimize : Boolean)

@ -15,20 +15,21 @@ import android.util.Log
import android.view.*
import android.widget.*
import androidx.annotation.Nullable
import androidx.appcompat.app.AlertDialog
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import androidx.core.view.GestureDetectorCompat
import androidx.fragment.app.DialogFragment
import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel
import com.hmg.hmgDr.Model.GetSessionStatusModel
import com.hmg.hmgDr.Model.SessionStatusModel
import com.hmg.hmgDr.model.ChangeCallStatusRequestModel
import com.hmg.hmgDr.model.GetSessionStatusModel
import com.hmg.hmgDr.model.SessionStatusModel
import com.hmg.hmgDr.R
import com.hmg.hmgDr.ui.VideoCallContract.VideoCallPresenter
import com.hmg.hmgDr.ui.VideoCallContract.VideoCallView
import com.hmg.hmgDr.ui.VideoCallPresenterImpl
import com.hmg.hmgDr.ui.VideoCallResponseListener
import com.hmg.hmgDr.util.DynamicVideoRenderer
import com.hmg.hmgDr.util.ThumbnailCircleVideoRenderer
import com.hmg.hmgDr.util.opentok.DynamicVideoRenderer
import com.hmg.hmgDr.util.ViewsUtil
import com.opentok.android.*
import com.opentok.android.PublisherKit.PublisherListener
import pub.devrel.easypermissions.AfterPermissionGranted
@ -37,9 +38,11 @@ import pub.devrel.easypermissions.EasyPermissions
import pub.devrel.easypermissions.EasyPermissions.PermissionCallbacks
import kotlin.math.ceil
class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.SessionListener, PublisherListener,
SubscriberKit.VideoListener, VideoCallView {
// check this if it works to solve keyboard not work when dialog is opened
// https://stackoverflow.com/questions/55066977/how-to-prevent-custom-dialogfragment-from-hiding-keyboard-when-being-shown
class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.SessionListener,
PublisherListener,
SubscriberKit.VideoListener, VideoCallView {
private var isFullScreen: Boolean = true
private var isCircle: Boolean = false
@ -62,7 +65,9 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
private var mVolRunnable: Runnable? = null
private var mConnectedRunnable: Runnable? = null
private lateinit var recordContainer: FrameLayout
private lateinit var thumbnail_container: FrameLayout
private lateinit var activity_clingo_video_call: RelativeLayout
private lateinit var mPublisherViewContainer: FrameLayout
private lateinit var mPublisherViewIcon: View
private lateinit var mSubscriberViewContainer: FrameLayout
@ -74,6 +79,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
private var token: String? = null
private var appLang: String? = null
private var baseUrl: String? = null
private var isRecording: Boolean = true
private var isSwitchCameraClicked = false
private var isCameraClicked = false
@ -91,16 +97,17 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
private lateinit var mSwitchCameraBtn: ImageView
private lateinit var mspeckerBtn: ImageView
private lateinit var mMicBtn: ImageView
private lateinit var patientName: TextView
private lateinit var cmTimer: Chronometer
private var elapsedTime: Long = 0
private var resume = false
private val progressBar: ProgressBar? = null
private val countDownTimer: CountDownTimer? = null
private val progressBarTextView: TextView? = null
private val progressBarLayout: RelativeLayout? = null
private val
progressBarLayout: RelativeLayout? = null
private var isConnected = false
@ -116,20 +123,47 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
override fun onStart() {
super.onStart()
// val params: ViewGroup.LayoutParams = dialog!!.window!!.attributes
// params.width = WindowManager.LayoutParams.MATCH_PARENT
// params.height = WindowManager.LayoutParams.MATCH_PARENT
// dialog!!.window!!.attributes = params as WindowManager.LayoutParams
dialog?.window?.setLayout(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT
)
// val parentLayoutParam: FrameLayout.LayoutParams = /*parentView.layoutParams as*/ FrameLayout.LayoutParams(
// LinearLayout.LayoutParams.MATCH_PARENT,
// LinearLayout.LayoutParams.MATCH_PARENT
// )
// parentView.layoutParams = parentLayoutParam
}
override fun getTheme(): Int {
return R.style.dialogTheme
}
override fun onCreateDialog(@Nullable savedInstanceState: Bundle?): Dialog {
val dialog: Dialog = super.onCreateDialog(savedInstanceState)
override fun onCreateDialog(@Nullable savedInstanceState: Bundle?): Dialog {// FullScreenVideoTheme
val layoutInflater = activity!!.layoutInflater
this.parentView = onCreateView(layoutInflater, null)
// Add back button listener
val alertDialogBuilder: AlertDialog.Builder =
AlertDialog.Builder(requireContext(), R.style.dialogTheme)
// .setTitle(android.R.string.select_a_color)
.setView(this.parentView)
// .setPositiveButton(android.R.string.ok, { dialogInterface, i -> })
alertDialogBuilder.setOnKeyListener { _, keyCode, keyEvent ->
// getAction to make sure this doesn't double fire
if (keyCode == KeyEvent.KEYCODE_BACK && keyEvent.action == KeyEvent.ACTION_UP) {
videoCallResponseListener?.onBackHandle()
false // Capture onKey
} else true
// Don't capture
}
return alertDialogBuilder.create()
/*
val dialog: Dialog = super.onCreateDialog(savedInstanceState)
// Add back button listener
dialog.setOnKeyListener { _, keyCode, keyEvent ->
// getAction to make sure this doesn't double fire
@ -141,6 +175,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
}
return dialog
*/
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
@ -156,23 +191,29 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
// Make the dialog possible to be outside touch
dialogWindow!!.setFlags(
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL,
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL,
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
)
dialogWindow.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
requireView().invalidate()
}
}
fun setCallListener(videoCallResponseListener: VideoCallResponseListener) {
this.videoCallResponseListener = videoCallResponseListener
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View {
parentView = inflater.inflate(R.layout.activity_video_call, container, false)
private fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?
): View {
val view = inflater.inflate(R.layout.activity_video_call, container, false)
// val parentViewLayoutParam: ConstraintLayout.LayoutParams = ConstraintLayout.LayoutParams(
// ConstraintLayout.LayoutParams.MATCH_PARENT,
// ConstraintLayout.LayoutParams.MATCH_PARENT
// )
// parentView.layoutParams = parentViewLayoutParam
// Objects.requireNonNull(requireActivity().actionBar)!!.hide()
arguments?.run {
apiKey = getString("apiKey")
@ -181,16 +222,27 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
appLang = getString("appLang")
baseUrl = getString("baseUrl")
sessionStatusModel = getParcelable("sessionStatusModel")
if (sessionStatusModel != null)
isRecording = sessionStatusModel!!.isRecording
}
initUI(parentView)
initUI(view)
requestPermissions()
handleDragDialog()
mDetector = GestureDetectorCompat(context, MyGestureListener({ showControlPanelTemporarily() }, { miniCircleDoubleTap() }))
mDetector = GestureDetectorCompat(
context,
MyGestureListener({ showControlPanelTemporarily() }, { miniCircleDoubleTap() })
)
return parentView
return view
}
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View {
return this.parentView
}
override fun onPause() {
super.onPause()
@ -220,9 +272,13 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
@SuppressLint("ClickableViewAccessibility")
private fun initUI(view: View) {
videoCallContainer = view.findViewById(R.id.video_call_ll)
layoutName = view.findViewById(R.id.layout_name)
layoutMini = view.findViewById(R.id.layout_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)
thumbnail_container = view.findViewById(R.id.thumbnail_container)
mPublisherViewContainer = view.findViewById(R.id.local_video_view_container)
mPublisherViewIcon = view.findViewById(R.id.local_video_view_icon)
@ -232,23 +288,34 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
patientName = view.findViewById<TextView>(R.id.patient_name)
patientName.text = sessionStatusModel!!.patientName
cmTimer = view.findViewById<Chronometer>(R.id.cmTimer)
if (isRecording) {
recordContainer.visibility = View.VISIBLE
} else {
recordContainer.visibility = View.GONE
}
// cmTimer = view.findViewById(R.id.cmTimer)
cmTimer.format = "mm:ss"
cmTimer.onChronometerTickListener = Chronometer.OnChronometerTickListener { arg0: Chronometer? ->
val minutes: Long
val seconds: Long
if (!resume) {
minutes = (SystemClock.elapsedRealtime() - cmTimer.base) / 1000 / 60
seconds = (SystemClock.elapsedRealtime() - cmTimer.base) / 1000 % 60
elapsedTime = SystemClock.elapsedRealtime()
} else {
minutes = (elapsedTime - cmTimer.base) / 1000 / 60
seconds = (elapsedTime - cmTimer.base) / 1000 % 60
elapsedTime += 1000
cmTimer.onChronometerTickListener =
Chronometer.OnChronometerTickListener { arg0: Chronometer? ->
// val f: NumberFormat = DecimalFormat("00")
// f.format(minutes)
val minutes: Long
val seconds: Long
if (!resume) {
minutes = (SystemClock.elapsedRealtime() - cmTimer.base) / 1000 / 60
seconds = (SystemClock.elapsedRealtime() - cmTimer.base) / 1000 % 60
elapsedTime = SystemClock.elapsedRealtime()
} else {
minutes = (elapsedTime - cmTimer.base) / 1000 / 60
seconds = (elapsedTime - cmTimer.base) / 1000 % 60
elapsedTime += 1000
}
val format = "%1$02d:%2$02d" // two digits
arg0?.text = String.format(format, minutes, seconds)
Log.d(TAG, "onChronometerTick: $minutes : $seconds")
}
arg0?.text = "$minutes:$seconds"
Log.d(VideoCallFragment.TAG, "onChronometerTick: $minutes : $seconds")
}
icMini.setOnClickListener {
onMiniCircleClicked()
@ -284,8 +351,11 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
// progressBar=findViewById(R.id.progress_bar);
// progressBarTextView=findViewById(R.id.progress_bar_text);
// progressBar.setVisibility(View.GONE);
hiddenButtons()
// hiddenButtons()
checkClientConnected()
handleVideoViewHeight(true)
if (appLang == "ar") {
progressBarLayout!!.layoutDirection = View.LAYOUT_DIRECTION_RTL
@ -308,7 +378,11 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
mVolHandler!!.postDelayed(mVolRunnable!!, (5 * 1000).toLong())
}
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String?>, grantResults: IntArray) {
override fun onRequestPermissionsResult(
requestCode: Int,
permissions: Array<String?>,
grantResults: IntArray
) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this)
}
@ -321,29 +395,54 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
Log.d(TAG, "onPermissionsDenied:" + requestCode + ":" + perms.size)
if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) {
AppSettingsDialog.Builder(this)
.setTitle(getString(R.string.title_settings_dialog))
.setRationale(getString(R.string.rationale_ask_again))
.setPositiveButton(getString(R.string.setting))
.setNegativeButton(getString(R.string.cancel))
.setRequestCode(RC_SETTINGS_SCREEN_PERM)
.build()
.show()
.setTitle(getString(R.string.title_settings_dialog))
.setRationale(getString(R.string.rationale_ask_again))
.setPositiveButton(getString(R.string.setting))
.setNegativeButton(getString(R.string.cancel))
.setRequestCode(RC_SETTINGS_SCREEN_PERM)
.build()
.show()
}
}
@AfterPermissionGranted(RC_VIDEO_APP_PERM)
private fun requestPermissions() {
val perms = arrayOf(Manifest.permission.INTERNET, Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO, Manifest.permission.MODIFY_AUDIO_SETTINGS, Manifest.permission.CALL_PHONE)
val perms = arrayOf(
Manifest.permission.INTERNET,
Manifest.permission.CAMERA,
Manifest.permission.RECORD_AUDIO,
Manifest.permission.MODIFY_AUDIO_SETTINGS,
Manifest.permission.CALL_PHONE
)
if (EasyPermissions.hasPermissions(requireContext(), *perms)) {
try {
mSession = Session.Builder(context, apiKey, sessionId).build()
mSession!!.setSessionListener(this)
mSession!!.connect(token)
mSession!!.setReconnectionListener(object :Session.ReconnectionListener{
override fun onReconnecting(p0: Session?) {
}
override fun onReconnected(session: Session?) {
session?.connect(token)
}
})
} catch (e: Exception) {
e.printStackTrace()
}
} else {
EasyPermissions.requestPermissions(this, getString(R.string.remaining_ar), RC_VIDEO_APP_PERM, *perms)
EasyPermissions.requestPermissions(
this,
getString(R.string.remaining_ar),
RC_VIDEO_APP_PERM,
*perms
)
}
}
@ -352,13 +451,14 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
mPublisher = Publisher.Builder(requireContext())
// .name("publisher")
// .renderer(ThumbnailCircleVideoRenderer(requireContext()))
.build()
.build()
mPublisher!!.setPublisherListener(this)
if (mPublisher!!.view is GLSurfaceView) {
(mPublisher!!.view as GLSurfaceView).setZOrderOnTop(true)
}
mPublisherViewContainer.addView(mPublisher!!.view)
mSession!!.publish(mPublisher)
if (!resume) {
@ -370,10 +470,10 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
override fun onDisconnected(session: Session) {
Log.d(TAG, "onDisconnected: disconnected from session " + session.sessionId)
mSession = null
cmTimer.stop()
disconnectSession()
videoCallResponseListener?.minimizeVideoEvent(false)
// mSession = null
// cmTimer.stop()
// disconnectSession()
// videoCallResponseListener?.minimizeVideoEvent(false)
}
override fun onError(session: Session, opentokError: OpentokError) {
@ -393,11 +493,22 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
subscribeToStream(stream)
if (mConnectedHandler != null && mConnectedRunnable != null)
mConnectedHandler!!.removeCallbacks(mConnectedRunnable!!)
videoCallPresenter.callChangeCallStatus(ChangeCallStatusRequestModel(3, sessionStatusModel!!.doctorId, sessionStatusModel!!.generalid, token, sessionStatusModel!!.vcid))
videoCallPresenter.callChangeCallStatus(
ChangeCallStatusRequestModel(
3,
sessionStatusModel!!.doctorId,
sessionStatusModel!!.generalid,
token,
sessionStatusModel!!.vcid
)
)
}
override fun onStreamDropped(session: Session, stream: Stream) {
Log.d(TAG, "onStreamDropped: Stream " + stream.streamId + " dropped from session " + session.sessionId)
Log.d(
TAG,
"onStreamDropped: Stream " + stream.streamId + " dropped from session " + session.sessionId
)
if (mSubscriber == null) {
return
}
@ -406,7 +517,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
mSubscriber!!.destroy()
mSubscriber = null
}
disconnectSession()
//disconnectSession()
}
override fun onStreamCreated(publisherKit: PublisherKit?, stream: Stream) {
@ -424,7 +535,10 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
}
override fun onVideoDataReceived(subscriberKit: SubscriberKit?) {
mSubscriber!!.setStyle(BaseVideoRenderer.STYLE_VIDEO_SCALE, BaseVideoRenderer.STYLE_VIDEO_FILL)
mSubscriber!!.setStyle(
BaseVideoRenderer.STYLE_VIDEO_SCALE,
BaseVideoRenderer.STYLE_VIDEO_FILL
)
(mSubscriber!!.renderer as DynamicVideoRenderer).enableThumbnailCircle(false)
mSubscriberViewContainer.addView(mSubscriber!!.view)
// switchToThumbnailCircle()
@ -464,9 +578,25 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
}, 4000)
}
override fun onVideoDisabled(subscriberKit: SubscriberKit?, s: String?) {}
override fun onVideoDisabled(subscriberKit: SubscriberKit?, s: String?) {
Log.d(VideoCallFragment.TAG, "onVideoDisabled: Error ($s)")
// if (isCircle) {
// videoCallContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape)
// mSubscriberViewContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape)
// } else {
// videoCallContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.text_color))
// mSubscriberViewContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.remoteBackground))
// }
}
override fun onVideoEnabled(subscriberKit: SubscriberKit?, s: String?) {
Log.d(VideoCallFragment.TAG, "onVideoEnabled: Error ($s)")
override fun onVideoEnabled(subscriberKit: SubscriberKit?, s: String?) {}
// if (mSubscriber != null) {
// (mSubscriber!!.renderer as DynamicVideoRenderer).enableThumbnailCircle(isCircle)
// }
}
override fun onVideoDisableWarning(subscriberKit: SubscriberKit?) {}
@ -474,8 +604,8 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
private fun subscribeToStream(stream: Stream) {
mSubscriber = Subscriber.Builder(requireContext(), stream)
.renderer(DynamicVideoRenderer(requireContext()))
.build()
.renderer(DynamicVideoRenderer(requireContext()))
.build()
mSubscriber!!.setVideoListener(this)
mSession!!.subscribe(mSubscriber)
}
@ -503,7 +633,25 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
mSession!!.disconnect()
countDownTimer?.cancel()
videoCallPresenter.callChangeCallStatus(ChangeCallStatusRequestModel(16, sessionStatusModel!!.doctorId, sessionStatusModel!!.generalid, token, sessionStatusModel!!.vcid))
videoCallPresenter.callChangeCallStatus(
ChangeCallStatusRequestModel(
16,
sessionStatusModel!!.doctorId,
sessionStatusModel!!.generalid,
token,
sessionStatusModel!!.vcid
)
)
// if(isDismiss)
// dialog?.dismiss()
// else
onCallChangeCallStatusSuccessful()
}
fun onCallChangeCallStatusSuccessful(){
val returnIntent = Intent()
returnIntent.putExtra("CallEnd", sessionStatusModel)
videoCallResponseListener?.onCallFinished(Activity.RESULT_CANCELED, returnIntent)
dialog?.dismiss()
}
@ -543,28 +691,41 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
private fun onMiniCircleClicked() {
if (isCircle) {
dialog?.window?.setLayout(
400,
600
400,
600
)
} else {
dialog?.window?.setLayout(
300,
300
300,
300
)
}
isCircle = !isCircle
if (mSubscriber != null) {
(mSubscriber!!.renderer as DynamicVideoRenderer).enableThumbnailCircle(isCircle)
} else {
if (isCircle) {
videoCallContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape)
mSubscriberViewContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape)
videoCallContainer.background =
ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape)
mSubscriberViewContainer.background =
ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape)
} else {
videoCallContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.text_color))
mSubscriberViewContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.text_color))
videoCallContainer.setBackgroundColor(
ContextCompat.getColor(
requireContext(),
R.color.text_color
)
)
mSubscriberViewContainer.setBackgroundColor(
ContextCompat.getColor(
requireContext(),
R.color.remoteBackground
)
)
}
}
if (isCircle) {
@ -574,19 +735,27 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
controlPanel.visibility = View.VISIBLE
layoutMini.visibility = View.VISIBLE
}
handleVideoViewHeight(isFullScreen)
}
private fun onMinimizedClicked(view: View?) {
if (isFullScreen) {
dialog?.window?.setLayout(
400,
600
400,
600
)
recordContainer.visibility = View.GONE
} else {
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
@ -598,25 +767,36 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
}
private fun setViewsVisibility() {
val iconSize: Int = context!!.resources.getDimension(R.dimen.video_icon_size).toInt()
val iconSizeSmall: Int = context!!.resources.getDimension(R.dimen.video_icon_size_small).toInt()
val btnMinimizeLayoutParam: ConstraintLayout.LayoutParams = btnMinimize.layoutParams as ConstraintLayout.LayoutParams
val mCallBtnLayoutParam: ConstraintLayout.LayoutParams = mCallBtn.layoutParams as ConstraintLayout.LayoutParams
val btnMinimizeLayoutParam: ConstraintLayout.LayoutParams =
btnMinimize.layoutParams as ConstraintLayout.LayoutParams
val mCallBtnLayoutParam: ConstraintLayout.LayoutParams =
mCallBtn.layoutParams as ConstraintLayout.LayoutParams
val localPreviewMargin: Int = context!!.resources.getDimension(R.dimen.local_preview_margin_top).toInt()
val localPreviewWidth: Int = context!!.resources.getDimension(R.dimen.local_preview_width).toInt()
val localPreviewHeight: Int = context!!.resources.getDimension(R.dimen.local_preview_height).toInt()
val iconSize: Int = context!!.resources.getDimension(R.dimen.video_icon_size).toInt()
val iconSizeSmall: Int =
context!!.resources.getDimension(R.dimen.video_icon_size_small).toInt()
val localPreviewMargin: Int =
context!!.resources.getDimension(R.dimen.local_preview_margin_top).toInt()
val localPreviewWidth: Int =
context!!.resources.getDimension(R.dimen.local_preview_width).toInt()
val localPreviewHeight: Int =
context!!.resources.getDimension(R.dimen.local_preview_height).toInt()
// val localPreviewIconSize: Int = context!!.resources.getDimension(R.dimen.local_back_icon_size).toInt()
// val localPreviewMarginSmall : Int = context!!.resources.getDimension(R.dimen.local_preview_margin_small).toInt()
// val localPreviewWidthSmall : Int = context!!.resources.getDimension(R.dimen.local_preview_width_small).toInt()
// val localPreviewHeightSmall : Int = context!!.resources.getDimension(R.dimen.local_preview_height_small).toInt()
// val localPreviewIconSmall: Int = context!!.resources.getDimension(R.dimen.local_back_icon_size_small).toInt()
// val localPreviewLayoutIconParam : FrameLayout.LayoutParams
val localPreviewLayoutParam: RelativeLayout.LayoutParams = mPublisherViewContainer.layoutParams as RelativeLayout.LayoutParams
val localPreviewLayoutParam: RelativeLayout.LayoutParams =
mPublisherViewContainer.layoutParams as RelativeLayout.LayoutParams
val remotePreviewIconSize: Int = context!!.resources.getDimension(R.dimen.remote_back_icon_size).toInt()
val remotePreviewIconSizeSmall: Int = context!!.resources.getDimension(R.dimen.remote_back_icon_size_small).toInt()
val remotePreviewLayoutParam: FrameLayout.LayoutParams = mSubscriberViewIcon.layoutParams as FrameLayout.LayoutParams
val remotePreviewIconSize: Int =
context!!.resources.getDimension(R.dimen.remote_back_icon_size).toInt()
val remotePreviewIconSizeSmall: Int =
context!!.resources.getDimension(R.dimen.remote_back_icon_size_small).toInt()
val remotePreviewLayoutParam: FrameLayout.LayoutParams =
mSubscriberViewIcon.layoutParams as FrameLayout.LayoutParams
if (isFullScreen) {
layoutName.visibility = View.VISIBLE
@ -635,6 +815,11 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
localPreviewLayoutParam.width = localPreviewWidth
localPreviewLayoutParam.height = localPreviewHeight
localPreviewLayoutParam.setMargins(0, localPreviewMargin, localPreviewMargin, 0)
if (mPublisher != null && mPublisher!!.view.parent == null) {
mPublisherViewContainer.addView(mPublisher!!.view)
}
mPublisherViewContainer.visibility = View.VISIBLE
// remotePreviewLayoutParam = FrameLayout.LayoutParams(remotePreviewIconSize, remotePreviewIconSize)
remotePreviewLayoutParam.width = remotePreviewIconSize
remotePreviewLayoutParam.height = remotePreviewIconSize
@ -657,6 +842,11 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
localPreviewLayoutParam.width = 0
localPreviewLayoutParam.height = 0
localPreviewLayoutParam.setMargins(0, localPreviewMargin / 2, localPreviewMargin / 2, 0)
if (mPublisher != null) {
mPublisherViewContainer.removeView(mPublisher!!.view)
}
mPublisherViewContainer.visibility = View.GONE
// localPreviewLayoutIconParam = FrameLayout.LayoutParams(localPreviewIconSmall, localPreviewIconSmall)
//// localPreviewLayoutParam = RelativeLayout.LayoutParams(localPreviewWidthSmall, localPreviewHeightSmall)
// localPreviewLayoutParam.width = localPreviewWidthSmall
@ -681,6 +871,87 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
btnMinimize.layoutParams = btnMinimizeLayoutParam
mCallBtn.layoutParams = mCallBtnLayoutParam
handleVideoViewHeight(isFullScreen)
}
private fun handleVideoViewHeight(isFullScreen: Boolean) {
val layoutNameParam: ConstraintLayout.LayoutParams =
layoutName.layoutParams as ConstraintLayout.LayoutParams
val layoutMiniParam: ConstraintLayout.LayoutParams =
layoutMini.layoutParams as ConstraintLayout.LayoutParams
val controlPanelParam: ConstraintLayout.LayoutParams =
controlPanel.layoutParams as ConstraintLayout.LayoutParams
val layoutNameHeight: Int =
context!!.resources.getDimension(R.dimen.layout_name_height).toInt()
val layoutMiniHeight: Int =
context!!.resources.getDimension(R.dimen.layout_mini_height).toInt()
val panelHeight: Int = context!!.resources.getDimension(R.dimen.layout_panel_height).toInt()
val panelHeightSmall: Int =
context!!.resources.getDimension(R.dimen.layout_panel_height_small).toInt()
val panelPadding: Int =
context!!.resources.getDimension(R.dimen.padding_space_big).toInt()
val panelPaddingMedium: Int =
context!!.resources.getDimension(R.dimen.padding_space_medium).toInt()
val temp = getStatusBarHeight() / 2
val screenWidth: Float
val screenHeight: Float
if (isFullScreen) {
screenWidth = ViewsUtil.getWidthDp(requireContext())
screenHeight = ViewsUtil.getHeightDp(requireContext())
layoutNameParam.height = layoutNameHeight + temp
layoutMiniParam.height = 0
controlPanelParam.height = panelHeight + temp
controlPanel.setPadding(panelPadding, panelPadding, panelPadding, panelPadding)
} else {
if (isCircle) {
screenWidth = 300F
screenHeight = 300F
layoutNameParam.height = 0
layoutMiniParam.height = 0
controlPanelParam.height = 0
} else {
screenWidth = 400F
screenHeight = 600F
layoutNameParam.height = 0
layoutMiniParam.height = layoutMiniHeight
controlPanelParam.height = panelHeightSmall
}
controlPanel.setPadding(
panelPaddingMedium,
panelPaddingMedium,
panelPaddingMedium,
panelPaddingMedium
)
}
layoutName.layoutParams = layoutNameParam
layoutMini.layoutParams = layoutMiniParam
controlPanel.layoutParams = controlPanelParam
var videoStreamHeight =
screenHeight - controlPanelParam.height - layoutNameParam.height - layoutMiniParam.height
if (isFullScreen) {
// videoStreamHeight -= getStatusBarHeight() / 2
}
val callLayoutParam: ConstraintLayout.LayoutParams =
activity_clingo_video_call.layoutParams as ConstraintLayout.LayoutParams
callLayoutParam.height = videoStreamHeight.toInt()
callLayoutParam.width = screenWidth.toInt()
}
private fun onCameraClicked(view: View?) {
@ -688,7 +959,15 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
isCameraClicked = !isCameraClicked
mPublisher!!.publishVideo = !isCameraClicked
val res = if (isCameraClicked) R.drawable.video_disabled else R.drawable.video_enabled
mCameraBtn!!.setImageResource(res)
mCameraBtn.setImageResource(res)
// if (!isCameraClicked) {
// videoCallContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape)
// mSubscriberViewContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape)
// } else {
// videoCallContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.text_color))
// mSubscriberViewContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.remoteBackground))
// }
}
}
@ -801,7 +1080,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
var mParams: WindowManager.LayoutParams = dialog!!.window!!.attributes
mParams.x =
(szWindow.x - current_x_cord * current_x_cord - videoCallContainer.width).toInt()
(szWindow.x - current_x_cord * current_x_cord - videoCallContainer.width).toInt()
dialog!!.window!!.attributes = mParams
val x = szWindow.x - current_x_cord
@ -812,15 +1091,15 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
val step = (500 - t) / 5
// mParams.x = 0 - (current_x_cord * current_x_cord * step).toInt()
mParams.x =
(szWindow.x - current_x_cord * current_x_cord * step - videoCallContainer.width).toInt()
(szWindow.x - current_x_cord * current_x_cord * step - videoCallContainer.width).toInt()
dialog!!.window!!.attributes = mParams
dialog?.window?.attributes = mParams
}
override fun onFinish() {
mParams.x = -(szWindow.x - videoCallContainer.width)
dialog!!.window!!.attributes = mParams
dialog?.window!!.attributes = mParams
}
}.start()
}
@ -838,7 +1117,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
override fun onTick(t: Long) {
val step = (500 - t) / 5
mParams.x =
(szWindow.x + current_x_cord * current_x_cord * step - videoCallContainer.width).toInt()
(szWindow.x + current_x_cord * current_x_cord * step - videoCallContainer.width).toInt()
dialog!!.window!!.attributes = mParams
}
@ -846,27 +1125,30 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
override fun onFinish() {
mParams.x = szWindow.x - videoCallContainer.width
dialog!!.window!!.attributes = mParams
dialog?.window!!.attributes = mParams
}
}.start()
}
private fun getWindowManagerDefaultDisplay() {
mWindowManager.getDefaultDisplay()
.getSize(szWindow)
.getSize(szWindow)
}
/* return status bar height on basis of device display metrics */
private fun getStatusBarHeight(): Int {
return ceil(
(25 * requireActivity().applicationContext.resources.displayMetrics.density).toDouble()
(25 * requireActivity().applicationContext.resources.displayMetrics.density).toDouble()
).toInt()
}
private class MyGestureListener(val onTabCall: () -> Unit, val miniCircleDoubleTap: () -> Unit) : GestureDetector.SimpleOnGestureListener() {
private class MyGestureListener(
val onTabCall: () -> Unit,
val miniCircleDoubleTap: () -> Unit
) : GestureDetector.SimpleOnGestureListener() {
override fun onSingleTapConfirmed(event: MotionEvent): Boolean {
onTabCall()
// onTabCall()
return true
}
@ -880,9 +1162,9 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
companion object {
@JvmStatic
fun newInstance(args: Bundle) =
VideoCallFragment().apply {
arguments = args
}
VideoCallFragment().apply {
arguments = args
}
private val TAG = VideoCallFragment::class.java.simpleName

@ -0,0 +1,38 @@
package com.hmg.hmgDr.util
import java.text.SimpleDateFormat
import java.util.*
object DateUtils {
var simpleDateFormat: SimpleDateFormat = SimpleDateFormat("hh:mm:ss", Locale.ENGLISH)
fun differentDateTimeBetweenDateAndNow(firstDate: Date): String {
val now: Date = Calendar.getInstance().time
//1 minute = 60 seconds
//1 hour = 60 x 60 = 3600
//1 day = 3600 x 24 = 86400
var different: Long = now.time - firstDate.time
val secondsInMilli: Long = 1000
val minutesInMilli = secondsInMilli * 60
val hoursInMilli = minutesInMilli * 60
val daysInMilli = hoursInMilli * 24
val elapsedDays = different / daysInMilli
different %= daysInMilli
val elapsedHours = different / hoursInMilli
different %= hoursInMilli
val elapsedMinutes = different / minutesInMilli
different %= minutesInMilli
val elapsedSeconds = different / secondsInMilli
val format = "%1$02d:%2$02d" // two digits
return String.format(format, elapsedMinutes, elapsedSeconds)
}
}

@ -0,0 +1,77 @@
package com.hmg.hmgDr.util
import android.app.NotificationChannel
import android.app.NotificationManager
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.os.Build
import androidx.core.app.NotificationCompat
import com.hmg.hmgDr.model.NotificationDataModel
import com.hmg.hmgDr.model.NotificationVideoModel
object NotificationUtil {
fun createNotificationChannel(
context: Context,
notificationDataModel: NotificationDataModel
): String {
// The id of the channel.
val channelId: String = notificationDataModel.mChannelId
// NotificationChannels are required for Notifications on O (API 26) and above.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// The user-visible name of the channel.
val channelName: CharSequence = notificationDataModel.mChannelName
// The user-visible description of the channel.
val channelDescription: String = notificationDataModel.mChannelDescription
val channelImportance: Int = notificationDataModel.mChannelImportance
val channelEnableVibrate: Boolean = notificationDataModel.mChannelEnableVibrate
val channelLockscreenVisibility: Int =
notificationDataModel.mChannelLockscreenVisibility
// Initializes NotificationChannel.
val notificationChannel = NotificationChannel(channelId, channelName, channelImportance)
notificationChannel.description = channelDescription
notificationChannel.lightColor = Color.BLUE
notificationChannel.lockscreenVisibility = channelLockscreenVisibility
// no vibration
notificationChannel.vibrationPattern = longArrayOf(0)
notificationChannel.enableVibration(channelEnableVibrate)
// Adds NotificationChannel to system. Attempting to create an existing notification
// channel with its original values performs no operation, so it's safe to perform the
// below sequence.
val notificationManager =
context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
notificationManager.createNotificationChannel(notificationChannel)
}
return channelId
}
fun setNotificationBigStyle(notificationData : NotificationVideoModel): NotificationCompat.BigTextStyle {
return NotificationCompat.BigTextStyle() // Overrides ContentText in the big form of the template.
.bigText(notificationData.mBigText) // Overrides ContentTitle in the big form of the template.
.setBigContentTitle(notificationData.mBigContentTitle) // Summary line after the detail section in the big form of the template.
// Note: To improve readability, don't overload the user with info. If Summary Text
// doesn't add critical information, you should skip it.
.setSummaryText(notificationData.mSummaryText)
}
/**
* IMPORTANT NOTE: You should not do this action unless the user takes an action to see your
* Notifications like this sample demonstrates. Spamming users to re-enable your notifications
* is a bad idea.
*/
fun openNotificationSettingsForApp(context: Context) {
// Links to this app's notification settings.
val intent = Intent()
intent.action = "android.settings.APP_NOTIFICATION_SETTINGS"
intent.putExtra("app_package", context.packageName)
intent.putExtra("app_uid", context.applicationInfo.uid)
// for Android 8 and above
intent.putExtra("android.provider.extra.APP_PACKAGE", context.packageName)
context.startActivity(intent)
}
}

@ -0,0 +1,467 @@
package com.hmg.hmgDr.util.audio
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.media.AudioFormat
import android.media.AudioManager
import android.media.AudioRecord
import android.media.AudioTrack
import android.media.MediaRecorder.AudioSource
import android.os.Process
import android.util.Log
import com.opentok.android.BaseAudioDevice
import java.nio.ByteBuffer
import java.util.concurrent.locks.Condition
import java.util.concurrent.locks.ReentrantLock
class CustomAudioDevice(context: Context) : BaseAudioDevice() {
private val m_context: Context = context
private var m_audioTrack: AudioTrack? = null
private var m_audioRecord: AudioRecord? = null
// Capture & render buffers
private var m_playBuffer: ByteBuffer? = null
private var m_recBuffer: ByteBuffer? = null
private val m_tempBufPlay: ByteArray
private val m_tempBufRec: ByteArray
private val m_rendererLock: ReentrantLock = ReentrantLock(true)
private val m_renderEvent: Condition = m_rendererLock.newCondition()
@Volatile
private var m_isRendering = false
@Volatile
private var m_shutdownRenderThread = false
private val m_captureLock: ReentrantLock = ReentrantLock(true)
private val m_captureEvent: Condition = m_captureLock.newCondition()
@Volatile
private var m_isCapturing = false
@Volatile
private var m_shutdownCaptureThread = false
private val m_captureSettings: AudioSettings
private val m_rendererSettings: AudioSettings
// Capturing delay estimation
private var m_estimatedCaptureDelay = 0
// Rendering delay estimation
private var m_bufferedPlaySamples = 0
private var m_playPosition = 0
private var m_estimatedRenderDelay = 0
private val m_audioManager: AudioManager
private var isRendererMuted = false
companion object {
private const val LOG_TAG = "opentok-defaultaudio"
private const val SAMPLING_RATE = 44100
private const val NUM_CHANNELS_CAPTURING = 1
private const val NUM_CHANNELS_RENDERING = 1
private const val MAX_SAMPLES = 2 * 480 * 2 // Max 10 ms @ 48 kHz
}
init {
try {
m_playBuffer = ByteBuffer.allocateDirect(MAX_SAMPLES)
m_recBuffer = ByteBuffer.allocateDirect(MAX_SAMPLES)
} catch (e: Exception) {
Log.e(LOG_TAG, "${e.message}.")
}
m_tempBufPlay = ByteArray(MAX_SAMPLES)
m_tempBufRec = ByteArray(MAX_SAMPLES)
m_captureSettings = AudioSettings(
SAMPLING_RATE,
NUM_CHANNELS_CAPTURING
)
m_rendererSettings = AudioSettings(
SAMPLING_RATE,
NUM_CHANNELS_RENDERING
)
m_audioManager = m_context
.getSystemService(Context.AUDIO_SERVICE) as AudioManager
m_audioManager.mode = AudioManager.MODE_IN_COMMUNICATION
}
override fun initCapturer(): Boolean {
// get the minimum buffer size that can be used
val minRecBufSize: Int = AudioRecord.getMinBufferSize(
m_captureSettings
.sampleRate,
if (NUM_CHANNELS_CAPTURING == 1) AudioFormat.CHANNEL_IN_MONO else AudioFormat.CHANNEL_IN_STEREO,
AudioFormat.ENCODING_PCM_16BIT
)
// double size to be more safe
val recBufSize = minRecBufSize * 2
// release the object
if (m_audioRecord != null) {
m_audioRecord!!.release()
m_audioRecord = null
}
try {
m_audioRecord = AudioRecord(
AudioSource.VOICE_COMMUNICATION,
m_captureSettings.sampleRate,
if (NUM_CHANNELS_CAPTURING == 1) AudioFormat.CHANNEL_IN_MONO else AudioFormat.CHANNEL_IN_STEREO,
AudioFormat.ENCODING_PCM_16BIT, recBufSize
)
} catch (e: Exception) {
Log.e(LOG_TAG, "${e.message}.")
return false
}
// check that the audioRecord is ready to be used
if (m_audioRecord!!.state != AudioRecord.STATE_INITIALIZED) {
Log.i(
LOG_TAG, "Audio capture is not initialized "
+ m_captureSettings.sampleRate
)
return false
}
m_shutdownCaptureThread = false
Thread(m_captureThread).start()
return true
}
override fun destroyCapturer(): Boolean {
m_captureLock.lock()
// release the object
m_audioRecord?.release()
m_audioRecord = null
m_shutdownCaptureThread = true
m_captureEvent.signal()
m_captureLock.unlock()
return true
}
override fun getEstimatedCaptureDelay(): Int {
return m_estimatedCaptureDelay
}
override fun startCapturer(): Boolean {
// start recording
try {
m_audioRecord!!.startRecording()
} catch (e: IllegalStateException) {
e.printStackTrace()
return false
}
m_captureLock.lock()
m_isCapturing = true
m_captureEvent.signal()
m_captureLock.unlock()
return true
}
override fun stopCapturer(): Boolean {
m_captureLock.lock()
try {
// only stop if we are recording
if (m_audioRecord!!.recordingState == AudioRecord.RECORDSTATE_RECORDING) {
// stop recording
try {
m_audioRecord!!.stop()
} catch (e: IllegalStateException) {
e.printStackTrace()
return false
}
}
} finally {
// Ensure we always unlock
m_isCapturing = false
m_captureLock.unlock()
}
return true
}
private val m_captureThread = Runnable {
val samplesToRec = SAMPLING_RATE / 100
var samplesRead = 0
try {
Process.setThreadPriority(Process.THREAD_PRIORITY_URGENT_AUDIO)
} catch (e: Exception) {
e.printStackTrace()
}
while (!m_shutdownCaptureThread) {
m_captureLock.lock()
samplesRead = try {
if (!m_isCapturing) {
m_captureEvent.await()
continue
} else {
if (m_audioRecord == null) {
continue
}
val lengthInBytes = ((samplesToRec shl 1)
* NUM_CHANNELS_CAPTURING)
val readBytes: Int = m_audioRecord!!.read(
m_tempBufRec, 0,
lengthInBytes
)
m_recBuffer!!.rewind()
m_recBuffer!!.put(m_tempBufRec)
(readBytes shr 1) / NUM_CHANNELS_CAPTURING
}
} catch (e: Exception) {
Log.e(LOG_TAG, "RecordAudio try failed: " + e.message)
continue
} finally {
// Ensure we always unlock
m_captureLock.unlock()
}
audioBus.writeCaptureData(m_recBuffer, samplesRead)
m_estimatedCaptureDelay = samplesRead * 1000 / SAMPLING_RATE
}
}
override fun initRenderer(): Boolean {
// get the minimum buffer size that can be used
val minPlayBufSize: Int = AudioTrack.getMinBufferSize(
m_rendererSettings
.sampleRate,
if (NUM_CHANNELS_RENDERING == 1) AudioFormat.CHANNEL_OUT_MONO else AudioFormat.CHANNEL_OUT_STEREO,
AudioFormat.ENCODING_PCM_16BIT
)
var playBufSize = minPlayBufSize
if (playBufSize < 6000) {
playBufSize *= 2
}
// release the object
if (m_audioTrack != null) {
m_audioTrack!!.release()
m_audioTrack = null
}
try {
m_audioTrack = AudioTrack(
AudioManager.STREAM_VOICE_CALL,
m_rendererSettings.sampleRate,
if (NUM_CHANNELS_RENDERING == 1) AudioFormat.CHANNEL_OUT_MONO else AudioFormat.CHANNEL_OUT_STEREO,
AudioFormat.ENCODING_PCM_16BIT, playBufSize,
AudioTrack.MODE_STREAM
)
} catch (e: Exception) {
Log.e(LOG_TAG, "${e.message}.")
return false
}
// check that the audioRecord is ready to be used
if (m_audioTrack!!.state != AudioTrack.STATE_INITIALIZED) {
Log.i(
LOG_TAG, "Audio renderer not initialized "
+ m_rendererSettings.sampleRate
)
return false
}
m_bufferedPlaySamples = 0
outputMode = OutputMode.SpeakerPhone
m_shutdownRenderThread = false
Thread(m_renderThread).start()
return true
}
override fun destroyRenderer(): Boolean {
m_rendererLock.lock()
// release the object
m_audioTrack!!.release()
m_audioTrack = null
m_shutdownRenderThread = true
m_renderEvent.signal()
m_rendererLock.unlock()
unregisterHeadsetReceiver()
m_audioManager.isSpeakerphoneOn = false
m_audioManager.mode = AudioManager.MODE_NORMAL
return true
}
override fun getEstimatedRenderDelay(): Int {
return m_estimatedRenderDelay
}
override fun startRenderer(): Boolean {
// start playout
try {
m_audioTrack!!.play()
} catch (e: IllegalStateException) {
e.printStackTrace()
return false
}
m_rendererLock.lock()
m_isRendering = true
m_renderEvent.signal()
m_rendererLock.unlock()
return true
}
override fun stopRenderer(): Boolean {
m_rendererLock.lock()
try {
// only stop if we are playing
if (m_audioTrack!!.getPlayState() == AudioTrack.PLAYSTATE_PLAYING) {
// stop playout
try {
m_audioTrack!!.stop()
} catch (e: IllegalStateException) {
e.printStackTrace()
return false
}
// flush the buffers
m_audioTrack!!.flush()
}
} finally {
// Ensure we always unlock, both for success, exception or error
// return.
m_isRendering = false
m_rendererLock.unlock()
}
return true
}
private val m_renderThread = Runnable {
val samplesToPlay = SAMPLING_RATE / 100
try {
Process
.setThreadPriority(Process.THREAD_PRIORITY_URGENT_AUDIO)
} catch (e: Exception) {
e.printStackTrace()
}
while (!m_shutdownRenderThread) {
m_rendererLock.lock()
try {
if (!m_isRendering) {
m_renderEvent.await()
continue
} else {
m_rendererLock.unlock()
// Don't lock on audioBus calls
m_playBuffer!!.clear()
val samplesRead: Int = audioBus.readRenderData(
m_playBuffer, samplesToPlay
)
// Log.d(LOG_TAG, "Samples read: " + samplesRead);
m_rendererLock.lock()
if (!isRendererMuted) {
// After acquiring the lock again
// we must check if we are still playing
if (m_audioTrack == null
|| !m_isRendering
) {
continue
}
val bytesRead = ((samplesRead shl 1)
* NUM_CHANNELS_RENDERING)
m_playBuffer!!.get(m_tempBufPlay, 0, bytesRead)
val bytesWritten: Int = m_audioTrack!!.write(
m_tempBufPlay, 0,
bytesRead
)
// increase by number of written samples
m_bufferedPlaySamples += ((bytesWritten shr 1)
/ NUM_CHANNELS_RENDERING)
// decrease by number of played samples
val pos: Int = m_audioTrack!!.getPlaybackHeadPosition()
if (pos < m_playPosition) {
// wrap or reset by driver
m_playPosition = 0
}
m_bufferedPlaySamples -= pos - m_playPosition
m_playPosition = pos
// we calculate the estimated delay based on the
// buffered samples
m_estimatedRenderDelay = (m_bufferedPlaySamples * 1000
/ SAMPLING_RATE)
}
}
} catch (e: Exception) {
Log.e(LOG_TAG, "Exception: " + e.message)
e.printStackTrace()
} finally {
m_rendererLock.unlock()
}
}
}
override fun getCaptureSettings(): AudioSettings {
return m_captureSettings
}
override fun getRenderSettings(): AudioSettings {
return m_rendererSettings
}
/**
* Communication modes handling
*/
override fun setOutputMode(mode: OutputMode): Boolean {
super.setOutputMode(mode)
if (mode == OutputMode.Handset) {
unregisterHeadsetReceiver()
m_audioManager.isSpeakerphoneOn = false
} else {
m_audioManager.isSpeakerphoneOn = true
registerHeadsetReceiver()
}
return true
}
private val m_headsetReceiver: BroadcastReceiver = object : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent) {
if (intent.action!!.compareTo(Intent.ACTION_HEADSET_PLUG) == 0) {
val state: Int = intent.getIntExtra("state", 0)
m_audioManager.isSpeakerphoneOn = state == 0
}
}
}
private var m_receiverRegistered = false
private fun registerHeadsetReceiver() {
if (!m_receiverRegistered) {
val receiverFilter = IntentFilter(
Intent.ACTION_HEADSET_PLUG
)
m_context.registerReceiver(m_headsetReceiver, receiverFilter)
m_receiverRegistered = true
}
}
private fun unregisterHeadsetReceiver() {
if (m_receiverRegistered) {
try {
m_context.unregisterReceiver(m_headsetReceiver)
} catch (e: IllegalArgumentException) {
e.printStackTrace()
}
m_receiverRegistered = false
}
}
override fun onPause() {
if (outputMode == OutputMode.SpeakerPhone) {
unregisterHeadsetReceiver()
}
}
override fun onResume() {
if (outputMode == OutputMode.SpeakerPhone) {
registerHeadsetReceiver()
}
}
fun setRendererMute(isRendererMuted: Boolean) {
this.isRendererMuted = isRendererMuted
}
}

@ -1,4 +1,4 @@
package com.hmg.hmgDr.util
package com.hmg.hmgDr.util.opentok
import android.content.Context
import android.content.res.Resources

@ -1,4 +1,4 @@
package com.hmg.hmgDr.util
package com.hmg.hmgDr.util.opentok
import android.content.Context
import android.content.res.Resources

@ -0,0 +1,58 @@
package com.hmg.hmgDr.util
import android.content.Context
import android.util.DisplayMetrics
import android.view.inputmethod.InputMethodManager
import android.widget.EditText
import io.flutter.embedding.android.FlutterFragmentActivity
import kotlin.math.ceil
object ViewsUtil {
/* return status bar height on basis of device display metrics */
fun getStatusBarHeight(context: Context): Int {
return ceil(
(25 * context.resources.displayMetrics.density).toDouble()
).toInt()
}
/**
* @param context
* @return the Screen height in DP
*/
fun getHeightDp(context: Context, isInDp: Boolean = false): Float {
val displayMetrics: DisplayMetrics = context.resources.displayMetrics
return if (isInDp) {
displayMetrics.heightPixels / displayMetrics.density
} else {
displayMetrics.heightPixels.toFloat()
}
}
/**
* @param context
* @return the screnn width in dp
*/
fun getWidthDp(context: Context, isInDp: Boolean = false): Float {
val displayMetrics: DisplayMetrics = context.resources.displayMetrics
return if (isInDp) {
displayMetrics.widthPixels / displayMetrics.density
} else {
displayMetrics.widthPixels.toFloat()
}
}
// code to hide soft keyboard
fun hideSoftKeyBoard(context: Context, editBox: EditText?) {
val imm = context.getSystemService(FlutterFragmentActivity.INPUT_METHOD_SERVICE) as InputMethodManager
imm.hideSoftInputFromWindow(editBox?.windowToken, 0)
}
// code to show soft keyboard
private fun showSoftKeyBoard(context: Context, editBox: EditText?) {
val inputMethodManager = context.getSystemService(FlutterFragmentActivity.INPUT_METHOD_SERVICE) as InputMethodManager
editBox?.requestFocus()
inputMethodManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0)
}
}

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M7.41,8.59L12,13.17l4.59,-4.58L18,10l-6,6 -6,-6 1.41,-1.41z"/>
</vector>

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M7.41,15.41L12,10.83l4.59,4.58L18,14l-6,-6 -6,6z"/>
</vector>

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12,9c-1.6,0 -3.15,0.25 -4.6,0.72v3.1c0,0.39 -0.23,0.74 -0.56,0.9 -0.98,0.49 -1.87,1.12 -2.66,1.85 -0.18,0.18 -0.43,0.28 -0.7,0.28 -0.28,0 -0.53,-0.11 -0.71,-0.29L0.29,13.08c-0.18,-0.17 -0.29,-0.42 -0.29,-0.7 0,-0.28 0.11,-0.53 0.29,-0.71C3.34,8.78 7.46,7 12,7s8.66,1.78 11.71,4.67c0.18,0.18 0.29,0.43 0.29,0.71 0,0.28 -0.11,0.53 -0.29,0.71l-2.48,2.48c-0.18,0.18 -0.43,0.29 -0.71,0.29 -0.27,0 -0.52,-0.11 -0.7,-0.28 -0.79,-0.74 -1.69,-1.36 -2.67,-1.85 -0.33,-0.16 -0.56,-0.5 -0.56,-0.9v-3.1C15.15,9.25 13.6,9 12,9z"/>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

@ -11,7 +11,7 @@
<RelativeLayout
android:id="@+id/layout_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="@dimen/layout_name_height"
android:padding="@dimen/padding_space_medium"
app:layout_constraintTop_toTopOf="parent">
@ -33,52 +33,53 @@
android:background="@drawable/shape_capsule"
android:padding="@dimen/padding_space_small">
<Chronometer
android:id="@+id/cmTimer"
<TextView
android:id="@+id/tv_timer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
android:textColor="@color/white"
android:textSize="16sp"
android:textSize="@dimen/text_size_medium"
android:textStyle="bold"
tools:text="25:45" />
android:text="00:00" />
</FrameLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/layout_mini"
android:layout_width="match_parent"
android:layout_height="@dimen/layout_mini_height"
android:background="@color/remoteBackground"
app:layout_constraintTop_toBottomOf="@+id/layout_name"
android:alpha="0.5"
android:visibility="gone"
tools:visibility="visible">
<ImageButton
android:id="@+id/ic_mini"
style="@style/Widget.MaterialComponents.Button.Icon"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_margin="@dimen/padding_space_medium"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:background="@null"
android:src="@drawable/ic_mini" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/activity_clingo_video_call"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@id/control_panel"
app:layout_constraintTop_toBottomOf="@+id/layout_name">
<RelativeLayout
android:id="@+id/layout_mini"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/remoteBackground"
android:alpha="0.5"
android:visibility="gone">
<ImageButton
android:id="@+id/ic_mini"
style="@style/Widget.MaterialComponents.Button.Icon"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_margin="@dimen/padding_space_medium"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:background="@null"
android:src="@drawable/ic_mini" />
</RelativeLayout>
app:layout_constraintTop_toBottomOf="@+id/layout_mini">
<FrameLayout
android:id="@+id/remote_video_view_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/layout_mini"
android:background="@color/remoteBackground">
<ImageView
@ -108,6 +109,23 @@
android:src="@drawable/video_off_fill" />
</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:scaleType="centerCrop"
android:layout_margin="5dp"
android:src="@drawable/ic_record" />
</FrameLayout>
<FrameLayout
android:id="@+id/thumbnail_container"
android:layout_width="90dp"
@ -123,7 +141,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/control_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="@dimen/layout_panel_height"
android:padding="@dimen/padding_space_big"
app:layout_constraintBottom_toBottomOf="parent">
@ -131,7 +149,7 @@
android:id="@+id/btn_call"
android:layout_width="@dimen/video_icon_size"
android:layout_height="@dimen/video_icon_size"
android:scaleType="centerCrop"
android:scaleType="centerInside"
android:src="@drawable/call"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@ -141,7 +159,7 @@
android:id="@+id/btn_minimize"
android:layout_width="@dimen/video_icon_size"
android:layout_height="@dimen/video_icon_size"
android:scaleType="centerCrop"
android:scaleType="centerInside"
android:src="@drawable/reducing"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
@ -152,7 +170,7 @@
android:layout_width="@dimen/video_icon_size"
android:layout_height="@dimen/video_icon_size"
android:layout_marginStart="@dimen/padding_space_medium"
android:scaleType="centerCrop"
android:scaleType="centerInside"
android:src="@drawable/video_enabled"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/btn_minimize"
@ -163,7 +181,7 @@
android:layout_width="@dimen/video_icon_size"
android:layout_height="@dimen/video_icon_size"
android:layout_marginStart="@dimen/padding_space_medium"
android:scaleType="centerCrop"
android:scaleType="centerInside"
android:src="@drawable/mic_enabled"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/btn_camera"
@ -174,7 +192,7 @@
android:layout_width="@dimen/video_icon_size"
android:layout_height="@dimen/video_icon_size"
android:layout_marginStart="@dimen/padding_space_medium"
android:scaleType="centerCrop"
android:scaleType="centerInside"
android:src="@drawable/camera_back"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/btn_mic"
@ -185,7 +203,7 @@
android:layout_width="@dimen/video_icon_size"
android:layout_height="@dimen/video_icon_size"
android:layout_marginStart="@dimen/padding_space_medium"
android:scaleType="centerCrop"
android:scaleType="centerInside"
android:src="@drawable/audio_enabled"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:padding="16dp">
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:fadeScrollbars="false"
android:scrollbars="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/ask_for_error_log"
android:textColor="#212121"
android:textSize="18sp"/>
<Button
android:id="@+id/button_view_error_log"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="View Error Log"
android:textColor="#212121"/>
<Button
android:id="@+id/button_copy_error_log"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="Copy Error Log"
android:textColor="#212121"/>
<Button
android:id="@+id/button_share_error_log"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="Share Error Log"
android:textColor="#212121"/>
<Button
android:id="@+id/button_email_error_log"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="Email Error Log"
android:textColor="#212121"/>
<Button
android:id="@+id/button_save_error_log"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="Save Error Log"
android:textColor="#212121"/>
<Button
android:id="@+id/button_close_app"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Close App"
android:textColor="#212121"/>
</LinearLayout>
</ScrollView>
</LinearLayout>

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="88dp"
android:background="@android:color/holo_blue_dark"
android:orientation="vertical"
android:padding="@dimen/padding_space_medium">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/iv_icon"
android:layout_width="22dp"
android:layout_height="22dp"
android:src="@mipmap/ic_launcher" />
<TextView
style="@style/TextAppearance.Compat.Notification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="@dimen/padding_space_small"
android:paddingEnd="@dimen/padding_space_small"
android:text="HMG Doctor"
android:textColor="@color/white"
android:textSize="@dimen/text_size_small" />
<Chronometer
android:id="@+id/notify_timer"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
style="@style/TextAppearance.Compat.Notification"
android:paddingStart="@dimen/padding_space_small"
android:paddingEnd="@dimen/padding_space_small"
android:textColor="@color/white"
android:textSize="@dimen/text_size_small"
android:format="MM:SS"
tools:text="25:45" />
<ImageView
android:id="@+id/iv_Arrow"
android:layout_width="22dp"
android:layout_height="22dp"
android:src="@drawable/ic_arrow_bottom" />
</LinearLayout>
<TextView
android:id="@+id/notify_title"
style="@style/TextAppearance.Compat.Notification.Title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_space_medium"
android:paddingStart="@dimen/padding_space_small"
android:paddingEnd="@dimen/padding_space_small"
android:textColor="@color/white"
android:textSize="@dimen/text_size_small"
android:textStyle="bold"
tools:text="Mosa zaid mosa abuzaid" />
<TextView
android:id="@+id/notify_content"
style="@style/TextAppearance.Compat.Notification.Title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="@dimen/padding_space_small"
android:paddingEnd="@dimen/padding_space_small"
android:textColor="@color/white"
android:textSize="@dimen/text_size_small"
android:text="Tap to return to call" />
</LinearLayout>

@ -0,0 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/holo_blue_dark"
android:orientation="vertical"
android:padding="@dimen/padding_space_medium">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/iv_icon"
android:layout_width="22dp"
android:layout_height="22dp"
android:src="@mipmap/ic_launcher" />
<TextView
style="@style/TextAppearance.Compat.Notification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="@dimen/padding_space_small"
android:paddingEnd="@dimen/padding_space_small"
android:text="HMG Doctor"
android:textColor="@color/white"
android:textSize="@dimen/text_size_small" />
<Chronometer
android:id="@+id/notify_timer"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
style="@style/TextAppearance.Compat.Notification"
android:paddingStart="@dimen/padding_space_small"
android:paddingEnd="@dimen/padding_space_small"
android:textColor="@color/white"
android:textSize="@dimen/text_size_small"
android:format="MM:SS"
tools:text="25:45" />
<ImageView
android:id="@+id/iv_Arrow"
android:layout_width="22dp"
android:layout_height="22dp"
android:src="@drawable/ic_arrow_top" />
</LinearLayout>
<TextView
android:id="@+id/notify_title"
style="@style/TextAppearance.Compat.Notification.Title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_space_big"
android:paddingStart="@dimen/padding_space_small"
android:paddingEnd="@dimen/padding_space_small"
android:textColor="@color/white"
android:textSize="@dimen/text_size_medium"
android:textStyle="bold"
tools:text="Mosa zaid mosa abuzaid" />
<TextView
android:id="@+id/notify_content"
style="@style/TextAppearance.Compat.Notification.Title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="@dimen/padding_space_small"
android:paddingEnd="@dimen/padding_space_small"
android:textColor="@color/white"
android:textSize="@dimen/text_size_medium"
android:text="Tap to return to call" />
<TextView
android:id="@+id/btn_end"
style="@style/TextAppearance.Compat.Notification.Title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_space_medium"
android:layout_marginBottom="@dimen/padding_space_medium"
android:paddingStart="@dimen/padding_space_small"
android:paddingEnd="@dimen/padding_space_small"
android:textColor="@color/white"
android:textSize="@dimen/text_size_medium"
android:textStyle="bold"
android:text="End call" />
</LinearLayout>

@ -9,7 +9,7 @@
<!-- buttons -->
<dimen name="call_button_size">60dp</dimen>
<dimen name="other_button_size">54dp</dimen>
<dimen name="video_icon_size">52dp</dimen>
<dimen name="video_icon_size">48dp</dimen>
<dimen name="video_icon_size_small">24dp</dimen>
<!-- buttons -->
@ -33,9 +33,15 @@
<!-- padding/margin-->
<dimen name="padding_space_small">4dp</dimen>
<dimen name="padding_space_medium">8sp</dimen>
<dimen name="padding_space_medium">8dp</dimen>
<dimen name="padding_space_big">16dp</dimen>
<dimen name="padding_space_big_2">24dp</dimen>
<dimen name="layout_mini_height">36dp</dimen>
<dimen name="layout_name_height">60dp</dimen>
<dimen name="layout_panel_height">80dp</dimen>
<dimen name="layout_panel_height_small">40dp</dimen>
</resources>

@ -4,7 +4,6 @@
<string name="remaining_ar">الوقت المتبقي بالثانيه: </string>
<string name="setting">Settings</string>
<string name="cancel">Cancel</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="ask_for_error_log">An unexpected error has occurred.\nHelp developers by providing error details.\nThank you for your support.</string>
</resources>

@ -1,10 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<style name="LaunchTheme" parent="Theme.AppCompat.NoActionBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<style name="AppTheme" parent="Theme.AppCompat">
</style>
@ -25,12 +27,17 @@
<!-- turn off any drawable used to draw a frame on the window -->
<item name="android:windowIsFloating">true</item>
<!-- float the window so it does not fill the screen -->
<item name="android:windowNoTitle">true</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">true</item>
<item name="android:windowFullscreen">false</item>
<!-- remove the title bar we make our own-->
<item name="android:windowContentOverlay">@null</item>
<!-- remove the shadow from under the title bar -->
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
<!-- smooth animation-->
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
</style>
</resources>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<paths>
<external-path name="external_files" path="."/>
</paths>

@ -8,7 +8,7 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.2'
classpath 'com.google.gms:google-services:4.3.3'
}
}

@ -1,34 +1,77 @@
{
"project_info": {
"project_number": "157373154094",
"project_id": "hmg-doctor-app-1553688619744",
"storage_bucket": "hmg-doctor-app-1553688619744.appspot.com"
"project_number": "934365232760",
"project_id": "hmg-dr-app",
"storage_bucket": "hmg-dr-app.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:157373154094:android:daeea3a4e1f4462a1bf0bf",
"mobilesdk_app_id": "1:934365232760:android:024b3569972f1c09f9778d",
"android_client_info": {
"package_name": "COM.HMG.HMGDR"
}
},
"oauth_client": [
{
"client_id": "934365232760-bobv1r1sn222le020jeni6u1bdbjdu1v.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCpYwrmuntOBdZv6GV6KEnLj8nQRvEnZ6I"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "934365232760-bobv1r1sn222le020jeni6u1bdbjdu1v.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "934365232760-57v2ld1qqulc4nt4o5pgjfbpc47fj3qf.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "COM.HMG.HMGDR"
}
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:934365232760:android:e0e185e68c0d7690f9778d",
"android_client_info": {
"package_name": "com.hmg.hmgDr"
}
},
"oauth_client": [
{
"client_id": "157373154094-egrhbfr861l7k722g3v2gd4a0opi3r1u.apps.googleusercontent.com",
"client_id": "934365232760-bobv1r1sn222le020jeni6u1bdbjdu1v.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDX8RPwu00MyrpqC-T2zXtrUQvTQGRv1mM"
"current_key": "AIzaSyCpYwrmuntOBdZv6GV6KEnLj8nQRvEnZ6I"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "157373154094-egrhbfr861l7k722g3v2gd4a0opi3r1u.apps.googleusercontent.com",
"client_id": "934365232760-bobv1r1sn222le020jeni6u1bdbjdu1v.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "934365232760-57v2ld1qqulc4nt4o5pgjfbpc47fj3qf.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "COM.HMG.HMGDR"
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 969 B

@ -3,21 +3,21 @@
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string>1097451043303-ifgtu6ub88dlk5dmv5tm531a5s47gbre.apps.googleusercontent.com</string>
<string>934365232760-en86g42ch3fgu7odnv5ka6kec8irg8d5.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.1097451043303-ifgtu6ub88dlk5dmv5tm531a5s47gbre</string>
<string>com.googleusercontent.apps.934365232760-en86g42ch3fgu7odnv5ka6kec8irg8d5</string>
<key>API_KEY</key>
<string>AIzaSyAKPayaNaI-2RN6S4PH5W9wYExmEgoBUvo</string>
<string>AIzaSyBtA8-oCZ5T4gkuTG7CucGr_d_7lakp4MM</string>
<key>GCM_SENDER_ID</key>
<string>1097451043303</string>
<string>934365232760</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.hmg.doctorApp</string>
<string>com.hmg.hmgDr</string>
<key>PROJECT_ID</key>
<string>doctor-app-35ddc</string>
<string>hmg-dr-app</string>
<key>STORAGE_BUCKET</key>
<string>doctor-app-35ddc.appspot.com</string>
<string>hmg-dr-app.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
@ -29,6 +29,6 @@
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:1097451043303:ios:0e9b87e77dcf397d866542</string>
<string>1:934365232760:ios:61e01db91b41502bf9778d</string>
</dict>
</plist>

@ -3,21 +3,21 @@
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string>1097451043303-ifgtu6ub88dlk5dmv5tm531a5s47gbre.apps.googleusercontent.com</string>
<string>934365232760-en86g42ch3fgu7odnv5ka6kec8irg8d5.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.1097451043303-ifgtu6ub88dlk5dmv5tm531a5s47gbre</string>
<string>com.googleusercontent.apps.934365232760-en86g42ch3fgu7odnv5ka6kec8irg8d5</string>
<key>API_KEY</key>
<string>AIzaSyAKPayaNaI-2RN6S4PH5W9wYExmEgoBUvo</string>
<string>AIzaSyBtA8-oCZ5T4gkuTG7CucGr_d_7lakp4MM</string>
<key>GCM_SENDER_ID</key>
<string>1097451043303</string>
<string>934365232760</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.hmg.doctorApp</string>
<string>com.hmg.hmgDr</string>
<key>PROJECT_ID</key>
<string>doctor-app-35ddc</string>
<string>hmg-dr-app</string>
<key>STORAGE_BUCKET</key>
<string>doctor-app-35ddc.appspot.com</string>
<string>hmg-dr-app.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
@ -29,6 +29,6 @@
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:1097451043303:ios:0e9b87e77dcf397d866542</string>
<string>1:934365232760:ios:61e01db91b41502bf9778d</string>
</dict>
</plist>

@ -26,7 +26,8 @@ class BaseAppClient {
required Function(dynamic response, int statusCode) onSuccess,
required Function(String error, int statusCode) onFailure,
bool isAllowAny = false,
bool isLiveCare = false}) async {
bool isLiveCare = false,
bool isFallLanguage = false}) async {
String url;
if (isLiveCare)
url = BASE_URL_LIVE_CARE + endPoint;
@ -59,17 +60,22 @@ class BaseAppClient {
body['TokenID'] = token;
}
// body['TokenID'] = "@dm!n" ?? '';
String lang = await sharedPref.getString(APP_Language);
if (lang != null && lang == 'ar')
body['LanguageID'] = 1;
else
body['LanguageID'] = 2;
body['stamp'] = STAMP;
if (!isFallLanguage) {
String lang = await sharedPref.getString(APP_Language);
if (lang != null && lang == 'ar')
body['LanguageID'] = 1;
else
body['LanguageID'] = 2;
}
body['stamp'] = DateTime.now().toIso8601String();
// if(!body.containsKey("IPAdress"))
body['IPAdress'] = IP_ADDRESS;
body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL;
if (body['VersionID'] == null) {
body['VersionID'] = VERSION_ID;
}
if (body['Channel'] == null) {
body['Channel'] = CHANNEL;
}
body['SessionID'] = SESSION_ID;
body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP;
body['PatientOutSA'] = body['PatientOutSA'] ?? 0; // PATIENT_OUT_SA;
@ -83,7 +89,10 @@ class BaseAppClient {
int projectID = await sharedPref.getInt(PROJECT_ID);
if (projectID == 2 || projectID == 3)
body['PatientOutSA'] = true;
else if (body.containsKey('facilityId') && body['facilityId'] == 2 || body['facilityId'] == 3)
else if ((body.containsKey('facilityId') && body['facilityId'] == 2 ||
body['facilityId'] == 3) ||
body['ProjectID'] == 2 ||
body['ProjectID'] == 3)
body['PatientOutSA'] = true;
else
body['PatientOutSA'] = false;
@ -205,7 +214,8 @@ class BaseAppClient {
print("URL : $url");
print("Body : ${json.encode(body)}");
var asd = json.encode(body);
var asd2;
if (await Helpers.checkConnection()) {
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers);
final int statusCode = response.statusCode;

@ -9,85 +9,118 @@ const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";
const PATIENT_INSURANCE_APPROVALS_URL = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient";
const PATIENT_ORDERS_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";
const PATIENT_REFER_TO_DOCTOR_URL = "Services/DoctorApplication.svc/REST/ReferToDoctor";
const PATIENT_GET_DOCTOR_BY_CLINIC_URL = "Services/DoctorApplication.svc/REST/GetDoctorsByClinicID";
const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital = "Services/Doctors.svc/REST/SearchDoctorsByTime";
const GET_CLINICS_FOR_DOCTOR = 'Services/DoctorApplication.svc/REST/GetClinicsForDoctor';
const PATIENT_GET_LIST_REFERAL_URL = "Services/Lists.svc/REST/GetList_STPReferralFrequency";
const PATIENT_GET_CLINIC_BY_PROJECT_URL = "Services/DoctorApplication.svc/REST/GetClinicsByProjectID";
const PATIENT_PROGRESS_NOTE_URL =
"Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";
const PATIENT_INSURANCE_APPROVALS_URL =
"Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient";
const PATIENT_ORDERS_URL =
"Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";
const PATIENT_REFER_TO_DOCTOR_URL =
"Services/DoctorApplication.svc/REST/ReferToDoctor";
const PATIENT_GET_DOCTOR_BY_CLINIC_URL =
"Services/DoctorApplication.svc/REST/GetDoctorsByClinicID";
const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital =
"Services/Doctors.svc/REST/SearchDoctorsByTime";
const GET_CLINICS_FOR_DOCTOR =
'Services/DoctorApplication.svc/REST/GetClinicsForDoctor';
const PATIENT_GET_LIST_REFERAL_URL =
"Services/Lists.svc/REST/GetList_STPReferralFrequency";
const PATIENT_GET_CLINIC_BY_PROJECT_URL =
"Services/DoctorApplication.svc/REST/GetClinicsByProjectID";
const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo";
const GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics";
const GET_REFERRAL_FACILITIES = 'Services/DoctorApplication.svc/REST/GetReferralFacilities';
const GET_REFERRAL_FACILITIES =
'Services/DoctorApplication.svc/REST/GetReferralFacilities';
const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo';
const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign';
const GET_PATIENT_VITAL_SIGN_DATA = 'Services/DoctorApplication.svc/REST/GetVitalSigns';
const GET_PATIENT_LAB_OREDERS = 'Services/DoctorApplication.svc/REST/GetPatientLabOreders';
const GET_PATIENT_VITAL_SIGN =
'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign';
const GET_PATIENT_VITAL_SIGN_DATA =
'Services/DoctorApplication.svc/REST/GetVitalSigns';
const GET_PATIENT_LAB_OREDERS =
'Services/DoctorApplication.svc/REST/GetPatientLabOreders';
const GET_PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_RADIOLOGY = 'Services/DoctorApplication.svc/REST/GetPatientRadResult';
const GET_LIVECARE_PENDINGLIST = 'Services/DoctorApplication.svc/REST/GetPendingPatientER';
const GET_LIVECARE_PENDINGLIST =
'Services/DoctorApplication.svc/REST/GetPendingPatientER';
const START_LIVE_CARE_CALL = 'LiveCareApi/DoctorApp/CallPatient';
const LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL =
"Lists.svc/REST/DashBoard_GetLiveCareDoctorsStatsticsForCertainDoctor";
const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/GetPrescriptionReport';
const GET_PRESCRIPTION_REPORT =
'Services/Patients.svc/REST/GetPrescriptionReport';
const GT_MY_PATIENT_QUESTION = 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions';
const GT_MY_PATIENT_QUESTION =
'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions';
const PRM_SEARCH_PATIENT = 'Services/Patients.svc/REST/GetPatientInformation_PRM';
const PRM_SEARCH_PATIENT =
'Services/Patients.svc/REST/GetPatientInformation_PRM';
const GET_PATIENT = 'Services/DoctorApplication.svc/REST/';
const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient';
const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT =
'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient';
const GET_MY_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferralPatient';
const GET_MY_REFERRAL_PATIENT =
'Services/DoctorApplication.svc/REST/GtMyReferralPatient';
const REFER_TO_DOCTOR = 'Services/DoctorApplication.svc/REST/ReferToDoctor';
const ADD_REFERRED_DOCTOR_REMARKS = 'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks';
const ADD_REFERRED_DOCTOR_REMARKS =
'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks';
const GET_MY_REFERRED_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredPatient';
const GET_MY_REFERRED_PATIENT =
'Services/DoctorApplication.svc/REST/GtMyReferredPatient';
const GET_MY_REFERRED_OUT_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredOutPatient';
const GET_MY_REFERRED_OUT_PATIENT =
'Services/DoctorApplication.svc/REST/GtMyReferredOutPatient';
const GET_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/PendingReferrals';
const GET_PENDING_REFERRAL_PATIENT =
'Services/DoctorApplication.svc/REST/PendingReferrals';
const CREATE_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/CreateReferral';
const CREATE_REFERRAL_PATIENT =
'Services/DoctorApplication.svc/REST/CreateReferral';
const RESPONSE_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/RespondReferral';
const RESPONSE_PENDING_REFERRAL_PATIENT =
'Services/DoctorApplication.svc/REST/RespondReferral';
const GET_PATIENT_REFERRAL = 'Services/DoctorApplication.svc/REST/GetRefferal';
const POST_UCAF = 'Services/DoctorApplication.svc/REST/PostUCAF';
const GET_DOCTOR_WORKING_HOURS_TABLE = 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable';
const GET_DOCTOR_WORKING_HOURS_TABLE =
'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable';
const GET_PATIENT_LAB_RESULTS = 'Services/DoctorApplication.svc/REST/GetPatientLabResults';
const GET_PATIENT_LAB_RESULTS =
'Services/DoctorApplication.svc/REST/GetPatientLabResults';
const LOGIN_URL = 'Services/Sentry.svc/REST/MemberLogIN_New';
const INSERT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails';
const INSERT_DEVICE_IMEI =
'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails';
// 'Services/Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI';
// const SELECT_DEVICE_IMEI =
// 'Services/Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI';
const SELECT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI';
const SELECT_DEVICE_IMEI =
'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI';
const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE =
'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType';
const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp';
const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP =
'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp';
const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = 'Services/DoctorApplication.svc/REST/SendVerificationCode';
const MEMBER_CHECK_ACTIVATION_CODE_NEW = 'Services/Sentry.svc/REST/MemberCheckActivationCode_New';
const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN =
'Services/DoctorApplication.svc/REST/SendVerificationCode';
const MEMBER_CHECK_ACTIVATION_CODE_NEW =
'Services/Sentry.svc/REST/MemberCheckActivationCode_New';
const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp';
const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP =
'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp';
const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles';
const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin';
@ -95,138 +128,261 @@ const SEND_SMS_INSTRUCTIONS = 'LiveCareApi/DoctorApp/SendSMSInstruction';
const GET_ALTERNATIVE_SERVICE = 'LiveCareApi/DoctorApp/GetAlternativeServices';
const END_CALL = 'LiveCareApi/DoctorApp/EndCall';
const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge';
const GET_DASHBOARD = 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI';
const GET_SICKLEAVE_STATISTIC = 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics';
const ARRIVED_PATIENT_URL = 'Services/DoctorApplication.svc/REST/PatientArrivalList';
const GET_DASHBOARD =
'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI';
const GET_SICKLEAVE_STATISTIC =
'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics';
const ARRIVED_PATIENT_URL =
'Services/DoctorApplication.svc/REST/PatientArrivalList';
const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave';
const GET_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave';
const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave';
const GET_OFFTIME = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList';
const GET_COVERING_DOCTORS = 'Services/DoctorApplication.svc/REST/GetCoveringDoctor';
const GET_COVERING_DOCTORS =
'Services/DoctorApplication.svc/REST/GetCoveringDoctor';
const ADD_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PostRequisition';
const UPDATE_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PatchRequisition';
const GET_RESCHEDULE_LEAVE = 'Services/DoctorApplication.svc/REST/GetRequisition';
const GET_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/GetPrescription';
const POST_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/PostPrescription';
const GET_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure';
const UPDATE_RESCHDEULE =
'Services/DoctorApplication.svc/REST/PatchRequisition';
const GET_RESCHEDULE_LEAVE =
'Services/DoctorApplication.svc/REST/GetRequisition';
const GET_PRESCRIPTION_LIST =
'Services/DoctorApplication.svc/REST/GetPrescription';
const POST_PRESCRIPTION_LIST =
'Services/DoctorApplication.svc/REST/PostPrescription';
const GET_PROCEDURE_LIST =
'Services/DoctorApplication.svc/REST/GetOrderedProcedure';
const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure';
const GET_PATIENT_ARRIVAL_LIST = 'Services/DoctorApplication.svc/REST/PatientArrivalList';
const GET_PATIENT_ARRIVAL_LIST =
'Services/DoctorApplication.svc/REST/PatientArrivalList';
const GET_PATIENT_IN_PATIENT_LIST = 'Services/DoctorApplication.svc/REST/GetMyInPatient';
const GET_PATIENT_IN_PATIENT_LIST =
'Services/DoctorApplication.svc/REST/GetMyInPatient';
const Verify_Referral_Doctor_Remarks = 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks';
const Verify_Referral_Doctor_Remarks =
'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks';
///Lab Order
const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders';
const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults';
const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail';
const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults';
const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults';
const GET_Patient_LAB_SPECIAL_RESULT =
'Services/Patients.svc/REST/GetPatientLabSpecialResults';
const SEND_LAB_RESULT_EMAIL =
'Services/Notifications.svc/REST/SendLabReportEmail';
const GET_Patient_LAB_RESULT =
'Services/Patients.svc/REST/GetPatientLabResults';
const GET_Patient_LAB_ORDERS_RESULT =
'Services/Patients.svc/REST/GetPatientLabOrdersResults';
const GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION =
'Services/Patients.svc/REST/GetPatientLabOrdersResultsHistoryByDescription';
// SOAP
const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies';
const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList';
const GET_MASTER_LOOKUP_LIST =
'Services/DoctorApplication.svc/REST/GetMasterLookUpList';
const POST_EPISODE = 'Services/DoctorApplication.svc/REST/PostEpisode';
const POST_EPISODE_FOR_IN_PATIENT =
'Services/DoctorApplication.svc/REST/PostEpisodeForInpatient';
const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies';
const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory';
const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint';
const POST_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PostPhysicalExam';
const POST_PROGRESS_NOTE = '/Services/DoctorApplication.svc/REST/PostProgressNote';
const POST_CHIEF_COMPLAINT =
'Services/DoctorApplication.svc/REST/PostChiefcomplaint';
const POST_PHYSICAL_EXAM =
'Services/DoctorApplication.svc/REST/PostPhysicalExam';
const POST_PROGRESS_NOTE =
'/Services/DoctorApplication.svc/REST/PostProgressNote';
const POST_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PostAssessment';
const PATCH_ALLERGY = 'Services/DoctorApplication.svc/REST/PatchAllergies';
const PATCH_HISTORY = 'Services/DoctorApplication.svc/REST/PatchHistory';
const PATCH_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint';
const PATCH_CHIEF_COMPLAINT =
'Services/DoctorApplication.svc/REST/PatchChiefcomplaint';
const PATCH_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PatchPhysicalExam';
const PATCH_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/PatchProgressNote';
const PATCH_PHYSICAL_EXAM =
'Services/DoctorApplication.svc/REST/PatchPhysicalExam';
const PATCH_PROGRESS_NOTE =
'Services/DoctorApplication.svc/REST/PatchProgressNote';
const PATCH_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PatchAssessment';
const GET_ALLERGY = 'Services/DoctorApplication.svc/REST/GetAllergies';
const GET_HISTORY = 'Services/DoctorApplication.svc/REST/GetHistory';
const GET_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/GetChiefcomplaint';
const GET_CHIEF_COMPLAINT =
'Services/DoctorApplication.svc/REST/GetChiefcomplaint';
const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam';
const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote';
const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment';
const GET_ORDER_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure';
const GET_ORDER_PROCEDURE =
'Services/DoctorApplication.svc/REST/GetOrderedProcedure';
const GET_LIST_CATEGORISE = 'Services/DoctorApplication.svc/REST/GetProcedureCategories';
const GET_LIST_CATEGORISE =
'Services/DoctorApplication.svc/REST/GetProcedureCategories';
const GET_CATEGORISE_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetProcedure';
const GET_CATEGORISE_PROCEDURE =
'Services/DoctorApplication.svc/REST/GetProcedure';
const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure';
const UPDATE_PRESCRIPTION = 'Services/DoctorApplication.svc/REST/PatchPrescription';
const UPDATE_PRESCRIPTION =
'Services/DoctorApplication.svc/REST/PatchPrescription';
const SEARCH_DRUG = 'Services/DoctorApplication.svc/REST/GetMedicationList';
const DRUG_TO_DRUG = 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction';
const DRUG_TO_DRUG =
'Services/DoctorApplication.svc/REST/DrugToDrugInteraction';
const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile';
const GET_FLOORS = 'Services/DoctorApplication.svc/REST/GetFloors';
const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards';
const GET_ROOM_CATEGORIES = 'Services/DoctorApplication.svc/REST/GetRoomCategories';
const GET_DIAGNOSIS_TYPES = 'Services/DoctorApplication.svc/REST/DiagnosisTypes';
const GET_ROOM_CATEGORIES =
'Services/DoctorApplication.svc/REST/GetRoomCategories';
const GET_DIAGNOSIS_TYPES =
'Services/DoctorApplication.svc/REST/DiagnosisTypes';
const GET_DIET_TYPES = 'Services/DoctorApplication.svc/REST/DietTypes';
const GET_ICD_CODES = 'Services/DoctorApplication.svc/REST/GetICDCodes';
const POST_ADMISSION_REQUEST = 'Services/DoctorApplication.svc/REST/PostAdmissionRequest';
const GET_ITEM_BY_MEDICINE = 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode';
const POST_ADMISSION_REQUEST =
'Services/DoctorApplication.svc/REST/PostAdmissionRequest';
const GET_ITEM_BY_MEDICINE =
'Services/DoctorApplication.svc/REST/GetItemByMedicineCode';
const GET_PROCEDURE_VALIDATION = 'Services/DoctorApplication.svc/REST/ValidateProcedures';
const GET_BOX_QUANTITY = 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity';
const GET_PROCEDURE_VALIDATION =
'Services/DoctorApplication.svc/REST/ValidateProcedures';
const GET_BOX_QUANTITY =
'Services/DoctorApplication.svc/REST/CalculateBoxQuantity';
///GET ECG
const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults";
const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient";
const GET_MY_REFERRAL_INPATIENT =
"Services/DoctorApplication.svc/REST/GtMyReferralPatient";
const GET_MY_REFERRAL_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient";
const GET_MY_REFERRAL_OUT_PATIENT =
"Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient";
const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient";
const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient";
const GET_MY_DISCHARGE_PATIENT =
"Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient";
const GET_DISCHARGE_PATIENT =
"Services/DoctorApplication.svc/REST/GtMyDischargePatient";
const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus";
const GET_PAtIENTS_INSURANCE_APPROVALS =
"Services/Patients.svc/REST/GetApprovalStatus";
const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL';
const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';
const GET_IN_PATIENT_ORDERS = 'Services/DoctorApplication.svc/REST/GetPatientRadResult';
const GET_IN_PATIENT_ORDERS =
'Services/DoctorApplication.svc/REST/GetPatientRadResult';
///Prescriptions
const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT_NEW = 'Services/Patients.svc/REST/INP_GetPrescriptionReport';
const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail';
const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh';
const GET_PRESCRIPTIONS_ALL_ORDERS =
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT_NEW =
'Services/Patients.svc/REST/INP_GetPrescriptionReport';
const SEND_PRESCRIPTION_EMAIL =
'Services/Notifications.svc/REST/SendPrescriptionEmail';
const GET_PRESCRIPTION_REPORT_ENH =
'Services/Patients.svc/REST/GetPrescriptionReport_enh';
const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList";
const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient";
const CREATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient";
const UPDATE_PROGRESS_NOTE_FOR_INPATIENT =
"Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient";
const CREATE_PROGRESS_NOTE_FOR_INPATIENT =
"Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient";
const GET_PRESCRIPTION_IN_PATIENT = 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient';
const GET_PRESCRIPTION_IN_PATIENT =
'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient';
const GET_INSURANCE_IN_PATIENT = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient";
const GET_INSURANCE_IN_PATIENT =
"Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient";
const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave";
const GET_MY_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GetMyOutPatient";
const GET_MY_OUT_PATIENT =
"Services/DoctorApplication.svc/REST/GetMyOutPatient";
const PATIENT_MEDICAL_REPORT_GET_LIST = "Services/Patients.svc/REST/DAPP_ListMedicalReport";
const PATIENT_MEDICAL_REPORT_GET_TEMPLATE = "Services/Patients.svc/REST/DAPP_GetTemplateByID";
const PATIENT_MEDICAL_REPORT_INSERT = "Services/Patients.svc/REST/DAPP_InsertMedicalReport";
const PATIENT_MEDICAL_REPORT_VERIFIED = "Services/Patients.svc/REST/DAPP_VerifiedMedicalReport";
const PATIENT_MEDICAL_REPORT_GET_LIST =
"Services/Patients.svc/REST/DAPP_ListMedicalReport";
const PATIENT_MEDICAL_REPORT_GET_TEMPLATE =
"Services/Patients.svc/REST/DAPP_GetTemplateByID";
const PATIENT_MEDICAL_REPORT_INSERT =
"Services/Patients.svc/REST/DAPP_InsertMedicalReport";
const PATIENT_MEDICAL_REPORT_VERIFIED =
"Services/Patients.svc/REST/DAPP_VerifiedMedicalReport";
const GET_PROCEDURE_TEMPLETE = 'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet';
const GET_PROCEDURE_TEMPLETE =
'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet';
const GET_TEMPLETE_LIST = 'Services/Doctors.svc/REST/DAPP_TemplateGet';
const GET_PROCEDURE_TEMPLETE_DETAILS = "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet";
const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp';
const GET_PROCEDURE_TEMPLETE_DETAILS =
"Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet";
const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP =
'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp';
const DOCTOR_CHECK_HAS_LIVE_CARE = "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare";
const DOCTOR_CHECK_HAS_LIVE_CARE =
"Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare";
const LIVE_CARE_IS_LOGIN = "LiveCareApi/DoctorApp/UseIsLogin";
const ADD_REFERRED_REMARKS_NEW = "Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks_New";
const GET_SPECIAL_CLINICAL_CARE_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareList";
const GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareMappingList";
const ADD_REFERRED_REMARKS_NEW =
"Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks_New";
const GET_SPECIAL_CLINICAL_CARE_LIST =
"Services/DoctorApplication.svc/REST/GetSpecialClinicalCareList";
const GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST =
"Services/DoctorApplication.svc/REST/GetSpecialClinicalCareMappingList";
const INSERT_MEDICAL_REPORT =
"Services/Patients.svc/REST/DAPP_InsertMedicalReport_New";
const UPDATE_MEDICAL_REPORT =
"Services/Patients.svc/REST/DAPP_UpdateMedicalReport";
const GET_SICK_LEAVE_DOCTOR_APP =
"Services/DoctorApplication.svc/REST/GetAllSickLeaves";
const ADD_PATIENT_TO_DOCTOR = "LiveCareApi/DoctorApp/AssignPatientToDoctor";
const REMOVE_PATIENT_FROM_DOCTOR = "LiveCareApi/DoctorApp/BackPatientToQueue";
const CREATE_DOCTOR_RESPONSE =
"Services/DoctorApplication.svc/REST/CreateDoctorResponse";
const GET_DOCTOR_NOT_REPLIED_COUNTS =
"Services/DoctorApplication.svc/REST/DoctorApp_GetDoctorNotRepliedCounts";
const ALL_SPECIAL_LAB_RESULT =
"services/Patients.svc/REST/GetPatientLabSpecialResultsALL";
const GET_MEDICATION_FOR_IN_PATIENT =
"Services/DoctorApplication.svc/REST/Doctor_GetMedicationForInpatient";
const GET_EPISODE_FOR_INPATIENT =
"/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient";
///Operation Details Services
const GET_RESERVATIONS =
"Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails";
const GET_OPERATION_DETAILS =
"Services/DoctorApplication.svc/REST/DoctorApp_GetOperationDetails";
const UPDATE_OPERATION_REPORT =
"Services/DoctorApplication.svc/REST/DoctorApp_CreateUpdateOperationReport";
const NURSING_PROGRESS_NOTE =
"Services/DoctorApplication.svc/REST/DoctorApp_GetNursingProgressNote";
const GET_DIAGNOSIS_FOR_IN_PATIENT =
"Services/DoctorApplication.svc/REST/DoctorApp_GetDiagnosisForInPatient";
const GET_DIABETIC_CHART_VALUES =
"Services/DoctorApplication.svc/REST/DoctorApp_GetDiabeticChartValues";
const GET_PENDING_ORDERS =
"Services/DoctorApplication.svc/REST/DoctorApp_GetPendingOrdersForInPatient";
const GET_ADMISSION_ORDERS =
"/Services/DoctorApplication.svc/REST/DoctorApp_GetAdmissionOrders";
///Patient Registration Services
const CHECK_PATIENT_FOR_REGISTRATION =
"Services/Authentication.svc/REST/CheckPatientForRegisteration";
const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION =
"Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration";
const CHECK_ACTIVATION_CODE_FOR_PATIENT =
"Services/Authentication.svc/REST/CheckActivationCode";
const PATIENT_REGISTRATION = "Services/Authentication.svc/REST/PatientRegistration";
const GET_PATIENT_INFO= "Services/NHIC.svc/REST/GetPatientInfo";
/// Discharge Summary
const GET_PENDING_DISCHARGE_SUMMARY = "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary";
var selectedPatientType = 1;
@ -272,14 +428,13 @@ var SERVICES_PATIANT_HEADER_AR = [
"المريض الواصل"
];
var DEVICE_TOKEN = "";
const PRIMARY_COLOR = 0xff515B5D;
const TRANSACTION_NO = 0;
const LANGUAGE_ID = 2;
const STAMP = '2020-04-27T12:17:17.721Z';
const IP_ADDRESS = '9.9.9.9';
const VERSION_ID = 6.1;
const VERSION_ID = 6.4;
const CHANNEL = 9;
const SESSION_ID = 'BlUSkYymTt';
const IS_LOGIN_FOR_DOCTOR_APP = true;
@ -291,6 +446,8 @@ const GENERAL_ID = 'Cs2020@2016\$2958';
const PATIENT_TYPE = 1;
const PATIENT_TYPE_ID = 1;
const Color IN_PROGRESS_COLOR = Color(0xFFCC9B14);
/// Timer Info
const TIMER_MIN = 10;

File diff suppressed because it is too large Load Diff

@ -1,16 +1,16 @@
final TOKEN = 'token';
final PROJECT_ID = 'projectID';
final VIDA_AUTH_TOKEN_ID = 'VidaAuthTokenID';
final VIDA_REFRESH_TOKEN_ID = 'VidaRefreshTokenID';
final LOGIN_TOKEN_ID = 'LogInToken';
final DOCTOR_ID = 'doctorID';
final SLECTED_PATIENT_TYPE = 'slectedPatientType';
final APP_Language = 'language';
final DOCTOR_PROFILE = 'doctorProfile';
final LIVE_CARE_PATIENT = 'livecare-patient-profile';
final LOGGED_IN_USER = 'loggedUser';
final DASHBOARD_DATA = 'dashboard-data';
final OTP_TYPE = 'otp-type';
final LAST_LOGIN_USER = 'last-login-user';
final PASSWORD = 'password';
final CLINIC_NAME = 'clinic-name';
const TOKEN = 'token';
const PROJECT_ID = 'projectID';
const VIDA_AUTH_TOKEN_ID = 'VidaAuthTokenID';
const VIDA_REFRESH_TOKEN_ID = 'VidaRefreshTokenID';
const LOGIN_TOKEN_ID = 'LogInToken';
const DOCTOR_ID = 'doctorID';
const SLECTED_PATIENT_TYPE = 'slectedPatientType';
const APP_Language = 'language';
const DOCTOR_PROFILE = 'doctorProfile';
const LIVE_CARE_PATIENT = 'livecare-patient-profile';
const LOGGED_IN_USER = 'loggedUser';
const EMPLOYEE_ID = 'EmployeeID';
const DASHBOARD_DATA = 'dashboard-data';
const OTP_TYPE = 'otp-type';
const LAST_LOGIN_USER = 'last-login-user';
const CLINIC_NAME = 'clinic-name';

@ -22,7 +22,6 @@ class SizeConfig {
static bool isHeightMiddle = false;
static bool isHeightLarge = false;
static bool isWidthLarge = false;
void init(BoxConstraints constraints, Orientation orientation) {
realScreenHeight = constraints.maxHeight;
realScreenWidth = constraints.maxWidth;
@ -73,9 +72,11 @@ class SizeConfig {
print('widthMultiplier $widthMultiplier');
print('isPortrait $isPortrait');
print('isMobilePortrait $isMobilePortrait');
}
static getTextMultiplierBasedOnWidth({double? width}) {
static getTextMultiplierBasedOnWidth({double width}) {
// TODO handel LandScape case
if (width != null) {
return width / 100;
@ -83,7 +84,7 @@ class SizeConfig {
return widthMultiplier;
}
static getWidthMultiplier({double? width}) {
static getWidthMultiplier({double width}) {
// TODO handel LandScape case
if (width != null) {
return width / 100;

@ -0,0 +1,4 @@
enum CalenderType{
Gregorian,
Hijri,
}

@ -0,0 +1,112 @@
class CheckActivationCodeModel {
int patientMobileNumber;
String mobileNo;
int projectOutSA;
int loginType;
String zipCode;
bool isRegister;
String logInTokenID;
int searchType;
int patientID;
int nationalID;
int patientIdentificationID;
bool forRegisteration;
String activationCode;
double versionID;
int channel;
int languageID;
String iPAdress;
String generalid;
int patientOutSA;
Null sessionID;
bool isDentalAllowedBackend;
int deviceTypeID;
String dOB;
int isHijri;
String healthId;
CheckActivationCodeModel(
{this.patientMobileNumber,
this.mobileNo,
this.projectOutSA,
this.loginType,
this.zipCode,
this.isRegister,
this.logInTokenID,
this.searchType,
this.patientID,
this.nationalID,
this.patientIdentificationID,
this.forRegisteration,
this.activationCode,
this.versionID,
this.channel,
this.languageID,
this.iPAdress,
this.generalid,
this.patientOutSA,
this.sessionID,
this.isDentalAllowedBackend,
this.deviceTypeID,
this.dOB,
this.isHijri,
this.healthId});
CheckActivationCodeModel.fromJson(Map<String, dynamic> json) {
patientMobileNumber = json['PatientMobileNumber'];
mobileNo = json['MobileNo'];
projectOutSA = json['ProjectOutSA'];
loginType = json['LoginType'];
zipCode = json['ZipCode'];
isRegister = json['isRegister'];
logInTokenID = json['LogInTokenID'];
searchType = json['SearchType'];
patientID = json['PatientID'];
nationalID = json['NationalID'];
patientIdentificationID = json['PatientIdentificationID'];
forRegisteration = json['ForRegisteration'];
activationCode = json['activationCode'];
versionID = json['VersionID'];
channel = json['Channel'];
languageID = json['LanguageID'];
iPAdress = json['IPAdress'];
generalid = json['generalid'];
patientOutSA = json['PatientOutSA'];
sessionID = json['SessionID'];
isDentalAllowedBackend = json['isDentalAllowedBackend'];
deviceTypeID = json['DeviceTypeID'];
dOB = json['DOB'];
isHijri = json['IsHijri'];
healthId = json['HealthId'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMobileNumber'] = this.patientMobileNumber;
data['MobileNo'] = this.mobileNo;
data['ProjectOutSA'] = this.projectOutSA;
data['LoginType'] = this.loginType;
data['ZipCode'] = this.zipCode;
data['isRegister'] = this.isRegister;
data['LogInTokenID'] = this.logInTokenID;
data['SearchType'] = this.searchType;
data['PatientID'] = this.patientID;
data['NationalID'] = this.nationalID;
data['PatientIdentificationID'] = this.patientIdentificationID;
data['ForRegisteration'] = this.forRegisteration;
data['activationCode'] = this.activationCode;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress;
data['generalid'] = this.generalid;
data['PatientOutSA'] = this.patientOutSA;
data['SessionID'] = this.sessionID;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['DeviceTypeID'] = this.deviceTypeID;
data['DOB'] = this.dOB;
data['IsHijri'] = this.isHijri;
data['HealthId'] = this.healthId;
return data;
}
}

@ -0,0 +1,80 @@
class CheckPatientForRegistrationModel {
int patientIdentificationID;
int patientMobileNumber;
String zipCode;
double versionID;
int channel;
int languageID;
String iPAdress;
String generalid;
int patientOutSA;
Null sessionID;
bool isDentalAllowedBackend;
int deviceTypeID;
String tokenID;
int patientID;
bool isRegister;
String dOB;
int isHijri;
CheckPatientForRegistrationModel(
{this.patientIdentificationID,
this.patientMobileNumber,
this.zipCode,
this.versionID,
this.channel,
this.languageID,
this.iPAdress,
this.generalid,
this.patientOutSA,
this.sessionID,
this.isDentalAllowedBackend,
this.deviceTypeID,
this.tokenID,
this.patientID,
this.isRegister,
this.dOB,
this.isHijri});
CheckPatientForRegistrationModel.fromJson(Map<String, dynamic> json) {
patientIdentificationID = json['PatientIdentificationID'];
patientMobileNumber = json['PatientMobileNumber'];
zipCode = json['ZipCode'];
versionID = json['VersionID'];
channel = json['Channel'];
languageID = json['LanguageID'];
iPAdress = json['IPAdress'];
generalid = json['generalid'];
patientOutSA = json['PatientOutSA'];
sessionID = json['SessionID'];
isDentalAllowedBackend = json['isDentalAllowedBackend'];
deviceTypeID = json['DeviceTypeID'];
tokenID = json['TokenID'];
patientID = json['PatientID'];
isRegister = json['isRegister'];
dOB = json['DOB'];
isHijri = json['IsHijri'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientIdentificationID'] = this.patientIdentificationID;
data['PatientMobileNumber'] = this.patientMobileNumber;
data['ZipCode'] = this.zipCode;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress;
data['generalid'] = this.generalid;
data['PatientOutSA'] = this.patientOutSA;
data['SessionID'] = this.sessionID;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['DeviceTypeID'] = this.deviceTypeID;
data['TokenID'] = this.tokenID;
data['PatientID'] = this.patientID;
data['isRegister'] = this.isRegister;
data['DOB'] = this.dOB;
data['IsHijri'] = this.isHijri;
return data;
}
}

@ -0,0 +1,60 @@
class GetPatientInfoRequestModel {
String patientIdentificationID;
String dOB;
int isHijri;
double versionID;
int channel;
int languageID;
String iPAdress;
String generalid;
int patientOutSA;
Null sessionID;
bool isDentalAllowedBackend;
int deviceTypeID;
GetPatientInfoRequestModel(
{this.patientIdentificationID,
this.dOB,
this.isHijri,
this.versionID,
this.channel,
this.languageID,
this.iPAdress,
this.generalid,
this.patientOutSA,
this.sessionID,
this.isDentalAllowedBackend,
this.deviceTypeID});
GetPatientInfoRequestModel.fromJson(Map<String, dynamic> json) {
patientIdentificationID = json['PatientIdentificationID'];
dOB = json['DOB'];
isHijri = json['IsHijri'];
versionID = json['VersionID'];
channel = json['Channel'];
languageID = json['LanguageID'];
iPAdress = json['IPAdress'];
generalid = json['generalid'];
patientOutSA = json['PatientOutSA'];
sessionID = json['SessionID'];
isDentalAllowedBackend = json['isDentalAllowedBackend'];
deviceTypeID = json['DeviceTypeID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientIdentificationID'] = this.patientIdentificationID;
data['DOB'] = this.dOB;
data['IsHijri'] = this.isHijri;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress;
data['generalid'] = this.generalid;
data['PatientOutSA'] = this.patientOutSA;
data['SessionID'] = this.sessionID;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['DeviceTypeID'] = this.deviceTypeID;
return data;
}
}

@ -0,0 +1,374 @@
class GetPatientInfoResponseModel {
dynamic date;
int languageID;
int serviceName;
dynamic time;
dynamic androidLink;
dynamic authenticationTokenID;
dynamic data;
bool dataw;
int dietType;
dynamic errorCode;
dynamic errorEndUserMessage;
dynamic errorEndUserMessageN;
dynamic errorMessage;
int errorType;
int foodCategory;
dynamic iOSLink;
bool isAuthenticated;
int mealOrderStatus;
int mealType;
int messageStatus;
int numberOfResultRecords;
dynamic patientBlodType;
dynamic successMsg;
dynamic successMsgN;
dynamic vidaUpdatedResponse;
dynamic accessTokenObject;
int age;
dynamic clientIdentifierId;
int createdBy;
String dateOfBirth;
String firstNameAr;
String firstNameEn;
String gender;
dynamic genderAr;
dynamic genderEn;
String healthId;
String idNumber;
String idType;
bool isHijri;
int isInstertedOrUpdated;
int isNull;
int isPatientExistNHIC;
bool isRecordLockedByCurrentUser;
String lastNameAr;
String lastNameEn;
dynamic listActiveAccessToken;
String maritalStatus;
String maritalStatusCode;
String nationalDateOfBirth;
String nationality;
String nationalityCode;
String occupation;
dynamic pCDTransactionDataResultList;
dynamic pCDGetVidaPatientForManualVerificationList;
dynamic pCDNHICHMGPatientDetailsMatchCalulationList;
int pCDReturnValue;
String patientStatus;
String placeofBirth;
dynamic practitionerStatusCode;
dynamic practitionerStatusDescAr;
dynamic practitionerStatusDescEn;
int rowCount;
String secondNameAr;
String secondNameEn;
String thirdNameAr;
String thirdNameEn;
dynamic yakeenVidaPatientDataStatisticsByPatientIdList;
dynamic yakeenVidaPatientDataStatisticsList;
dynamic yakeenVidaPatientDataStatisticsPrefferedList;
dynamic accessToken;
int categoryCode;
dynamic categoryNameAr;
dynamic categoryNameEn;
int constraintCode;
dynamic constraintNameAr;
dynamic constraintNameEn;
dynamic content;
dynamic errorList;
dynamic licenseExpiryDate;
dynamic licenseIssuedDate;
dynamic licenseStatusCode;
dynamic licenseStatusDescAr;
dynamic licenseStatusDescEn;
dynamic organizations;
dynamic registrationNumber;
int specialtyCode;
dynamic specialtyNameAr;
dynamic specialtyNameEn;
GetPatientInfoResponseModel(
{this.date,
this.languageID,
this.serviceName,
this.time,
this.androidLink,
this.authenticationTokenID,
this.data,
this.dataw,
this.dietType,
this.errorCode,
this.errorEndUserMessage,
this.errorEndUserMessageN,
this.errorMessage,
this.errorType,
this.foodCategory,
this.iOSLink,
this.isAuthenticated,
this.mealOrderStatus,
this.mealType,
this.messageStatus,
this.numberOfResultRecords,
this.patientBlodType,
this.successMsg,
this.successMsgN,
this.vidaUpdatedResponse,
this.accessTokenObject,
this.age,
this.clientIdentifierId,
this.createdBy,
this.dateOfBirth,
this.firstNameAr,
this.firstNameEn,
this.gender,
this.genderAr,
this.genderEn,
this.healthId,
this.idNumber,
this.idType,
this.isHijri,
this.isInstertedOrUpdated,
this.isNull,
this.isPatientExistNHIC,
this.isRecordLockedByCurrentUser,
this.lastNameAr,
this.lastNameEn,
this.listActiveAccessToken,
this.maritalStatus,
this.maritalStatusCode,
this.nationalDateOfBirth,
this.nationality,
this.nationalityCode,
this.occupation,
this.pCDTransactionDataResultList,
this.pCDGetVidaPatientForManualVerificationList,
this.pCDNHICHMGPatientDetailsMatchCalulationList,
this.pCDReturnValue,
this.patientStatus,
this.placeofBirth,
this.practitionerStatusCode,
this.practitionerStatusDescAr,
this.practitionerStatusDescEn,
this.rowCount,
this.secondNameAr,
this.secondNameEn,
this.thirdNameAr,
this.thirdNameEn,
this.yakeenVidaPatientDataStatisticsByPatientIdList,
this.yakeenVidaPatientDataStatisticsList,
this.yakeenVidaPatientDataStatisticsPrefferedList,
this.accessToken,
this.categoryCode,
this.categoryNameAr,
this.categoryNameEn,
this.constraintCode,
this.constraintNameAr,
this.constraintNameEn,
this.content,
this.errorList,
this.licenseExpiryDate,
this.licenseIssuedDate,
this.licenseStatusCode,
this.licenseStatusDescAr,
this.licenseStatusDescEn,
this.organizations,
this.registrationNumber,
this.specialtyCode,
this.specialtyNameAr,
this.specialtyNameEn});
GetPatientInfoResponseModel.fromJson(Map<String, dynamic> json) {
date = json['Date'];
languageID = json['LanguageID'];
serviceName = json['ServiceName'];
time = json['Time'];
androidLink = json['AndroidLink'];
authenticationTokenID = json['AuthenticationTokenID'];
data = json['Data'];
dataw = json['Dataw'];
dietType = json['DietType'];
errorCode = json['ErrorCode'];
errorEndUserMessage = json['ErrorEndUserMessage'];
errorEndUserMessageN = json['ErrorEndUserMessageN'];
errorMessage = json['ErrorMessage'];
errorType = json['ErrorType'];
foodCategory = json['FoodCategory'];
iOSLink = json['IOSLink'];
isAuthenticated = json['IsAuthenticated'];
mealOrderStatus = json['MealOrderStatus'];
mealType = json['MealType'];
messageStatus = json['MessageStatus'];
numberOfResultRecords = json['NumberOfResultRecords'];
patientBlodType = json['PatientBlodType'];
successMsg = json['SuccessMsg'];
successMsgN = json['SuccessMsgN'];
vidaUpdatedResponse = json['VidaUpdatedResponse'];
accessTokenObject = json['AccessTokenObject'];
age = json['Age'];
clientIdentifierId = json['ClientIdentifierId'];
createdBy = json['CreatedBy'];
dateOfBirth = json['DateOfBirth'];
firstNameAr = json['FirstNameAr'];
firstNameEn = json['FirstNameEn'];
gender = json['Gender'];
genderAr = json['GenderAr'];
genderEn = json['GenderEn'];
healthId = json['HealthId'];
idNumber = json['IdNumber'];
idType = json['IdType'];
isHijri = json['IsHijri'];
isInstertedOrUpdated = json['IsInstertedOrUpdated'];
isNull = json['IsNull'];
isPatientExistNHIC = json['IsPatientExistNHIC'];
isRecordLockedByCurrentUser = json['IsRecordLockedByCurrentUser'];
lastNameAr = json['LastNameAr'];
lastNameEn = json['LastNameEn'];
listActiveAccessToken = json['List_ActiveAccessToken'];
maritalStatus = json['MaritalStatus'];
maritalStatusCode = json['MaritalStatusCode'];
nationalDateOfBirth = json['NationalDateOfBirth'];
nationality = json['Nationality'];
nationalityCode = json['NationalityCode'];
occupation = json['Occupation'];
pCDTransactionDataResultList = json['PCDTransactionDataResultList'];
pCDGetVidaPatientForManualVerificationList =
json['PCD_GetVidaPatientForManualVerificationList'];
pCDNHICHMGPatientDetailsMatchCalulationList =
json['PCD_NHIC_HMG_PatientDetailsMatchCalulationList'];
pCDReturnValue = json['PCD_ReturnValue'];
patientStatus = json['PatientStatus'];
placeofBirth = json['PlaceofBirth'];
practitionerStatusCode = json['PractitionerStatusCode'];
practitionerStatusDescAr = json['PractitionerStatusDescAr'];
practitionerStatusDescEn = json['PractitionerStatusDescEn'];
rowCount = json['RowCount'];
secondNameAr = json['SecondNameAr'];
secondNameEn = json['SecondNameEn'];
thirdNameAr = json['ThirdNameAr'];
thirdNameEn = json['ThirdNameEn'];
yakeenVidaPatientDataStatisticsByPatientIdList =
json['YakeenVidaPatientDataStatisticsByPatientIdList'];
yakeenVidaPatientDataStatisticsList =
json['YakeenVidaPatientDataStatisticsList'];
yakeenVidaPatientDataStatisticsPrefferedList =
json['YakeenVidaPatientDataStatisticsPrefferedList'];
accessToken = json['accessToken'];
categoryCode = json['categoryCode'];
categoryNameAr = json['categoryNameAr'];
categoryNameEn = json['categoryNameEn'];
constraintCode = json['constraintCode'];
constraintNameAr = json['constraintNameAr'];
constraintNameEn = json['constraintNameEn'];
content = json['content'];
errorList = json['errorList'];
licenseExpiryDate = json['licenseExpiryDate'];
licenseIssuedDate = json['licenseIssuedDate'];
licenseStatusCode = json['licenseStatusCode'];
licenseStatusDescAr = json['licenseStatusDescAr'];
licenseStatusDescEn = json['licenseStatusDescEn'];
organizations = json['organizations'];
registrationNumber = json['registrationNumber'];
specialtyCode = json['specialtyCode'];
specialtyNameAr = json['specialtyNameAr'];
specialtyNameEn = json['specialtyNameEn'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Date'] = this.date;
data['LanguageID'] = this.languageID;
data['ServiceName'] = this.serviceName;
data['Time'] = this.time;
data['AndroidLink'] = this.androidLink;
data['AuthenticationTokenID'] = this.authenticationTokenID;
data['Data'] = this.data;
data['Dataw'] = this.dataw;
data['DietType'] = this.dietType;
data['ErrorCode'] = this.errorCode;
data['ErrorEndUserMessage'] = this.errorEndUserMessage;
data['ErrorEndUserMessageN'] = this.errorEndUserMessageN;
data['ErrorMessage'] = this.errorMessage;
data['ErrorType'] = this.errorType;
data['FoodCategory'] = this.foodCategory;
data['IOSLink'] = this.iOSLink;
data['IsAuthenticated'] = this.isAuthenticated;
data['MealOrderStatus'] = this.mealOrderStatus;
data['MealType'] = this.mealType;
data['MessageStatus'] = this.messageStatus;
data['NumberOfResultRecords'] = this.numberOfResultRecords;
data['PatientBlodType'] = this.patientBlodType;
data['SuccessMsg'] = this.successMsg;
data['SuccessMsgN'] = this.successMsgN;
data['VidaUpdatedResponse'] = this.vidaUpdatedResponse;
data['AccessTokenObject'] = this.accessTokenObject;
data['Age'] = this.age;
data['ClientIdentifierId'] = this.clientIdentifierId;
data['CreatedBy'] = this.createdBy;
data['DateOfBirth'] = this.dateOfBirth;
data['FirstNameAr'] = this.firstNameAr;
data['FirstNameEn'] = this.firstNameEn;
data['Gender'] = this.gender;
data['GenderAr'] = this.genderAr;
data['GenderEn'] = this.genderEn;
data['HealthId'] = this.healthId;
data['IdNumber'] = this.idNumber;
data['IdType'] = this.idType;
data['IsHijri'] = this.isHijri;
data['IsInstertedOrUpdated'] = this.isInstertedOrUpdated;
data['IsNull'] = this.isNull;
data['IsPatientExistNHIC'] = this.isPatientExistNHIC;
data['IsRecordLockedByCurrentUser'] = this.isRecordLockedByCurrentUser;
data['LastNameAr'] = this.lastNameAr;
data['LastNameEn'] = this.lastNameEn;
data['List_ActiveAccessToken'] = this.listActiveAccessToken;
data['MaritalStatus'] = this.maritalStatus;
data['MaritalStatusCode'] = this.maritalStatusCode;
data['NationalDateOfBirth'] = this.nationalDateOfBirth;
data['Nationality'] = this.nationality;
data['NationalityCode'] = this.nationalityCode;
data['Occupation'] = this.occupation;
data['PCDTransactionDataResultList'] = this.pCDTransactionDataResultList;
data['PCD_GetVidaPatientForManualVerificationList'] =
this.pCDGetVidaPatientForManualVerificationList;
data['PCD_NHIC_HMG_PatientDetailsMatchCalulationList'] =
this.pCDNHICHMGPatientDetailsMatchCalulationList;
data['PCD_ReturnValue'] = this.pCDReturnValue;
data['PatientStatus'] = this.patientStatus;
data['PlaceofBirth'] = this.placeofBirth;
data['PractitionerStatusCode'] = this.practitionerStatusCode;
data['PractitionerStatusDescAr'] = this.practitionerStatusDescAr;
data['PractitionerStatusDescEn'] = this.practitionerStatusDescEn;
data['RowCount'] = this.rowCount;
data['SecondNameAr'] = this.secondNameAr;
data['SecondNameEn'] = this.secondNameEn;
data['ThirdNameAr'] = this.thirdNameAr;
data['ThirdNameEn'] = this.thirdNameEn;
data['YakeenVidaPatientDataStatisticsByPatientIdList'] =
this.yakeenVidaPatientDataStatisticsByPatientIdList;
data['YakeenVidaPatientDataStatisticsList'] =
this.yakeenVidaPatientDataStatisticsList;
data['YakeenVidaPatientDataStatisticsPrefferedList'] =
this.yakeenVidaPatientDataStatisticsPrefferedList;
data['accessToken'] = this.accessToken;
data['categoryCode'] = this.categoryCode;
data['categoryNameAr'] = this.categoryNameAr;
data['categoryNameEn'] = this.categoryNameEn;
data['constraintCode'] = this.constraintCode;
data['constraintNameAr'] = this.constraintNameAr;
data['constraintNameEn'] = this.constraintNameEn;
data['content'] = this.content;
data['errorList'] = this.errorList;
data['licenseExpiryDate'] = this.licenseExpiryDate;
data['licenseIssuedDate'] = this.licenseIssuedDate;
data['licenseStatusCode'] = this.licenseStatusCode;
data['licenseStatusDescAr'] = this.licenseStatusDescAr;
data['licenseStatusDescEn'] = this.licenseStatusDescEn;
data['organizations'] = this.organizations;
data['registrationNumber'] = this.registrationNumber;
data['specialtyCode'] = this.specialtyCode;
data['specialtyNameAr'] = this.specialtyNameAr;
data['specialtyNameEn'] = this.specialtyNameEn;
return data;
}
}

@ -0,0 +1,185 @@
class PatientRegistrationModel {
Patientobject patientobject;
String patientIdentificationID;
String patientMobileNumber;
String logInTokenID;
double versionID;
int channel;
int languageID;
String iPAdress;
String generalid;
int patientOutSA;
Null sessionID;
bool isDentalAllowedBackend;
int deviceTypeID;
String tokenID;
String dOB;
int isHijri;
String healthId;
String zipCode;
PatientRegistrationModel(
{this.patientobject,
this.patientIdentificationID,
this.patientMobileNumber,
this.logInTokenID,
this.versionID,
this.channel,
this.languageID,
this.iPAdress,
this.generalid,
this.patientOutSA,
this.sessionID,
this.isDentalAllowedBackend,
this.deviceTypeID,
this.tokenID,
this.dOB,
this.isHijri,
this.healthId,
this.zipCode});
PatientRegistrationModel.fromJson(Map<String, dynamic> json) {
patientobject = json['Patientobject'] != null
? new Patientobject.fromJson(json['Patientobject'])
: null;
patientIdentificationID = json['PatientIdentificationID'];
patientMobileNumber = json['PatientMobileNumber'];
logInTokenID = json['LogInTokenID'];
versionID = json['VersionID'];
channel = json['Channel'];
languageID = json['LanguageID'];
iPAdress = json['IPAdress'];
generalid = json['generalid'];
patientOutSA = json['PatientOutSA'];
sessionID = json['SessionID'];
isDentalAllowedBackend = json['isDentalAllowedBackend'];
deviceTypeID = json['DeviceTypeID'];
tokenID = json['TokenID'];
dOB = json['DOB'];
isHijri = json['IsHijri'];
healthId = json['HealthId'];
zipCode = json['ZipCode'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.patientobject != null) {
data['Patientobject'] = this.patientobject.toJson();
}
data['PatientIdentificationID'] = this.patientIdentificationID;
data['PatientMobileNumber'] = this.patientMobileNumber;
data['LogInTokenID'] = this.logInTokenID;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress;
data['generalid'] = this.generalid;
data['PatientOutSA'] = this.patientOutSA;
data['SessionID'] = this.sessionID;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['DeviceTypeID'] = this.deviceTypeID;
data['TokenID'] = this.tokenID;
data['DOB'] = this.dOB;
data['IsHijri'] = this.isHijri;
data['HealthId'] = this.healthId;
data['ZipCode'] = this.zipCode;
return data;
}
}
class Patientobject {
bool tempValue;
int patientIdentificationType;
String patientIdentificationNo;
int mobileNumber;
int patientOutSA;
String firstNameN;
String middleNameN;
String lastNameN;
String firstName;
String middleName;
String lastName;
String strDateofBirth;
String dateofBirth;
int gender;
String nationalityID;
String dateofBirthN;
String emailAddress;
String sourceType;
String preferredLanguage;
String marital;
String eHealthIDField;
Patientobject(
{this.tempValue,
this.patientIdentificationType,
this.patientIdentificationNo,
this.mobileNumber,
this.patientOutSA,
this.firstNameN,
this.middleNameN,
this.lastNameN,
this.firstName,
this.middleName,
this.lastName,
this.strDateofBirth,
this.dateofBirth,
this.gender,
this.nationalityID,
this.dateofBirthN,
this.emailAddress,
this.sourceType,
this.preferredLanguage,
this.marital,
this.eHealthIDField});
Patientobject.fromJson(Map<String, dynamic> json) {
tempValue = json['TempValue'];
patientIdentificationType = json['PatientIdentificationType'];
patientIdentificationNo = json['PatientIdentificationNo'];
mobileNumber = json['MobileNumber'];
patientOutSA = json['PatientOutSA'];
firstNameN = json['FirstNameN'];
middleNameN = json['MiddleNameN'];
lastNameN = json['LastNameN'];
firstName = json['FirstName'];
middleName = json['MiddleName'];
lastName = json['LastName'];
strDateofBirth = json['StrDateofBirth'];
dateofBirth = json['DateofBirth'];
gender = json['Gender'];
nationalityID = json['NationalityID'];
dateofBirthN = json['DateofBirthN'];
emailAddress = json['EmailAddress'];
sourceType = json['SourceType'];
preferredLanguage = json['PreferredLanguage'];
marital = json['Marital'];
eHealthIDField = json['eHealthIDField'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['TempValue'] = this.tempValue;
data['PatientIdentificationType'] = this.patientIdentificationType;
data['PatientIdentificationNo'] = this.patientIdentificationNo;
data['MobileNumber'] = this.mobileNumber;
data['PatientOutSA'] = this.patientOutSA;
data['FirstNameN'] = this.firstNameN;
data['MiddleNameN'] = this.middleNameN;
data['LastNameN'] = this.lastNameN;
data['FirstName'] = this.firstName;
data['MiddleName'] = this.middleName;
data['LastName'] = this.lastName;
data['StrDateofBirth'] = this.strDateofBirth;
data['DateofBirth'] = this.dateofBirth;
data['Gender'] = this.gender;
data['NationalityID'] = this.nationalityID;
data['DateofBirthN'] = this.dateofBirthN;
data['EmailAddress'] = this.emailAddress;
data['SourceType'] = this.sourceType;
data['PreferredLanguage'] = this.preferredLanguage;
data['Marital'] = this.marital;
data['eHealthIDField'] = this.eHealthIDField;
return data;
}
}

@ -0,0 +1,109 @@
class SendActivationCodeByOTPNotificationTypeForRegistrationModel {
int patientMobileNumber;
String mobileNo;
int projectOutSA;
int loginType;
String zipCode;
bool isRegister;
String logInTokenID;
int searchType;
int patientID;
int nationalID;
int patientIdentificationID;
int oTPSendType;
int languageID;
double versionID;
int channel;
String iPAdress;
String generalid;
int patientOutSA;
Null sessionID;
bool isDentalAllowedBackend;
int deviceTypeID;
String dOB;
int isHijri;
String healthId;
SendActivationCodeByOTPNotificationTypeForRegistrationModel(
{this.patientMobileNumber,
this.mobileNo,
this.projectOutSA,
this.loginType,
this.zipCode,
this.isRegister,
this.logInTokenID,
this.searchType,
this.patientID,
this.nationalID,
this.patientIdentificationID,
this.oTPSendType,
this.languageID,
this.versionID,
this.channel,
this.iPAdress,
this.generalid,
this.patientOutSA,
this.sessionID,
this.isDentalAllowedBackend,
this.deviceTypeID,
this.dOB,
this.isHijri,
this.healthId});
SendActivationCodeByOTPNotificationTypeForRegistrationModel.fromJson(
Map<String, dynamic> json) {
patientMobileNumber = json['PatientMobileNumber'];
mobileNo = json['MobileNo'];
projectOutSA = json['ProjectOutSA'];
loginType = json['LoginType'];
zipCode = json['ZipCode'];
isRegister = json['isRegister'];
logInTokenID = json['LogInTokenID'];
searchType = json['SearchType'];
patientID = json['PatientID'];
nationalID = json['NationalID'];
patientIdentificationID = json['PatientIdentificationID'];
oTPSendType = json['OTP_SendType'];
languageID = json['LanguageID'];
versionID = json['VersionID'];
channel = json['Channel'];
iPAdress = json['IPAdress'];
generalid = json['generalid'];
patientOutSA = json['PatientOutSA'];
sessionID = json['SessionID'];
isDentalAllowedBackend = json['isDentalAllowedBackend'];
deviceTypeID = json['DeviceTypeID'];
dOB = json['DOB'];
isHijri = json['IsHijri'];
healthId = json['HealthId'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMobileNumber'] = this.patientMobileNumber;
data['MobileNo'] = this.mobileNo;
data['ProjectOutSA'] = this.projectOutSA;
data['LoginType'] = this.loginType;
data['ZipCode'] = this.zipCode;
data['isRegister'] = this.isRegister;
data['LogInTokenID'] = this.logInTokenID;
data['SearchType'] = this.searchType;
data['PatientID'] = this.patientID;
data['NationalID'] = this.nationalID;
data['PatientIdentificationID'] = this.patientIdentificationID;
data['OTP_SendType'] = this.oTPSendType;
data['LanguageID'] = this.languageID;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['IPAdress'] = this.iPAdress;
data['generalid'] = this.generalid;
data['PatientOutSA'] = this.patientOutSA;
data['SessionID'] = this.sessionID;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['DeviceTypeID'] = this.deviceTypeID;
data['DOB'] = this.dOB;
data['IsHijri'] = this.isHijri;
data['HealthId'] = this.healthId;
return data;
}
}

@ -0,0 +1,157 @@
class GetMedicationForInPatientModel {
String setupID;
int projectID;
int admissionNo;
int patientID;
int orderNo;
int prescriptionNo;
int lineItemNo;
String prescriptionDatetime;
int itemID;
int directionID;
int refillID;
String dose;
int unitofMeasurement;
String startDatetime;
String stopDatetime;
int noOfDoses;
int routeId;
String comments;
int reviewedPharmacist;
dynamic reviewedPharmacistDatetime;
dynamic discountinueDatetime;
dynamic rescheduleDatetime;
int status;
String statusDescription;
int createdBy;
String createdOn;
dynamic editedBy;
dynamic editedOn;
dynamic strength;
String pHRItemDescription;
String pHRItemDescriptionN;
String doctorName;
String uomDescription;
String routeDescription;
String directionDescription;
String refillDescription;
GetMedicationForInPatientModel(
{this.setupID,
this.projectID,
this.admissionNo,
this.patientID,
this.orderNo,
this.prescriptionNo,
this.lineItemNo,
this.prescriptionDatetime,
this.itemID,
this.directionID,
this.refillID,
this.dose,
this.unitofMeasurement,
this.startDatetime,
this.stopDatetime,
this.noOfDoses,
this.routeId,
this.comments,
this.reviewedPharmacist,
this.reviewedPharmacistDatetime,
this.discountinueDatetime,
this.rescheduleDatetime,
this.status,
this.statusDescription,
this.createdBy,
this.createdOn,
this.editedBy,
this.editedOn,
this.strength,
this.pHRItemDescription,
this.pHRItemDescriptionN,
this.doctorName,
this.uomDescription,
this.routeDescription,
this.directionDescription,
this.refillDescription});
GetMedicationForInPatientModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
projectID = json['ProjectID'];
doctorName = json['DoctorName'];
refillDescription = json['RefillDescription'];
directionDescription = json['DirectionDescription'];
routeDescription = json['RouteDescription'];
uomDescription = json['UOMDescription'];
admissionNo = json['AdmissionNo'];
patientID = json['PatientID'];
orderNo = json['OrderNo'];
prescriptionNo = json['PrescriptionNo'];
lineItemNo = json['LineItemNo'];
prescriptionDatetime = json['PrescriptionDatetime'];
itemID = json['ItemID'];
directionID = json['DirectionID'];
refillID = json['RefillID'];
dose = json['Dose'];
unitofMeasurement = json['UnitofMeasurement'];
startDatetime = json['StartDatetime'];
stopDatetime = json['StopDatetime'];
noOfDoses = json['NoOfDoses'];
routeId = json['RouteId'];
comments = json['Comments'];
reviewedPharmacist = json['ReviewedPharmacist'];
reviewedPharmacistDatetime = json['ReviewedPharmacistDatetime'];
discountinueDatetime = json['DiscountinueDatetime'];
rescheduleDatetime = json['RescheduleDatetime'];
status = json['Status'];
statusDescription = json['StatusDescription'];
createdBy = json['CreatedBy'];
createdOn = json['CreatedOn'];
editedBy = json['EditedBy'];
editedOn = json['EditedOn'];
strength = json['Strength'];
pHRItemDescription = json['PHRItemDescription'];
pHRItemDescriptionN = json['PHRItemDescriptionN'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['DoctorName'] = this.doctorName;
data['RefillDescription'] = this.refillDescription;
data['RouteDescription'] = this.routeDescription;
data['DirectionDescription'] = this.directionDescription;
data['UOMDescription'] = this.uomDescription;
data['ProjectID'] = this.projectID;
data['AdmissionNo'] = this.admissionNo;
data['PatientID'] = this.patientID;
data['OrderNo'] = this.orderNo;
data['PrescriptionNo'] = this.prescriptionNo;
data['LineItemNo'] = this.lineItemNo;
data['PrescriptionDatetime'] = this.prescriptionDatetime;
data['ItemID'] = this.itemID;
data['DirectionID'] = this.directionID;
data['RefillID'] = this.refillID;
data['Dose'] = this.dose;
data['UnitofMeasurement'] = this.unitofMeasurement;
data['StartDatetime'] = this.startDatetime;
data['StopDatetime'] = this.stopDatetime;
data['NoOfDoses'] = this.noOfDoses;
data['RouteId'] = this.routeId;
data['Comments'] = this.comments;
data['ReviewedPharmacist'] = this.reviewedPharmacist;
data['ReviewedPharmacistDatetime'] = this.reviewedPharmacistDatetime;
data['DiscountinueDatetime'] = this.discountinueDatetime;
data['RescheduleDatetime'] = this.rescheduleDatetime;
data['Status'] = this.status;
data['StatusDescription'] = this.statusDescription;
data['CreatedBy'] = this.createdBy;
data['CreatedOn'] = this.createdOn;
data['EditedBy'] = this.editedBy;
data['EditedOn'] = this.editedOn;
data['Strength'] = this.strength;
data['PHRItemDescription'] = this.pHRItemDescription;
data['PHRItemDescriptionN'] = this.pHRItemDescriptionN;
return data;
}
}

@ -0,0 +1,60 @@
class GetMedicationForInPatientRequestModel {
bool isDentalAllowedBackend;
double versionID;
int channel;
int languageID;
String iPAdress;
String generalid;
int deviceTypeID;
String tokenID;
int patientID;
int admissionNo;
String sessionID;
int projectID;
GetMedicationForInPatientRequestModel(
{this.isDentalAllowedBackend,
this.versionID,
this.channel,
this.languageID,
this.iPAdress,
this.generalid,
this.deviceTypeID,
this.tokenID,
this.patientID,
this.admissionNo,
this.sessionID,
this.projectID});
GetMedicationForInPatientRequestModel.fromJson(Map<String, dynamic> json) {
isDentalAllowedBackend = json['isDentalAllowedBackend'];
versionID = json['VersionID'];
channel = json['Channel'];
languageID = json['LanguageID'];
iPAdress = json['IPAdress'];
generalid = json['generalid'];
deviceTypeID = json['DeviceTypeID'];
tokenID = json['TokenID'];
patientID = json['PatientID'];
admissionNo = json['AdmissionNo'];
sessionID = json['SessionID'];
projectID = json['ProjectID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress;
data['generalid'] = this.generalid;
data['DeviceTypeID'] = this.deviceTypeID;
data['TokenID'] = this.tokenID;
data['PatientID'] = this.patientID;
data['AdmissionNo'] = this.admissionNo;
data['SessionID'] = this.sessionID;
data['ProjectID'] = this.projectID;
return data;
}
}

@ -1,13 +1,13 @@
class PrescriptionReport {
String ? address;
int ? appointmentNo;
String? clinic;
String ?companyName;
int ?days;
String ?doctorName;
String? address;
dynamic? appodynamicmentNo;
String? clinic;
String? companyName;
dynamic? days;
String? doctorName;
var doseDailyQuantity;
String? frequency;
int ?frequencyNumber;
dynamic? frequencyNumber;
String? image;
String? imageExtension;
String? imageSRCUrl;
@ -15,38 +15,38 @@ class PrescriptionReport {
String? imageThumbUrl;
String? isCovered;
String? itemDescription;
int? itemID;
dynamic? itemID;
String? orderDate;
int ?patientID;
String ?patientName;
String ?phoneOffice1;
String ?prescriptionQR;
int ?prescriptionTimes;
dynamic? patientID;
String? patientName;
String? phoneOffice1;
String? prescriptionQR;
dynamic? prescriptionTimes;
String? productImage;
String? productImageBase64;
String? productImageString;
int? projectID;
String?projectName;
String?remarks;
String?route;
String?sKU;
int ?scaleOffset;
dynamic? projectID;
String? projectName;
String? remarks;
String? route;
String? sKU;
dynamic? scaleOffset;
String? startDate;
String ? patientAge;
String ? patientGender;
String ? phoneOffice;
int ?doseTimingID;
int ?frequencyID;
int ?routeID;
String ? name;
String ? itemDescriptionN;
String ? routeN;
String ? frequencyN;
String? patientAge;
String? patientGender;
String? phoneOffice;
dynamic? doseTimingID;
dynamic? frequencyID;
dynamic? routeID;
String? name;
String? itemDescriptionN;
String? routeN;
String? frequencyN;
PrescriptionReport({
this.address,
this.appointmentNo,
this.appodynamicmentNo,
this.clinic,
this.companyName,
this.days,
@ -92,7 +92,7 @@ class PrescriptionReport {
PrescriptionReport.fromJson(Map<String, dynamic> json) {
address = json['Address'];
appointmentNo = json['AppointmentNo'];
appodynamicmentNo = json['AppodynamicmentNo'];
clinic = json['Clinic'];
companyName = json['CompanyName'];
days = json['Days'];
@ -141,7 +141,7 @@ class PrescriptionReport {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Address'] = this.address;
data['AppointmentNo'] = this.appointmentNo;
data['AppodynamicmentNo'] = this.appodynamicmentNo;
data['Clinic'] = this.clinic;
data['CompanyName'] = this.companyName;
data['Days'] = this.days;

@ -1,5 +1,6 @@
class PrescriptionReportEnh {
String ? address;
dynamic appodynamicmentNo;
int ? appointmentNo;
String ? clinic;
dynamic companyName;
@ -15,27 +16,27 @@ class PrescriptionReportEnh {
String ? imageThumbUrl;
String ? isCovered;
String ? itemDescription;
int ? itemID;
dynamic ? itemID;
String ? orderDate;
int ? patientID;
dynamic ? patientID;
String ? patientName;
String ? phoneOffice1;
dynamic prescriptionQR;
int ? prescriptionTimes;
dynamic ? prescriptionTimes;
dynamic productImage;
dynamic productImageBase64;
String ? productImageString;
int ? projectID;
dynamic ? projectID;
String ? projectName;
String ? remarks;
String ? route;
String ? sKU;
int ? scaleOffset;
dynamic ? scaleOffset;
String ? startDate;
PrescriptionReportEnh(
{this.address,
this.appointmentNo,
this.appodynamicmentNo,
this.clinic,
this.companyName,
this.days,
@ -70,7 +71,7 @@ class PrescriptionReportEnh {
PrescriptionReportEnh.fromJson(Map<String, dynamic> json) {
address = json['Address'];
appointmentNo = json['AppointmentNo'];
appodynamicmentNo = json['AppodynamicmentNo'];
clinic = json['Clinic'];
companyName = json['CompanyName'];
days = json['Days'];
@ -107,7 +108,7 @@ class PrescriptionReportEnh {
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Address'] = this.address;
data['AppointmentNo'] = this.appointmentNo;
data['AppodynamicmentNo'] = this.appodynamicmentNo;
data['Clinic'] = this.clinic;
data['CompanyName'] = this.companyName;
data['Days'] = this.days;

@ -1,52 +1,43 @@
class ActivationCodeModel {
late String? mobileNumber;
late String? zipCode;
late int? channel;
late int? loginDoctorID;
late int? languageID;
late double? versionID;
late int? memberID;
late String? password;
late int? facilityId;
late String? generalid;
late String? otpSendType;
ActivationCodeModel(
{this.mobileNumber,
this.zipCode,
this.channel,
{this.channel,
this.languageID,
this.versionID,
this.memberID,
this.password,
this.facilityId,
this.otpSendType,
this.generalid});
this.generalid,this.loginDoctorID});
ActivationCodeModel.fromJson(Map<String, dynamic> json) {
mobileNumber = json['MobileNumber'];
zipCode = json['ZipCode'];
channel = json['Channel'];
languageID = json['LanguageID'];
versionID = json['VersionID'];
memberID = json['MemberID'];
password = json['Password'];
facilityId = json['facilityId'];
otpSendType = json['OTP_SendType'];
generalid = json['generalid'];
loginDoctorID = json['LoginDoctorID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['MobileNumber'] = this.mobileNumber;
data['ZipCode'] = this.zipCode;
data['Channel'] = this.channel;
data['LanguageID'] = this.languageID;
data['VersionID'] = this.versionID;
data['MemberID'] = this.memberID;
data['Password'] = this.password;
data['facilityId'] = this.facilityId;
data['OTP_SendType'] = otpSendType;
data['generalid'] = this.generalid;
data['LoginDoctorID'] = this.loginDoctorID;
return data;
}
}

@ -3,6 +3,7 @@ class ActivationCodeForVerificationScreenModel {
late String? mobileNumber;
late String? zipCode;
late int? channel;
late int? loginDoctorID;
late int? languageID;
late double? versionID;
late int? memberID;
@ -26,7 +27,7 @@ class ActivationCodeForVerificationScreenModel {
this.isMobileFingerPrint,
this.vidaAuthTokenID,
this.vidaRefreshTokenID,
this.iMEI});
this.iMEI,this.loginDoctorID});
ActivationCodeForVerificationScreenModel.fromJson(Map<String, dynamic> json) {
oTPSendType = json['OTP_SendType'];
@ -42,6 +43,7 @@ class ActivationCodeForVerificationScreenModel {
vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID'];
iMEI = json['IMEI'];
loginDoctorID = json['LoginDoctorID'];
}
Map<String, dynamic> toJson() {
@ -56,9 +58,8 @@ class ActivationCodeForVerificationScreenModel {
data['facilityId'] = this.facilityId;
data['generalid'] = this.generalid;
data['IsMobileFingerPrint'] = this.isMobileFingerPrint;
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
data['IMEI'] = this.iMEI;
data['LoginDoctorID'] = this.loginDoctorID;
return data;
}
}

@ -5,9 +5,14 @@ class CheckActivationCodeForDoctorAppResponseModel {
late List<ListDoctorsClinic>? listDoctorsClinic;
List<DoctorProfileModel>? listDoctorProfile;
late MemberInformation? memberInformation;
String vidaAuthTokenID;
String vidaRefreshTokenID;
CheckActivationCodeForDoctorAppResponseModel(
{this.authenticationTokenID, this.listDoctorsClinic, this.memberInformation});
{this.authenticationTokenID, this.listDoctorsClinic, this.memberInformation,
this.listDoctorProfile,
this.vidaAuthTokenID,
this.vidaRefreshTokenID});
CheckActivationCodeForDoctorAppResponseModel.fromJson(Map<String, dynamic> json) {
authenticationTokenID = json['AuthenticationTokenID'];
@ -24,6 +29,8 @@ class CheckActivationCodeForDoctorAppResponseModel {
listDoctorProfile!.add(new DoctorProfileModel.fromJson(v));
});
}
vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID'];
memberInformation =
json['memberInformation'] != null ? new MemberInformation.fromJson(json['memberInformation']) : null;

@ -1,19 +1,24 @@
class CheckActivationCodeRequestModel {
late String? mobileNumber;
late String? zipCode;
late int? doctorID;
late String? iPAdress;
late int? channel;
late int? languageID;
late int? projectID;
late double? versionID;
late String? generalid;
late String? logInTokenID;
late String? activationCode;
late String? vidaAuthTokenID;
late String? vidaRefreshTokenID;
late int? oTPSendType;
String? mobileNumber;
String? zipCode;
int? doctorID;
int? memberID;
int? loginDoctorID;
String? password;
String? facilityId;
String? iPAdress;
int? channel;
int? languageID;
int? projectID;
double? versionID;
String? generalid;
String? logInTokenID;
String? activationCode;
String? vidaAuthTokenID;
String? vidaRefreshTokenID;
String? iMEI;
bool? isForSilentLogin;
int? oTPSendType;
CheckActivationCodeRequestModel(
{this.mobileNumber,
this.zipCode,
@ -28,7 +33,7 @@ class CheckActivationCodeRequestModel {
this.activationCode,
this.vidaAuthTokenID,
this.vidaRefreshTokenID,
this.oTPSendType});
this.oTPSendType,this.password,this.facilityId,this.memberID,this.isForSilentLogin=false,this.iMEI,this.loginDoctorID});
CheckActivationCodeRequestModel.fromJson(Map<String, dynamic> json) {
mobileNumber = json['MobileNumber'];
@ -45,6 +50,7 @@ class CheckActivationCodeRequestModel {
vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID'];
oTPSendType = json['OTP_SendType'];
loginDoctorID = json['LoginDoctorID'];
}
Map<String, dynamic> toJson() {
@ -63,6 +69,12 @@ class CheckActivationCodeRequestModel {
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
data['OTP_SendType'] = this.oTPSendType;
data['facilityId'] = this.facilityId;
data['MemberID'] = this.memberID;
data['Password'] = this.password;
data['IMEI'] = this.iMEI;
data['IsForSilentLogin'] = this.isForSilentLogin;
data['LoginDoctorID'] = this.loginDoctorID;
return data;
}
}

@ -0,0 +1,21 @@
class DiabeticType {
int value;
String nameEn;
String nameAr;
DiabeticType({this.value, this.nameEn, this.nameAr});
DiabeticType.fromJson(Map<String, dynamic> json) {
value = json['value'];
nameEn = json['nameEn'];
nameAr = json['nameAr'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['value'] = this.value;
data['nameEn'] = this.nameEn;
data['nameAr'] = this.nameAr;
return data;
}
}

@ -0,0 +1,44 @@
class GetDiabeticChartValuesRequestModel {
int deviceTypeID;
int patientID;
int resultType;
int admissionNo;
String setupID;
bool patientOutSA;
int patientType;
int patientTypeID;
GetDiabeticChartValuesRequestModel(
{this.deviceTypeID,
this.patientID,
this.resultType,
this.admissionNo,
this.setupID,
this.patientOutSA,
this.patientType,
this.patientTypeID});
GetDiabeticChartValuesRequestModel.fromJson(Map<String, dynamic> json) {
deviceTypeID = json['DeviceTypeID'];
patientID = json['PatientID'];
resultType = json['ResultType'];
admissionNo = json['AdmissionNo'];
setupID = json['SetupID'];
patientOutSA = json['PatientOutSA'];
patientType = json['PatientType'];
patientTypeID = json['PatientTypeID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['DeviceTypeID'] = this.deviceTypeID;
data['PatientID'] = this.patientID;
data['ResultType'] = this.resultType;
data['AdmissionNo'] = this.admissionNo;
data['SetupID'] = this.setupID;
data['PatientOutSA'] = this.patientOutSA;
data['PatientType'] = this.patientType;
data['PatientTypeID'] = this.patientTypeID;
return data;
}
}

@ -0,0 +1,36 @@
class GetDiabeticChartValuesResponseModel {
String resultType;
int admissionNo;
String dateChart;
int resultValue;
int createdBy;
String createdOn;
GetDiabeticChartValuesResponseModel(
{this.resultType,
this.admissionNo,
this.dateChart,
this.resultValue,
this.createdBy,
this.createdOn});
GetDiabeticChartValuesResponseModel.fromJson(Map<String, dynamic> json) {
resultType = json['ResultType'];
admissionNo = json['AdmissionNo'];
dateChart = json['DateChart'];
resultValue = json['ResultValue'];
createdBy = json['CreatedBy'];
createdOn = json['CreatedOn'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ResultType'] = this.resultType;
data['AdmissionNo'] = this.admissionNo;
data['DateChart'] = this.dateChart;
data['ResultValue'] = this.resultValue;
data['CreatedBy'] = this.createdBy;
data['CreatedOn'] = this.createdOn;
return data;
}
}

@ -0,0 +1,32 @@
class GetDiagnosisForInPatientRequestModel {
int patientID;
int admissionNo;
String setupID;
int patientType;
int patientTypeID;
GetDiagnosisForInPatientRequestModel(
{this.patientID,
this.admissionNo,
this.setupID,
this.patientType,
this.patientTypeID});
GetDiagnosisForInPatientRequestModel.fromJson(Map<String, dynamic> json) {
patientID = json['PatientID'];
admissionNo = json['AdmissionNo'];
setupID = json['SetupID'];
patientType = json['PatientType'];
patientTypeID = json['PatientTypeID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientID'] = this.patientID;
data['AdmissionNo'] = this.admissionNo;
data['SetupID'] = this.setupID;
data['PatientType'] = this.patientType;
data['PatientTypeID'] = this.patientTypeID;
return data;
}
}

@ -0,0 +1,52 @@
class GetDiagnosisForInPatientResponseModel {
String iCDCode10ID;
int diagnosisTypeID;
int conditionID;
bool complexDiagnosis;
String asciiDesc;
int createdBy;
String createdOn;
int editedBy;
String editedOn;
String createdByName;
String editedByName;
GetDiagnosisForInPatientResponseModel(
{this.iCDCode10ID,
this.diagnosisTypeID,
this.conditionID,
this.complexDiagnosis,
this.asciiDesc,
this.createdBy,
this.createdOn,
this.editedBy,
this.editedOn, this.createdByName});
GetDiagnosisForInPatientResponseModel.fromJson(Map<String, dynamic> json) {
iCDCode10ID = json['ICDCode10ID'];
diagnosisTypeID = json['DiagnosisTypeID'];
conditionID = json['ConditionID'];
complexDiagnosis = json['ComplexDiagnosis'];
asciiDesc = json['Ascii_Desc'];
createdBy = json['CreatedBy'];
createdOn = json['CreatedOn'];
editedBy = json['EditedBy'];
editedOn = json['EditedOn'];
createdByName = json['CreatedByName'];
editedByName = json['EditedByName'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ICDCode10ID'] = this.iCDCode10ID;
data['DiagnosisTypeID'] = this.diagnosisTypeID;
data['ConditionID'] = this.conditionID;
data['ComplexDiagnosis'] = this.complexDiagnosis;
data['Ascii_Desc'] = this.asciiDesc;
data['CreatedBy'] = this.createdBy;
data['CreatedOn'] = this.createdOn;
data['EditedBy'] = this.editedBy;
data['EditedOn'] = this.editedOn;
return data;
}
}

@ -0,0 +1,108 @@
class LabResultHistory {
String description;
String femaleInterpretativeData;
int gender;
bool isCertificateAllowed;
int lineItemNo;
String maleInterpretativeData;
String notes;
int orderLineItemNo;
int orderNo;
String packageID;
int patientID;
String projectID;
String referanceRange;
String resultValue;
int resultValueBasedLineItemNo;
String resultValueFlag;
String sampleCollectedOn;
String sampleReceivedOn;
String setupID;
String superVerifiedOn;
String testCode;
String uOM;
String verifiedOn;
String verifiedOnDateTime;
LabResultHistory(
{this.description,
this.femaleInterpretativeData,
this.gender,
this.isCertificateAllowed,
this.lineItemNo,
this.maleInterpretativeData,
this.notes,
this.orderLineItemNo,
this.orderNo,
this.packageID,
this.patientID,
this.projectID,
this.referanceRange,
this.resultValue,
this.resultValueBasedLineItemNo,
this.resultValueFlag,
this.sampleCollectedOn,
this.sampleReceivedOn,
this.setupID,
this.superVerifiedOn,
this.testCode,
this.uOM,
this.verifiedOn,
this.verifiedOnDateTime});
LabResultHistory.fromJson(Map<String, dynamic> json) {
description = json['Description'];
femaleInterpretativeData = json['FemaleInterpretativeData'];
gender = json['Gender'];
isCertificateAllowed = json['IsCertificateAllowed'];
lineItemNo = json['LineItemNo'];
maleInterpretativeData = json['MaleInterpretativeData'];
notes = json['Notes'];
orderLineItemNo = json['OrderLineItemNo'];
orderNo = json['OrderNo'];
packageID = json['PackageID'];
patientID = json['PatientID'];
projectID = json['ProjectID'];
referanceRange = json['ReferanceRange'];
resultValue = json['ResultValue'];
resultValueBasedLineItemNo = json['ResultValueBasedLineItemNo'];
resultValueFlag = json['ResultValueFlag'];
sampleCollectedOn = json['SampleCollectedOn'];
sampleReceivedOn = json['SampleReceivedOn'];
setupID = json['SetupID'];
superVerifiedOn = json['SuperVerifiedOn'];
testCode = json['TestCode'];
uOM = json['UOM'];
verifiedOn = json['VerifiedOn'];
verifiedOnDateTime = json['VerifiedOnDateTime'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Description'] = this.description;
data['FemaleInterpretativeData'] = this.femaleInterpretativeData;
data['Gender'] = this.gender;
data['IsCertificateAllowed'] = this.isCertificateAllowed;
data['LineItemNo'] = this.lineItemNo;
data['MaleInterpretativeData'] = this.maleInterpretativeData;
data['Notes'] = this.notes;
data['OrderLineItemNo'] = this.orderLineItemNo;
data['OrderNo'] = this.orderNo;
data['PackageID'] = this.packageID;
data['PatientID'] = this.patientID;
data['ProjectID'] = this.projectID;
data['ReferanceRange'] = this.referanceRange;
data['ResultValue'] = this.resultValue;
data['ResultValueBasedLineItemNo'] = this.resultValueBasedLineItemNo;
data['ResultValueFlag'] = this.resultValueFlag;
data['SampleCollectedOn'] = this.sampleCollectedOn;
data['SampleReceivedOn'] = this.sampleReceivedOn;
data['SetupID'] = this.setupID;
data['SuperVerifiedOn'] = this.superVerifiedOn;
data['TestCode'] = this.testCode;
data['UOM'] = this.uOM;
data['VerifiedOn'] = this.verifiedOn;
data['VerifiedOnDateTime'] = this.verifiedOnDateTime;
return data;
}
}

@ -0,0 +1,216 @@
class AllSpecialLabResultModel {
dynamic actualDoctorRate;
dynamic admissionDate;
dynamic admissionNumber;
dynamic appointmentDate;
dynamic appointmentNo;
dynamic appointmentTime;
String clinicDescription;
String clinicDescriptionEnglish;
dynamic clinicDescriptionN;
dynamic clinicID;
dynamic createdOn;
double decimalDoctorRate;
dynamic doctorID;
String doctorImageURL;
String doctorName;
String doctorNameEnglish;
dynamic doctorNameN;
dynamic doctorRate;
dynamic doctorStarsRate;
String doctorTitle;
dynamic gender;
String genderDescription;
bool inOutPatient;
String invoiceNo;
bool isActiveDoctorProfile;
bool isDoctorAllowVedioCall;
bool isExecludeDoctor;
bool isInOutPatient;
dynamic isInOutPatientDescription;
dynamic isInOutPatientDescriptionN;
bool isLiveCareAppointment;
bool isRead;
bool isSendEmail;
String moduleID;
String nationalityFlagURL;
dynamic noOfPatientsRate;
dynamic orderDate;
String orderNo;
dynamic patientID;
String projectID;
String projectName;
dynamic projectNameN;
String qR;
String resultData;
String resultDataHTML;
dynamic resultDataTxt;
String setupID;
//List<String> speciality;
dynamic status;
dynamic statusDesc;
String strOrderDate;
AllSpecialLabResultModel(
{this.actualDoctorRate,
this.admissionDate,
this.admissionNumber,
this.appointmentDate,
this.appointmentNo,
this.appointmentTime,
this.clinicDescription,
this.clinicDescriptionEnglish,
this.clinicDescriptionN,
this.clinicID,
this.createdOn,
this.decimalDoctorRate,
this.doctorID,
this.doctorImageURL,
this.doctorName,
this.doctorNameEnglish,
this.doctorNameN,
this.doctorRate,
this.doctorStarsRate,
this.doctorTitle,
this.gender,
this.genderDescription,
this.inOutPatient,
this.invoiceNo,
this.isActiveDoctorProfile,
this.isDoctorAllowVedioCall,
this.isExecludeDoctor,
this.isInOutPatient,
this.isInOutPatientDescription,
this.isInOutPatientDescriptionN,
this.isLiveCareAppointment,
this.isRead,
this.isSendEmail,
this.moduleID,
this.nationalityFlagURL,
this.noOfPatientsRate,
this.orderDate,
this.orderNo,
this.patientID,
this.projectID,
this.projectName,
this.projectNameN,
this.qR,
this.resultData,
this.resultDataHTML,
this.resultDataTxt,
this.setupID,
//this.speciality,
this.status,
this.statusDesc,
this.strOrderDate});
AllSpecialLabResultModel.fromJson(Map<String, dynamic> json) {
actualDoctorRate = json['ActualDoctorRate'];
admissionDate = json['AdmissionDate'];
admissionNumber = json['AdmissionNumber'];
appointmentDate = json['AppointmentDate'];
appointmentNo = json['AppointmentNo'];
appointmentTime = json['AppointmentTime'];
clinicDescription = json['ClinicDescription'];
clinicDescriptionEnglish = json['ClinicDescriptionEnglish'];
clinicDescriptionN = json['ClinicDescriptionN'];
clinicID = json['ClinicID'];
createdOn = json['CreatedOn'];
decimalDoctorRate = json['DecimalDoctorRate'];
doctorID = json['DoctorID'];
doctorImageURL = json['DoctorImageURL'];
doctorName = json['DoctorName'];
doctorNameEnglish = json['DoctorNameEnglish'];
doctorNameN = json['DoctorNameN'];
doctorRate = json['DoctorRate'];
doctorStarsRate = json['DoctorStarsRate'];
doctorTitle = json['DoctorTitle'];
gender = json['Gender'];
genderDescription = json['GenderDescription'];
inOutPatient = json['InOutPatient'];
invoiceNo = json['InvoiceNo'];
isActiveDoctorProfile = json['IsActiveDoctorProfile'];
isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall'];
isExecludeDoctor = json['IsExecludeDoctor'];
isInOutPatient = json['IsInOutPatient'];
isInOutPatientDescription = json['IsInOutPatientDescription'];
isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN'];
isLiveCareAppointment = json['IsLiveCareAppointment'];
isRead = json['IsRead'];
isSendEmail = json['IsSendEmail'];
moduleID = json['ModuleID'];
nationalityFlagURL = json['NationalityFlagURL'];
noOfPatientsRate = json['NoOfPatientsRate'];
orderDate = json['OrderDate'];
orderNo = json['OrderNo'];
patientID = json['PatientID'];
projectID = json['ProjectID'];
projectName = json['ProjectName'];
projectNameN = json['ProjectNameN'];
qR = json['QR'];
resultData = json['ResultData'];
resultDataHTML = json['ResultDataHTML'];
resultDataTxt = json['ResultDataTxt'];
setupID = json['SetupID'];
//speciality = json['Speciality'].cast<String>();
status = json['Status'];
statusDesc = json['StatusDesc'];
strOrderDate = json['StrOrderDate'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ActualDoctorRate'] = this.actualDoctorRate;
data['AdmissionDate'] = this.admissionDate;
data['AdmissionNumber'] = this.admissionNumber;
data['AppointmentDate'] = this.appointmentDate;
data['AppointmentNo'] = this.appointmentNo;
data['AppointmentTime'] = this.appointmentTime;
data['ClinicDescription'] = this.clinicDescription;
data['ClinicDescriptionEnglish'] = this.clinicDescriptionEnglish;
data['ClinicDescriptionN'] = this.clinicDescriptionN;
data['ClinicID'] = this.clinicID;
data['CreatedOn'] = this.createdOn;
data['DecimalDoctorRate'] = this.decimalDoctorRate;
data['DoctorID'] = this.doctorID;
data['DoctorImageURL'] = this.doctorImageURL;
data['DoctorName'] = this.doctorName;
data['DoctorNameEnglish'] = this.doctorNameEnglish;
data['DoctorNameN'] = this.doctorNameN;
data['DoctorRate'] = this.doctorRate;
data['DoctorStarsRate'] = this.doctorStarsRate;
data['DoctorTitle'] = this.doctorTitle;
data['Gender'] = this.gender;
data['GenderDescription'] = this.genderDescription;
data['InOutPatient'] = this.inOutPatient;
data['InvoiceNo'] = this.invoiceNo;
data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile;
data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall;
data['IsExecludeDoctor'] = this.isExecludeDoctor;
data['IsInOutPatient'] = this.isInOutPatient;
data['IsInOutPatientDescription'] = this.isInOutPatientDescription;
data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN;
data['IsLiveCareAppointment'] = this.isLiveCareAppointment;
data['IsRead'] = this.isRead;
data['IsSendEmail'] = this.isSendEmail;
data['ModuleID'] = this.moduleID;
data['NationalityFlagURL'] = this.nationalityFlagURL;
data['NoOfPatientsRate'] = this.noOfPatientsRate;
data['OrderDate'] = this.orderDate;
data['OrderNo'] = this.orderNo;
data['PatientID'] = this.patientID;
data['ProjectID'] = this.projectID;
data['ProjectName'] = this.projectName;
data['ProjectNameN'] = this.projectNameN;
data['QR'] = this.qR;
data['ResultData'] = this.resultData;
data['ResultDataHTML'] = this.resultDataHTML;
data['ResultDataTxt'] = this.resultDataTxt;
data['SetupID'] = this.setupID;
//data['Speciality'] = this.speciality;
data['Status'] = this.status;
data['StatusDesc'] = this.statusDesc;
data['StrOrderDate'] = this.strOrderDate;
return data;
}
}

@ -0,0 +1,68 @@
class AllSpecialLabResultRequestModel {
double versionID;
int channel;
int languageID;
String iPAdress;
String generalid;
int patientOutSA;
String sessionID;
bool isDentalAllowedBackend;
int deviceTypeID;
String tokenID;
int patientTypeID;
int patientType;
int patientID;
int projectID;
AllSpecialLabResultRequestModel(
{this.versionID,
this.channel,
this.languageID,
this.iPAdress,
this.generalid,
this.patientOutSA,
this.sessionID,
this.isDentalAllowedBackend,
this.deviceTypeID,
this.tokenID,
this.patientTypeID,
this.patientType,
this.patientID,
this.projectID});
AllSpecialLabResultRequestModel.fromJson(Map<String, dynamic> json) {
versionID = json['VersionID'];
channel = json['Channel'];
languageID = json['LanguageID'];
iPAdress = json['IPAdress'];
generalid = json['generalid'];
patientOutSA = json['PatientOutSA'];
sessionID = json['SessionID'];
isDentalAllowedBackend = json['isDentalAllowedBackend'];
deviceTypeID = json['DeviceTypeID'];
tokenID = json['TokenID'];
patientTypeID = json['PatientTypeID'];
patientType = json['PatientType'];
patientID = json['PatientID'];
projectID = json['ProjectID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress;
data['generalid'] = this.generalid;
data['PatientOutSA'] = this.patientOutSA;
data['SessionID'] = this.sessionID;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['DeviceTypeID'] = this.deviceTypeID;
data['TokenID'] = this.tokenID;
data['PatientTypeID'] = this.patientTypeID;
data['PatientType'] = this.patientType;
data['PatientID'] = this.patientID;
data['ProjectID'] = this.projectID;
return data;
}
}

@ -13,6 +13,8 @@ class LabResult {
String? sampleCollectedOn;
String? sampleReceivedOn;
String? setupID;
String? maxValue;
String? minValue;
dynamic superVerifiedOn;
String? testCode;
String? uOM;
@ -31,7 +33,8 @@ class LabResult {
this.projectID,
this.referanceRange,
this.resultValue,
this.sampleCollectedOn,
this.maxValue,
this.minValue,this.sampleCollectedOn,
this.sampleReceivedOn,
this.setupID,
this.superVerifiedOn,
@ -52,6 +55,8 @@ class LabResult {
projectID = json['ProjectID'].toString();
referanceRange = json['ReferenceRange'] ?? json['ReferanceRange'];
resultValue = json['ResultValue'];
maxValue = json['MaxValue'];
minValue = json['MinValue'];
sampleCollectedOn = json['SampleCollectedOn'];
sampleReceivedOn = json['SampleReceivedOn'];
setupID = json['SetupID'];
@ -75,6 +80,8 @@ class LabResult {
data['ProjectID'] = this.projectID;
data['ReferanceRange'] = this.referanceRange;
data['ResultValue'] = this.resultValue;
data['MaxValue'] = this.maxValue;
data['MinValue'] = this.minValue;
data['SampleCollectedOn'] = this.sampleCollectedOn;
data['SampleReceivedOn'] = this.sampleReceivedOn;
data['SetupID'] = this.setupID;
@ -85,6 +92,28 @@ class LabResult {
data['VerifiedOnDateTime'] = this.verifiedOnDateTime;
return data;
}
int checkResultStatus() {
try {
var max = double.tryParse(maxValue) ?? null;
var min = double.tryParse(minValue) ?? null;
var result = double.tryParse(resultValue) ?? null;
if (max != null && min != null && result != null) {
if (result > max) {
return 1;
} else if (result < min) {
return -1;
} else {
return 0;
}
} else {
return 0;
}
}catch (e){
return 0;
}
}
}
class LabResultList {

@ -0,0 +1,27 @@
class AddPatientToDoctorListRequestModel {
int vCID;
String tokenID;
String generalid;
int doctorId;
bool isOutKsa;
AddPatientToDoctorListRequestModel({this.vCID, this.tokenID, this.generalid, this.doctorId, this.isOutKsa});
AddPatientToDoctorListRequestModel.fromJson(Map<String, dynamic> json) {
vCID = json['VC_ID'];
tokenID = json['TokenID'];
generalid = json['generalid'];
doctorId = json['DoctorId'];
isOutKsa = json['IsOutKsa'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['VC_ID'] = this.vCID;
data['TokenID'] = this.tokenID;
data['generalid'] = this.generalid;
data['DoctorId'] = this.doctorId;
data['IsOutKsa'] = this.isOutKsa;
return data;
}
}

@ -0,0 +1,30 @@
import 'package:doctor_app_flutter/config/config.dart';
class GetNursingProgressNoteRequestModel {
int patientID;
int admissionNo;
int patientTypeID;
int patientType;
String setupID;
GetNursingProgressNoteRequestModel(
{this.patientID, this.admissionNo, this.patientTypeID = 1, this.patientType = 1, this.setupID });
GetNursingProgressNoteRequestModel.fromJson(Map<String, dynamic> json) {
patientID = json['PatientID'];
admissionNo = json['AdmissionNo'];
patientTypeID = json['PatientTypeID'];
patientType = json['PatientType'];
setupID = json['SetupID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientID'] = this.patientID;
data['AdmissionNo'] = this.admissionNo;
data['PatientTypeID'] = this.patientTypeID;
data['PatientType'] = this.patientType;
data['SetupID'] = this.setupID;
return data;
}
}

@ -0,0 +1,44 @@
class GetNursingProgressNoteResposeModel {
String notes;
dynamic conditionType;
int createdBy;
String createdOn;
dynamic editedBy;
dynamic editedOn;
String createdByName;
String editedByName;
GetNursingProgressNoteResposeModel(
{this.notes,
this.conditionType,
this.createdBy,
this.createdOn,
this.editedBy,
this.editedOn,
this.editedByName,
this.createdByName});
GetNursingProgressNoteResposeModel.fromJson(Map<String, dynamic> json) {
notes = json['Notes'];
conditionType = json['ConditionType'];
createdBy = json['CreatedBy'];
createdOn = json['CreatedOn'];
editedBy = json['EditedBy'];
editedOn = json['EditedOn'];
createdByName = json['CreatedByName'];
editedByName = json['EditedByName'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Notes'] = this.notes;
data['ConditionType'] = this.conditionType;
data['CreatedBy'] = this.createdBy;
data['CreatedOn'] = this.createdOn;
data['EditedBy'] = this.editedBy;
data['EditedOn'] = this.editedOn;
return data;
}
}

@ -9,13 +9,14 @@ class PatientSearchRequestModel {
String? from;
String ?to;
int ?searchType;
int projectID;
String? mobileNo;
String? identificationNo;
int? nursingStationID;
int? clinicID=0;
int? clinicID = 0;
PatientSearchRequestModel(
{this.doctorID = 0,
{this.doctorID,
this.firstName = "0",
this.middleName = "0",
this.lastName = "0",
@ -28,7 +29,8 @@ class PatientSearchRequestModel {
this.from = "0",
this.to = "0",
this.clinicID,
this.nursingStationID = 0});
this.nursingStationID = 0,
this.projectID});
PatientSearchRequestModel.fromJson(Map<String, dynamic> json) {
doctorID = json['DoctorID'];
@ -45,6 +47,7 @@ class PatientSearchRequestModel {
identificationNo = json['IdentificationNo'];
nursingStationID = json['NursingStationID'];
clinicID = json['ClinicID'];
projectID = json['ProjectID'];
}
Map<String, dynamic> toJson() {
@ -63,7 +66,7 @@ class PatientSearchRequestModel {
data['IdentificationNo'] = this.identificationNo;
data['NursingStationID'] = this.nursingStationID;
data['ClinicID'] = this.clinicID;
data['ProjectID'] = 0;
data['ProjectID'] = this.projectID;
return data;
}
}

@ -1,18 +1,22 @@
class GetOrderedProcedureRequestModel {
String? vidaAuthTokenID;
int? patientMRN;
int appointmentNo;
GetOrderedProcedureRequestModel({this.vidaAuthTokenID, this.patientMRN});
GetOrderedProcedureRequestModel({this.vidaAuthTokenID, this.patientMRN, this.appointmentNo});
GetOrderedProcedureRequestModel.fromJson(Map<String, dynamic> json) {
vidaAuthTokenID = json['VidaAuthTokenID'];
patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appointmentNo;
return data;
}
}

@ -62,6 +62,15 @@ class MyReferralPatientModel {
String? referringClinicDescription;
String? referringDoctorName;
int? referalStatus;
String sourceSetupID;
int sourceProjectId;
String targetSetupID;
int targetProjectId;
int targetClinicID;
int targetDoctorID;
int sourceAppointmentNo;
int targetAppointmentNo;
String remarksFromSource;
MyReferralPatientModel(
{this.rowID,
@ -104,27 +113,27 @@ class MyReferralPatientModel {
this.referralResponseOn,
this.priority,
this.frequency,
this.mAXResponseTime,
this.episodeID,
this.appointmentNo,
this.appointmentDate,
this.appointmentType,
this.patientMRN,
this.createdOn,
this.clinicID,
this.nationalityID,
this.age,
this.doctorImageURL,
this.frequencyDescription,
this.genderDescription,
this.isDoctorLate,
this.isDoctorResponse,
this.nationalityFlagURL,
this.nursingStationName,
this.priorityDescription,
this.referringClinicDescription,
this.referringDoctorName,
this.referalStatus});
this.mAXResponseTime,
this.episodeID,
this.appointmentNo,
this.appointmentDate,
this.appointmentType,
this.patientMRN,
this.createdOn,
this.clinicID,
this.nationalityID,
this.age,
this.doctorImageURL,
this.frequencyDescription,
this.genderDescription,
this.isDoctorLate,
this.isDoctorResponse,
this.nationalityFlagURL,
this.nursingStationName,
this.priorityDescription,
this.referringClinicDescription,
this.referringDoctorName,
this.referalStatus, this.sourceSetupID, this.sourceAppointmentNo, this.sourceProjectId, this.targetProjectId, this.targetAppointmentNo, this.targetClinicID, this.targetSetupID, this.targetDoctorID, this.remarksFromSource});
MyReferralPatientModel.fromJson(Map<String?, dynamic> json) {
rowID = json['RowID'];
@ -201,6 +210,16 @@ class MyReferralPatientModel {
priorityDescription = json['PriorityDescription'];
referringClinicDescription = json['ReferringClinicDescription'];
referringDoctorName = json['ReferringDoctorName'];
sourceSetupID = json['SourceSetupID'];
sourceProjectId = json['SourceProjectId'];
targetSetupID = json['TargetSetupID'];
targetProjectId = json['TargetProjectId'];
targetClinicID = json['TargetClinicID'];
targetDoctorID = json['TargetDoctorID'];
sourceAppointmentNo = json['SourceAppointmentNo'];
targetAppointmentNo = json['TargetAppointmentNo'];
remarksFromSource = json['RemarksFromSource'];
}
Map<String?, dynamic> toJson() {
@ -266,6 +285,15 @@ class MyReferralPatientModel {
data['PriorityDescription'] = this.priorityDescription;
data['ReferringClinicDescription'] = this.referringClinicDescription;
data['ReferringDoctorName'] = this.referringDoctorName;
data['SourceSetupID'] = this.sourceSetupID;
data['SourceProjectId'] = this.sourceProjectId;
data['TargetSetupID'] = this.targetSetupID;
data['TargetProjectId'] = this.targetProjectId;
data['TargetClinicID'] = this.targetClinicID;
data['TargetDoctorID'] = this.targetDoctorID;
data['SourceAppointmentNo'] = this.sourceAppointmentNo;
data['TargetAppointmentNo'] = this.targetAppointmentNo;
data['RemarksFromSource'] = this.remarksFromSource;
return data;
}

@ -0,0 +1,28 @@
class GetSickLeaveDoctorRequestModel {
int patientMRN;
String appointmentNo;
int status;
String vidaAuthTokenID;
String vidaRefreshTokenID;
GetSickLeaveDoctorRequestModel(
{this.patientMRN, this.appointmentNo, this.status, this.vidaAuthTokenID, this.vidaRefreshTokenID});
GetSickLeaveDoctorRequestModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo'];
status = json['status'];
vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appointmentNo;
data['status'] = this.status;
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
return data;
}
}

@ -1,41 +1,46 @@
import 'package:doctor_app_flutter/widgets/shared/StarRating.dart';
class SickLeavePatientModel {
String? setupID;
int? projectID;
int? patientID;
int? patientType;
int? clinicID;
int? doctorID;
int? requestNo;
String? requestDate;
int? sickLeaveDays;
int? appointmentNo;
int? admissionNo;
int? actualDoctorRate;
String? appointmentDate;
String? clinicName;
String? doctorImageURL;
String? doctorName;
int? doctorRate;
String? doctorTitle;
int? gender;
String? genderDescription;
bool? isActiveDoctorProfile;
bool? isDoctorAllowVedioCall;
bool? isExecludeDoctor;
bool? isInOutPatient;
String? isInOutPatientDescription;
String? isInOutPatientDescriptionN;
bool? isLiveCareAppointment;
int? noOfPatientsRate;
dynamic setupID;
dynamic projectID;
dynamic patientID;
dynamic patientType;
dynamic clinicID;
dynamic doctorID;
dynamic requestNo;
dynamic requestDate;
dynamic sickLeaveDays;
dynamic appointmentNo;
dynamic admissionNo;
dynamic actualDoctorRate;
dynamic appointmentDate;
dynamic clinicName;
dynamic doctorImageURL;
dynamic doctorName;
dynamic doctorRate;
dynamic doctorTitle;
dynamic gender;
dynamic genderDescription;
bool isActiveDoctorProfile;
bool isDoctorAllowVedioCall;
bool isExecludeDoctor;
bool isInOutPatient;
dynamic isInOutPatientDescription;
dynamic isInOutPatientDescriptionN;
bool isLiveCareAppointment;
dynamic noOfPatientsRate;
dynamic patientName;
String? projectName;
String? qR;
// List<String?> speciality;
String? strRequestDate;
String? startDate;
String? endDate;
dynamic projectName;
dynamic qR;
// List<String> speciality;
dynamic strRequestDate;
dynamic startDate;
dynamic endDate;
dynamic isExtendedLeave;
dynamic noOfDays;
dynamic patientMRN;
dynamic remarks;
dynamic status;
SickLeavePatientModel(
{this.setupID,
@ -72,10 +77,19 @@ class SickLeavePatientModel {
// this.speciality,
this.strRequestDate,
this.startDate,
this.endDate});
this.endDate,
this.isExtendedLeave,
this.noOfDays,
this.patientMRN,
this.remarks,
this.status});
SickLeavePatientModel.fromJson(Map<String?, dynamic> json) {
setupID = json['SetupID'];
isExtendedLeave = json['isExtendedLeave'];
noOfDays = json['noOfDays'];
patientMRN = json['patientMRN'];
status = json['status'];
projectID = json['ProjectID'];
patientID = json['PatientID'];
@ -109,13 +123,17 @@ class SickLeavePatientModel {
qR = json['QR'];
// speciality = json['Speciality'].cast<String?>();
strRequestDate = json['StrRequestDate'];
startDate = json['StartDate'];
startDate = json['StartDate'] ?? json['startDate'];
endDate = json['EndDate'];
}
Map<String?, dynamic> toJson() {
final Map<String?, dynamic> data = new Map<String?, dynamic>();
data['SetupID'] = this.setupID;
data['status'] = this.status;
data['isExtendedLeave'] = this.isExtendedLeave;
data['noOfDays'] = this.noOfDays;
data['patientMRN'] = this.patientMRN;
data['ProjectID'] = this.projectID;
data['PatientID'] = this.patientID;

@ -10,6 +10,7 @@ class SickLeavePatientRequestModel {
int? patientTypeID;
String? tokenID;
int? patientID;
int patientMRN;
String? sessionID;
SickLeavePatientRequestModel(
@ -24,10 +25,12 @@ class SickLeavePatientRequestModel {
this.patientTypeID,
this.tokenID,
this.patientID,
this.sessionID});
this.sessionID,
this.patientMRN});
SickLeavePatientRequestModel.fromJson(Map<String?, dynamic> json) {
versionID = json['VersionID'];
patientMRN = json['PatientMRN'];
channel = json['Channel'];
languageID = json['LanguageID'];
iPAdress = json['IPAdress'];
@ -44,6 +47,7 @@ class SickLeavePatientRequestModel {
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['VersionID'] = this.versionID;
data['PatientMRN'] = this.patientMRN;
data['Channel'] = this.channel;
data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress;

@ -0,0 +1,16 @@
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:firebase_analytics/observer.dart';
import 'package:flutter/cupertino.dart';
class AnalyticsService {
final FirebaseAnalytics _analytics = FirebaseAnalytics();
FirebaseAnalyticsObserver getAnalyticsObserver() => FirebaseAnalyticsObserver(analytics: _analytics);
Future logEvent({@required String eventCategory, @required String eventAction}) async {
await _analytics.logEvent(name: 'event', parameters: {
"eventCategory": eventCategory,
"eventAction": eventAction,
});
}
}

@ -15,4 +15,12 @@ class NavigationService {
Future<dynamic> pushNamedAndRemoveUntil(String routeName) {
return navigatorKey.currentState!.pushNamedAndRemoveUntil(routeName,(asd)=>false);
}
Future<dynamic> pushAndRemoveUntil(Route newRoute) {
return navigatorKey.currentState.pushAndRemoveUntil(newRoute,(asd)=>false);
}
pop() {
return navigatorKey.currentState.pop();
}
}

@ -0,0 +1,108 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckActivationCodeModel.dart';
import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart';
import 'package:doctor_app_flutter/core/model/PatientRegistration/GetPatientInfoRequestModel.dart';
import 'package:doctor_app_flutter/core/model/PatientRegistration/GetPatientInfoResponseModel.dart';
import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart';
import 'package:doctor_app_flutter/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart';
class PatientRegistrationService extends BaseService {
GetPatientInfoResponseModel getPatientInfoResponseModel;
String logInTokenID;
checkPatientForRegistration(
CheckPatientForRegistrationModel registrationModel) async {
hasError = false;
await baseAppClient.post(CHECK_PATIENT_FOR_REGISTRATION,
onSuccess: (dynamic response, int statusCode) {
//TODO Elham* fix it
logInTokenID = "OjEi/qgRekGICZm5/a4jbQ=="; //response["LogInTokenID"];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: registrationModel.toJson());
}
getPatientInfo(GetPatientInfoRequestModel getPatientInfoRequestMode) async {
hasError = false;
await baseAppClient.post(GET_PATIENT_INFO,
onSuccess: (dynamic response, int statusCode) {
getPatientInfoResponseModel =
GetPatientInfoResponseModel.fromJson(response);
print("ddd");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getPatientInfoRequestMode.toJson());
}
sendActivationCodeByOTPNotificationType(
{SendActivationCodeByOTPNotificationTypeForRegistrationModel
registrationModel,
int otpType,
PatientRegistrationViewModel model,
CheckPatientForRegistrationModel
checkPatientForRegistrationModel}) async {
registrationModel =
SendActivationCodeByOTPNotificationTypeForRegistrationModel(
oTPSendType: otpType,
patientIdentificationID: checkPatientForRegistrationModel
.patientIdentificationID,
patientMobileNumber: checkPatientForRegistrationModel
.patientMobileNumber,
zipCode: checkPatientForRegistrationModel.zipCode,
patientOutSA: 0,
healthId: model.getPatientInfoResponseModel.healthId,
dOB: checkPatientForRegistrationModel.dOB,
isRegister: checkPatientForRegistrationModel.isRegister,
isHijri: checkPatientForRegistrationModel.isHijri,
sessionID: null,
generalid: GENERAL_ID,
isDentalAllowedBackend: false,
projectOutSA: 0,
searchType: 1,
versionID: 7.1,
channel: 3,
nationalID:
model.checkPatientForRegistrationModel.patientIdentificationID,
patientID: 0,
mobileNo: model.checkPatientForRegistrationModel.patientMobileNumber
.toString(),
loginType: otpType,
logInTokenID: logInTokenID);
hasError = false;
await baseAppClient.post(SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION,
onSuccess: (dynamic response, int statusCode) {
registrationModel =
SendActivationCodeByOTPNotificationTypeForRegistrationModel.fromJson(
response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: registrationModel.toJson());
}
checkActivationCode(CheckActivationCodeModel registrationModel) async {
hasError = false;
await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_PATIENT,
onSuccess: (dynamic response, int statusCode) {
registrationModel = CheckActivationCodeModel.fromJson(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: registrationModel.toJson());
}
registrationPatient(PatientRegistrationModel registrationModel) async {
hasError = false;
await baseAppClient.post(PATIENT_REGISTRATION,
onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: registrationModel.toJson());
}
}

@ -22,56 +22,78 @@ class VideoCallService extends BaseService{
late PatiantInformtion patient;
LiveCarePatientServices _liveCarePatientServices = locator<LiveCarePatientServices>();
openVideo(StartCallRes startModel,PatiantInformtion patientModel,VoidCallback onCallConnected, VoidCallback onCallDisconnected)async{
openVideo(StartCallRes startModel, PatiantInformtion patientModel,
bool isRecording,VoidCallback onCallConnected, VoidCallback onCallDisconnected) async {
this.startCallRes = startModel;
this.patient = patientModel;
DoctorProfileModel? doctorProfile = await getDoctorProfile(isGetProfile: true);
DoctorProfileModel? doctorProfile =
await getDoctorProfile(isGetProfile: true);
await VideoChannel.openVideoCallScreen(
kToken: startCallRes.openTokenID,//"T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==",
kSessionId:startCallRes.openSessionID,//1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg
kApiKey: '46209962',//'47247954'
// TODO MOSA TEST
kToken: startCallRes.openTokenID,
kSessionId: startCallRes.openSessionID,
kApiKey:'46209962',
// kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGUyZjgxMjFlYTFkNzU5NjcxNDY2ZTM2ZjM3YTVhNTI2NGY0NTI2NzpzZXNzaW9uX2lkPTJfTVg0ME56STBOemsxTkg1LU1UWXlOVGN5TmpnMk5qZzNOMzQ1YUhCcGRtcDFXbVpDTDFkNE1qbDRkWFY2TTA4cmIySi1mZyZjcmVhdGVfdGltZT0xNjI1NzI2ODg5Jm5vbmNlPTAuNjc2Nzc4OTQxNjA1MTMxNSZyb2xlPXB1Ymxpc2hlciZleHBpcmVfdGltZT0xNjI4MzE4ODg4JmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9",
// kSessionId: "2_MX40NzI0Nzk1NH5-MTYyNTcyNjg2Njg3N345aHBpdmp1WmZCL1d4Mjl4dXV6M08rb2J-fg",
// kApiKey:'47247954',
vcId: patient.vcId,
patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"),
isRecording: isRecording,
patientName: patient.fullName ??
(patient.firstName != null
? "${patient.firstName} ${patient.lastName}"
: "-"),
tokenID: await sharedPref.getString(TOKEN),
generalId: GENERAL_ID,
doctorId: doctorProfile!.doctorID,
onFailure: (String error) {
DrAppToastMsg.showErrorToast(error);
},onCallConnected: onCallConnected,
},
onCallConnected: onCallConnected,
onCallDisconnected: onCallDisconnected,
onCallEnd: () {
WidgetsBinding.instance!.addPostFrameCallback((_) async {
GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext!);
endCall(patient.vcId!, false,).then((value) {
GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext!);
if (hasError) {
DrAppToastMsg.showErrorToast(error);
}else
locator<NavigationService>().navigateTo(PATIENTS_END_Call,arguments: {
"patient": patient,
});
GifLoaderDialogUtils.showMyDialog(
locator<NavigationService>().navigatorKey.currentContext!);
endCall(
patient.vcId!,
false,
});
).then((value) {
GifLoaderDialogUtils.hideDialog(
locator<NavigationService>().navigatorKey.currentContext!);
if (hasError) {
DrAppToastMsg.showErrorToast(error);
} else
locator<NavigationService>()
.navigateTo(PATIENTS_END_Call, arguments: {
"patient": patient,
});
});
});
},
onCallNotRespond: (SessionStatusModel sessionStatusModel) {
WidgetsBinding.instance!.addPostFrameCallback((_) {
GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext!);
endCall(patient.vcId!, sessionStatusModel.sessionStatus == 3,).then((value) {
GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext!);
GifLoaderDialogUtils.showMyDialog(
locator<NavigationService>().navigatorKey.currentContext!);
endCall(
patient.vcId!,
sessionStatusModel.sessionStatus == 3,
).then((value) {
GifLoaderDialogUtils.hideDialog(
locator<NavigationService>().navigatorKey.currentContext!);
if (hasError) {
DrAppToastMsg.showErrorToast(error);
} else {
locator<NavigationService>().navigateTo(PATIENTS_END_Call,arguments: {
locator<NavigationService>()
.navigateTo(PATIENTS_END_Call, arguments: {
"patient": patient,
});
}
});
});
});
});
}
Future endCall(int vCID, bool isPatient) async {
hasError = false;
await getDoctorProfile(isGetProfile: true);
@ -85,5 +107,4 @@ class VideoCallService extends BaseService{
error = _liveCarePatientServices.error!;
}
}
}
}

@ -1,5 +1,4 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
@ -14,7 +13,11 @@ class BaseService {
List<PatiantInformtion> patientArrivalList = [];
//TODO add the user login model when we need it
BaseService(){
doctorProfile = null;
}
//TODO add the user login model when we need it
Future<DoctorProfileModel?> ? getDoctorProfile({bool isGetProfile = false}) async {
if(isGetProfile)
{

@ -1,57 +1,77 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart';
import 'package:doctor_app_flutter/models/doctor/replay/request_create_doctor_response.dart';
import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart';
import 'package:doctor_app_flutter/models/doctor/request_doctor_reply.dart';
import 'package:doctor_app_flutter/models/doctor/replay/request_doctor_reply.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart';
import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart';
class DoctorReplyService extends BaseService {
List<ListGtMyPatientsQuestions> get listDoctorWorkingHoursTable => _listDoctorWorkingHoursTable;
List<ListGtMyPatientsQuestions> get listDoctorWorkingHoursTable =>
_listDoctorWorkingHoursTable;
List<ListGtMyPatientsQuestions> get listDoctorNotRepliedQuestions =>
_listDoctorNotRepliedQuestions;
List<ListGtMyPatientsQuestions> _listDoctorWorkingHoursTable = [];
RequestDoctorReply _requestDoctorReply = RequestDoctorReply();
List<ListGtMyPatientsQuestions> _listDoctorNotRepliedQuestions = [];
List<MyReferralPatientModel> _listMyReferralPatientModel = [];
List<MyReferralPatientModel> get listMyReferralPatientModel => _listMyReferralPatientModel;
Future getDoctorReply() async {
List<MyReferralPatientModel> get listMyReferralPatientModel =>
_listMyReferralPatientModel;
int notRepliedCount = 0;
Future getDoctorReply(RequestDoctorReply _requestDoctorReply,
{bool clearData = false, bool isGettingNotReply = false}) async {
hasError = false;
await baseAppClient.post(GT_MY_PATIENT_QUESTION,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(
GT_MY_PATIENT_QUESTION,
onSuccess: (dynamic response, int statusCode) {
if (clearData) {
if(isGettingNotReply)
_listDoctorNotRepliedQuestions.clear();
else
_listDoctorWorkingHoursTable.clear();
response['List_GtMyPatientsQuestions'].forEach((v) {
_listDoctorWorkingHoursTable
.add(ListGtMyPatientsQuestions.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestDoctorReply.toJson(),);
}
response['List_GtMyPatientsQuestions'].forEach((v) {
if(isGettingNotReply)
_listDoctorNotRepliedQuestions.add(ListGtMyPatientsQuestions.fromJson(v));
else
_listDoctorWorkingHoursTable
.add(ListGtMyPatientsQuestions.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _requestDoctorReply.toJson(),
);
}
Future createDoctorResponse(
CreateDoctorResponseModel createDoctorResponseModel) async {
hasError = false;
await baseAppClient.post(
CREATE_DOCTOR_RESPONSE,
body: createDoctorResponseModel.toJson(),
onSuccess: (dynamic body, int statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
);
}
Future replay(
String referredDoctorRemarks, ListGtMyPatientsQuestions model) async {
RequestMyReferralPatientModel _requestMyReferralPatient =
RequestMyReferralPatientModel();
RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks =
RequestAddReferredDoctorRemarks();
_requestAddReferredDoctorRemarks.admissionNo = model.admissionNo.toString();
_requestAddReferredDoctorRemarks.patientID = model.patientID;
_requestAddReferredDoctorRemarks.referredDoctorRemarks =
referredDoctorRemarks;
_requestAddReferredDoctorRemarks.lineItemNo = model.lineItemNo;
_requestAddReferredDoctorRemarks.referringDoctor = model.referringDoctor;
Future getNotRepliedCount() async {
hasError = false;
await baseAppClient.post(
ADD_REFERRED_DOCTOR_REMARKS,
body: _requestAddReferredDoctorRemarks.toJson(),
GET_DOCTOR_NOT_REPLIED_COUNTS,
body: {},
onSuccess: (dynamic body, int statusCode) {
print("succsss");
// model.referredDoctorRemarks = referredDoctorRemarks;
// listMyReferralPatientModel[listMyReferralPatientModel.indexOf(model)] =
// model;
notRepliedCount = body["DoctorNotRepliedCounts"];
},
onFailure: (String error, int statusCode) {
hasError = true;

@ -11,11 +11,11 @@ class ScanQrService extends BaseService {
hasError = false;
await getDoctorProfile();
if (isMyInpatient) {
requestModel.doctorID = doctorProfile!.doctorID!;
} else {
requestModel.doctorID = 0;
}
// if (isMyInpatient) {
// requestModel.doctorID = doctorProfile!.doctorID!;
// } else {
requestModel.doctorID = 0;
//}
await baseAppClient.post(
GET_PATIENT_IN_PATIENT_LIST,

@ -21,6 +21,6 @@ class ScheduleService extends BaseService {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestSchedule.toJson(),);
}, body: _requestSchedule.toJson(),isFallLanguage: true);
}
}

@ -1,7 +1,7 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/live_care/AlternativeServicesList.dart';
import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart';
import 'package:doctor_app_flutter/core/model/live_care/add_patient_to_doctor_list_request_model.dart';
import 'package:doctor_app_flutter/core/model/live_care/live_care_login_reguest_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/livecare/end_call_req.dart';
@ -34,15 +34,34 @@ class LiveCarePatientServices extends BaseService {
StartCallRes get startCallRes => _startCallRes;
Future getPendingPatientERForDoctorApp(
PendingPatientERForDoctorAppRequestModel
pendingPatientERForDoctorAppRequestModel) async {
PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async {
hasError = false;
await baseAppClient.post(
GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP,
onSuccess: (dynamic response, int statusCode) {
_patientList.clear();
List<PatiantInformtion> localPatientList = [];
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) {
@ -102,20 +121,17 @@ class LiveCarePatientServices extends BaseService {
Future sendSMSInstruction(int vcID) async {
hasError = false;
await baseAppClient.post(SEND_SMS_INSTRUCTIONS,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(SEND_SMS_INSTRUCTIONS, onSuccess: (dynamic response, int statusCode) {
transferToAdminResponse = response;
}, onFailure: (String error, int statusCode) {
hasError =true;
super.error = error;
}, body: {
"VC_ID": vcID, "generalid": GENERAL_ID
}, isLiveCare: _isLive);
}, body: {"VC_ID": vcID, "generalid": GENERAL_ID}, isLiveCare: _isLive);
}
Future isLogin({LiveCareUserLoginRequestModel? isLoginRequestModel, int? loginStatus}) async {
hasError = false;
await getDoctorProfile( );
await getDoctorProfile();
isLoginRequestModel!.doctorId = super.doctorProfile!.doctorID!;
await baseAppClient.post(LIVE_CARE_IS_LOGIN, onSuccess: (response, statusCode) async {
isLoginResponse = response;
@ -129,17 +145,48 @@ class LiveCarePatientServices extends BaseService {
hasError = false;
alternativeServicesList.clear();
await baseAppClient.post(GET_ALTERNATIVE_SERVICE,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(GET_ALTERNATIVE_SERVICE, onSuccess: (dynamic response, int statusCode) {
response['AlternativeServicesList'].forEach((v) {
alternativeServicesList.add(AlternativeService.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: {
"VC_ID": vcID,
"generalid": GENERAL_ID
}, isLiveCare: _isLive);
}, body: {"VC_ID": vcID, "generalid": GENERAL_ID}, isLiveCare: _isLive);
}
Future addPatientToDoctorList({int vcID}) async {
hasError = false;
await getDoctorProfile();
AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel();
addPatientToDoctorListRequestModel.doctorId = super.doctorProfile.doctorID;
addPatientToDoctorListRequestModel.vCID = vcID;
addPatientToDoctorListRequestModel.isOutKsa = false;
addPatientToDoctorListRequestModel.generalid = GENERAL_ID;
await baseAppClient.post(ADD_PATIENT_TO_DOCTOR, onSuccess: (response, statusCode) async {
isLoginResponse = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: addPatientToDoctorListRequestModel.toJson(), isLiveCare: _isLive);
}
Future removePatientFromDoctorList({int vcID}) async {
hasError = false;
AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel();
await getDoctorProfile();
addPatientToDoctorListRequestModel.doctorId = super.doctorProfile.doctorID;
addPatientToDoctorListRequestModel.vCID = vcID;
addPatientToDoctorListRequestModel.isOutKsa = false;
addPatientToDoctorListRequestModel.generalid = GENERAL_ID;
await baseAppClient.post(REMOVE_PATIENT_FROM_DOCTOR, onSuccess: (response, statusCode) async {
isLoginResponse = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: addPatientToDoctorListRequestModel.toJson(), isLiveCare: _isLive);
}
}

@ -100,20 +100,22 @@ class MyReferralInPatientService extends BaseService {
);
}
Future replayReferred(String referredDoctorRemarks, MyReferralPatientModel referral, int referalStatus) async {
Future replayReferred(String referredDoctorRemarks, MyReferralPatientModel referral, int referralStatus) async {
hasError = false;
await getDoctorProfile();
AddReferredRemarksRequestModel _requestAddReferredDoctorRemarks = AddReferredRemarksRequestModel(
editedBy: doctorProfile!.doctorID!,
projectID: doctorProfile!.projectID!,
referredDoctorRemarks: referredDoctorRemarks,
referalStatus: referalStatus);
referalStatus: referralStatus);
_requestAddReferredDoctorRemarks.projectID = referral.projectID!;
//TODO Check this in case out patient
_requestAddReferredDoctorRemarks.admissionNo = int.parse(referral.admissionNo!);
_requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo!;
_requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks;
_requestAddReferredDoctorRemarks.editedBy = doctorProfile!.doctorID!;
_requestAddReferredDoctorRemarks.referalStatus = referalStatus;
_requestAddReferredDoctorRemarks.referalStatus = referralStatus;
// _requestAddReferredDoctorRemarks.patientID = referral.patientID;
// _requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor;

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart';
import 'package:doctor_app_flutter/lookups/hospital_lookup.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/get_clinic_by_project_id_request.dart';
@ -233,18 +234,18 @@ class PatientReferralService extends LookupService {
);
}
Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async {
Future responseReferral(MyReferralPatientModel referralPatient, bool isAccepted) async {
hasError = false;
DoctorProfileModel? doctorProfile = await getDoctorProfile();
Map<String, dynamic> body = Map();
body['PatientMRN'] = pendingReferral.patientID;
body['AppointmentNo'] = pendingReferral.targetAppointmentNo;
body['SetupID'] = pendingReferral.targetSetupID;
body['ProjectID'] = pendingReferral.targetProjectId;
body['PatientMRN'] = referralPatient.patientID;
body['AppointmentNo'] = referralPatient.targetAppointmentNo;
body['SetupID'] = referralPatient.targetSetupID;
body['ProjectID'] = referralPatient.targetProjectId;
body['IsAccepted'] = isAccepted;
body['PatientName'] = pendingReferral.patientName;
body['ReferralResponse'] = pendingReferral.remarksFromSource;
body['PatientName'] = referralPatient.patientName;
body['ReferralResponse'] = referralPatient.remarksFromSource;
body['DoctorName'] = doctorProfile!.doctorName;
await baseAppClient.post(

@ -9,7 +9,7 @@ class PatientInPatientService extends BaseService {
Future getInPatientList(PatientSearchRequestModel requestModel, bool isMyInpatient) async {
hasError = false;
await getDoctorProfile();
await getDoctorProfile(isGetProfile: true);
if (isMyInpatient) {
requestModel.doctorID = doctorProfile!.doctorID;

@ -1,7 +1,13 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart';
import 'package:doctor_app_flutter/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart';
import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart';
import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart';
import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart';
import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteRequestModel.dart';
import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteResposeModel.dart';
import 'package:doctor_app_flutter/core/model/note/note_model.dart';
import 'package:doctor_app_flutter/core/model/note/update_note_model.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
@ -51,11 +57,21 @@ class PatientService extends BaseService {
List<LabResult> get labResultList => _labResultList;
// TODO: replace var with model
List<NoteModel> _patientProgressNoteList = [];
List<NoteModel> get patientProgressNoteList => _patientProgressNoteList;
List<GetNursingProgressNoteResposeModel> _patientNursingProgressNoteList = [];
List<GetNursingProgressNoteResposeModel> get patientNursingProgressNoteList => _patientNursingProgressNoteList;
List<GetDiagnosisForInPatientResponseModel> _diagnosisForInPatientList = [];
List<GetDiagnosisForInPatientResponseModel> get diagnosisForInPatientList => _diagnosisForInPatientList;
List<GetDiabeticChartValuesResponseModel> _diabeticChartValuesList = [];
List<GetDiabeticChartValuesResponseModel> get diabeticChartValuesList => _diabeticChartValuesList;
// TODO: replace var with model
var _insuranceApporvalsList = [];
@ -465,4 +481,63 @@ class PatientService extends BaseService {
body: _doctorsByClinicIdRequest.toJson(),
);
}
Future getNursingProgressNote(GetNursingProgressNoteRequestModel getNursingProgressNoteRequestModel) async {
hasError = false;
await baseAppClient.post(
NURSING_PROGRESS_NOTE,
onSuccess: (dynamic response, int statusCode) {
_patientNursingProgressNoteList = [];
response['List_NursingProgressNote'].forEach((v) {
_patientNursingProgressNoteList.add( GetNursingProgressNoteResposeModel.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: getNursingProgressNoteRequestModel.toJson(),
);
}
Future getDiagnosisForInPatient(GetDiagnosisForInPatientRequestModel getDiagnosisForInPatientRequestModel) async {
hasError = false;
await baseAppClient.post(
GET_DIAGNOSIS_FOR_IN_PATIENT,
onSuccess: (dynamic response, int statusCode) {
_diagnosisForInPatientList = [];
response['List_DiagnosisForInPatient'].forEach((v) {
_diagnosisForInPatientList.add( GetDiagnosisForInPatientResponseModel.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: getDiagnosisForInPatientRequestModel.toJson(),
);
}
Future getDiabeticChartValues(GetDiabeticChartValuesRequestModel getDiabeticChartValuesRequestModel) async {
hasError = false;
await baseAppClient.post(
GET_DIABETIC_CHART_VALUES,
onSuccess: (dynamic response, int statusCode) {
_diabeticChartValuesList = [];
response['List_DiabeticChartValues'].forEach((v) {
_diabeticChartValuesList.add( GetDiabeticChartValuesResponseModel.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: getDiabeticChartValuesRequestModel.toJson(),
);
}
}

@ -0,0 +1,32 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryReqModel.dart';
import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.dart';
import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart';
import 'package:doctor_app_flutter/models/operation_report/get_operation_details_request_modle.dart';
import 'package:doctor_app_flutter/models/operation_report/get_operation_details_response_modle.dart';
import 'package:doctor_app_flutter/models/operation_report/get_reservations_response_model.dart';
import 'package:doctor_app_flutter/models/operation_report/get_reservations_request_model.dart';
class DischargeSummaryService extends BaseService {
List<GetDischargeSummaryResModel> _pendingDischargeSummaryList = [];
List<GetDischargeSummaryResModel> get pendingDischargeSummaryList => _pendingDischargeSummaryList;
Future getPendingDischargeSummary(
{GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async {
hasError = false;
await baseAppClient.post(GET_PENDING_DISCHARGE_SUMMARY,
onSuccess: (dynamic response, int statusCode) {
_pendingDischargeSummaryList.clear();
response['List_PendingDischargeSummary'].forEach(
(v) {
_pendingDischargeSummaryList.add(GetDischargeSummaryResModel.fromJson(v));
},
);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getDischargeSummaryReqModel.toJson());
}
}

@ -0,0 +1,68 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart';
import 'package:doctor_app_flutter/models/operation_report/get_operation_details_request_modle.dart';
import 'package:doctor_app_flutter/models/operation_report/get_operation_details_response_modle.dart';
import 'package:doctor_app_flutter/models/operation_report/get_reservations_response_model.dart';
import 'package:doctor_app_flutter/models/operation_report/get_reservations_request_model.dart';
class OperationReportService extends BaseService {
List<GetReservationsResponseModel> _reservationList = [];
List<GetReservationsResponseModel> get reservationList => _reservationList;
List<GetOperationDetailsResponseModel> _operationDetailsList = [];
List<GetOperationDetailsResponseModel> get operationDetailsList => _operationDetailsList;
Future getReservations(
{GetReservationsRequestModel getReservationsRequestModel,
int patientId}) async {
getReservationsRequestModel =
GetReservationsRequestModel(patientID: patientId, doctorID: "");
hasError = false;
await baseAppClient.post(GET_RESERVATIONS,
onSuccess: (dynamic response, int statusCode) {
print("Success");
_reservationList.clear();
response['List_OTReservationDetails'].forEach(
(v) {
_reservationList.add(GetReservationsResponseModel.fromJson(v));
},
);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getReservationsRequestModel.toJson());
}
Future getOperationReportDetails(
{GetOperationDetailsRequestModel getOperationReportRequestModel,
}) async {
hasError = false;
await baseAppClient.post(GET_OPERATION_DETAILS,
onSuccess: (dynamic response, int statusCode) {
print("Success");
_operationDetailsList.clear();
response['List_OperationDetails'].forEach(
(v) {
_operationDetailsList.add(GetOperationDetailsResponseModel.fromJson(v));
},
);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getOperationReportRequestModel.toJson());
}
Future updateOperationReport(
CreateUpdateOperationReportRequestModel
createUpdateOperationReport) async {
await baseAppClient.post(UPDATE_OPERATION_REPORT,
onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: createUpdateOperationReport.toJson(), isFallLanguage: true);
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save