Merge branch 'development' into 'master'
Release 6.4 See merge request Cloud_Solution/doctor_app_flutter!853merge-requests/940/merge
commit
4039b3c370
@ -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>
|
|
||||||
@ -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")
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@ -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.Parcel;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.hmg.hmgDr.Model;
|
package com.hmg.hmgDr.model;
|
||||||
|
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
@ -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.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
@ -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.Context
|
||||||
import android.content.res.Resources
|
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.Context
|
||||||
import android.content.res.Resources
|
import android.content.res.Resources
|
||||||
@ -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>
|
||||||
@ -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>
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<paths>
|
||||||
|
<external-path name="external_files" path="."/>
|
||||||
|
</paths>
|
||||||
@ -0,0 +1 @@
|
|||||||
|
include ':app'
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,16 +1,16 @@
|
|||||||
final TOKEN = 'token';
|
const TOKEN = 'token';
|
||||||
final PROJECT_ID = 'projectID';
|
const PROJECT_ID = 'projectID';
|
||||||
final VIDA_AUTH_TOKEN_ID = 'VidaAuthTokenID';
|
const VIDA_AUTH_TOKEN_ID = 'VidaAuthTokenID';
|
||||||
final VIDA_REFRESH_TOKEN_ID = 'VidaRefreshTokenID';
|
const VIDA_REFRESH_TOKEN_ID = 'VidaRefreshTokenID';
|
||||||
final LOGIN_TOKEN_ID = 'LogInToken';
|
const LOGIN_TOKEN_ID = 'LogInToken';
|
||||||
final DOCTOR_ID = 'doctorID';
|
const DOCTOR_ID = 'doctorID';
|
||||||
final SLECTED_PATIENT_TYPE = 'slectedPatientType';
|
const SLECTED_PATIENT_TYPE = 'slectedPatientType';
|
||||||
final APP_Language = 'language';
|
const APP_Language = 'language';
|
||||||
final DOCTOR_PROFILE = 'doctorProfile';
|
const DOCTOR_PROFILE = 'doctorProfile';
|
||||||
final LIVE_CARE_PATIENT = 'livecare-patient-profile';
|
const LIVE_CARE_PATIENT = 'livecare-patient-profile';
|
||||||
final LOGGED_IN_USER = 'loggedUser';
|
const LOGGED_IN_USER = 'loggedUser';
|
||||||
final DASHBOARD_DATA = 'dashboard-data';
|
const EMPLOYEE_ID = 'EmployeeID';
|
||||||
final OTP_TYPE = 'otp-type';
|
const DASHBOARD_DATA = 'dashboard-data';
|
||||||
final LAST_LOGIN_USER = 'last-login-user';
|
const OTP_TYPE = 'otp-type';
|
||||||
final PASSWORD = 'password';
|
const LAST_LOGIN_USER = 'last-login-user';
|
||||||
final CLINIC_NAME = 'clinic-name';
|
const CLINIC_NAME = 'clinic-name';
|
||||||
|
|||||||
@ -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,51 +1,43 @@
|
|||||||
class ActivationCodeModel {
|
class ActivationCodeModel {
|
||||||
String mobileNumber;
|
|
||||||
String zipCode;
|
|
||||||
int channel;
|
int channel;
|
||||||
int languageID;
|
int languageID;
|
||||||
|
int loginDoctorID;
|
||||||
double versionID;
|
double versionID;
|
||||||
int memberID;
|
int memberID;
|
||||||
String password;
|
|
||||||
int facilityId;
|
int facilityId;
|
||||||
String generalid;
|
String generalid;
|
||||||
String otpSendType;
|
String otpSendType;
|
||||||
|
|
||||||
ActivationCodeModel(
|
ActivationCodeModel(
|
||||||
{this.mobileNumber,
|
{this.channel,
|
||||||
this.zipCode,
|
|
||||||
this.channel,
|
|
||||||
this.languageID,
|
this.languageID,
|
||||||
this.versionID,
|
this.versionID,
|
||||||
this.memberID,
|
this.memberID,
|
||||||
this.password,
|
|
||||||
this.facilityId,
|
this.facilityId,
|
||||||
this.otpSendType,
|
this.otpSendType,
|
||||||
this.generalid});
|
this.generalid,this.loginDoctorID});
|
||||||
|
|
||||||
ActivationCodeModel.fromJson(Map<String, dynamic> json) {
|
ActivationCodeModel.fromJson(Map<String, dynamic> json) {
|
||||||
mobileNumber = json['MobileNumber'];
|
|
||||||
zipCode = json['ZipCode'];
|
|
||||||
channel = json['Channel'];
|
channel = json['Channel'];
|
||||||
languageID = json['LanguageID'];
|
languageID = json['LanguageID'];
|
||||||
versionID = json['VersionID'];
|
versionID = json['VersionID'];
|
||||||
memberID = json['MemberID'];
|
memberID = json['MemberID'];
|
||||||
password = json['Password'];
|
|
||||||
facilityId = json['facilityId'];
|
facilityId = json['facilityId'];
|
||||||
otpSendType = json['OTP_SendType'];
|
otpSendType = json['OTP_SendType'];
|
||||||
generalid = json['generalid'];
|
generalid = json['generalid'];
|
||||||
|
loginDoctorID = json['LoginDoctorID'];
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
data['MobileNumber'] = this.mobileNumber;
|
|
||||||
data['ZipCode'] = this.zipCode;
|
|
||||||
data['Channel'] = this.channel;
|
data['Channel'] = this.channel;
|
||||||
data['LanguageID'] = this.languageID;
|
data['LanguageID'] = this.languageID;
|
||||||
data['VersionID'] = this.versionID;
|
data['VersionID'] = this.versionID;
|
||||||
data['MemberID'] = this.memberID;
|
data['MemberID'] = this.memberID;
|
||||||
data['Password'] = this.password;
|
|
||||||
data['facilityId'] = this.facilityId;
|
data['facilityId'] = this.facilityId;
|
||||||
data['OTP_SendType'] = otpSendType;
|
data['OTP_SendType'] = otpSendType;
|
||||||
data['generalid'] = this.generalid;
|
data['generalid'] = this.generalid;
|
||||||
|
data['LoginDoctorID'] = this.loginDoctorID;
|
||||||
return data;
|
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 {
|
||||||
|
int 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,18 +1,22 @@
|
|||||||
class GetOrderedProcedureRequestModel {
|
class GetOrderedProcedureRequestModel {
|
||||||
String vidaAuthTokenID;
|
String vidaAuthTokenID;
|
||||||
int patientMRN;
|
int patientMRN;
|
||||||
|
int appointmentNo;
|
||||||
|
|
||||||
GetOrderedProcedureRequestModel({this.vidaAuthTokenID, this.patientMRN});
|
GetOrderedProcedureRequestModel({this.vidaAuthTokenID, this.patientMRN, this.appointmentNo});
|
||||||
|
|
||||||
GetOrderedProcedureRequestModel.fromJson(Map<String, dynamic> json) {
|
GetOrderedProcedureRequestModel.fromJson(Map<String, dynamic> json) {
|
||||||
vidaAuthTokenID = json['VidaAuthTokenID'];
|
vidaAuthTokenID = json['VidaAuthTokenID'];
|
||||||
patientMRN = json['PatientMRN'];
|
patientMRN = json['PatientMRN'];
|
||||||
|
appointmentNo = json['AppointmentNo'];
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
|
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
|
||||||
data['PatientMRN'] = this.patientMRN;
|
data['PatientMRN'] = this.patientMRN;
|
||||||
|
data['AppointmentNo'] = this.appointmentNo;
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,22 +1,16 @@
|
|||||||
import 'package:firebase_analytics/firebase_analytics.dart';
|
import 'package:firebase_analytics/firebase_analytics.dart';
|
||||||
import 'package:firebase_analytics/observer.dart';
|
import 'package:firebase_analytics/observer.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
|
||||||
class AnalyticsService {
|
class AnalyticsService {
|
||||||
final FirebaseAnalytics _analytics = FirebaseAnalytics();
|
final FirebaseAnalytics _analytics = FirebaseAnalytics();
|
||||||
|
|
||||||
FirebaseAnalyticsObserver getAnalyticsObserver() =>
|
FirebaseAnalyticsObserver getAnalyticsObserver() => FirebaseAnalyticsObserver(analytics: _analytics);
|
||||||
FirebaseAnalyticsObserver(analytics: _analytics);
|
|
||||||
|
|
||||||
Future logEvent(
|
Future logEvent({@required String eventCategory, @required String eventAction}) async {
|
||||||
{String eventCategory,
|
|
||||||
String eventLabel,
|
|
||||||
String eventAction,
|
|
||||||
String eventValue}) async {
|
|
||||||
await _analytics.logEvent(name: 'event', parameters: {
|
await _analytics.logEvent(name: 'event', parameters: {
|
||||||
"eventCategory": eventCategory,
|
"eventCategory": eventCategory,
|
||||||
"eventLabel": eventLabel,
|
|
||||||
"eventAction": eventAction,
|
"eventAction": eventAction,
|
||||||
"eventValue": eventValue
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,22 @@
|
|||||||
|
class GetEpisodeForInpatientReqModel {
|
||||||
|
int patientID;
|
||||||
|
int patientTypeID;
|
||||||
|
int admissionNo;
|
||||||
|
|
||||||
|
GetEpisodeForInpatientReqModel(
|
||||||
|
{this.patientID, this.patientTypeID, this.admissionNo});
|
||||||
|
|
||||||
|
GetEpisodeForInpatientReqModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
patientTypeID = json['PatientTypeID'];
|
||||||
|
admissionNo = json['AdmissionNo'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['PatientTypeID'] = this.patientTypeID;
|
||||||
|
data['AdmissionNo'] = this.admissionNo;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
class PostEpisodeForInpatientRequestModel {
|
||||||
|
int admissionNo;
|
||||||
|
int patientID;
|
||||||
|
int patientTypeID;
|
||||||
|
|
||||||
|
PostEpisodeForInpatientRequestModel(
|
||||||
|
{this.admissionNo, this.patientID, this.patientTypeID = 1});
|
||||||
|
|
||||||
|
PostEpisodeForInpatientRequestModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
admissionNo = json['AdmissionNo'];
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
patientTypeID = json['PatientTypeID'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['AdmissionNo'] = this.admissionNo;
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['PatientTypeID'] = this.patientTypeID;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,54 +0,0 @@
|
|||||||
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
|
|
||||||
|
|
||||||
class MySelectedAllergy {
|
|
||||||
MasterKeyModel selectedAllergySeverity;
|
|
||||||
MasterKeyModel selectedAllergy;
|
|
||||||
String remark;
|
|
||||||
bool isChecked;
|
|
||||||
bool isExpanded;
|
|
||||||
bool isLocal;
|
|
||||||
int createdBy;
|
|
||||||
bool hasValidationError;
|
|
||||||
|
|
||||||
MySelectedAllergy(
|
|
||||||
{this.selectedAllergySeverity,
|
|
||||||
this.selectedAllergy,
|
|
||||||
this.remark,
|
|
||||||
this.isChecked,
|
|
||||||
this.isExpanded = true,
|
|
||||||
this.isLocal = true,
|
|
||||||
this.createdBy,
|
|
||||||
this.hasValidationError = false});
|
|
||||||
|
|
||||||
MySelectedAllergy.fromJson(Map<String, dynamic> json) {
|
|
||||||
selectedAllergySeverity = json['selectedAllergySeverity'] != null
|
|
||||||
? new MasterKeyModel.fromJson(json['selectedAllergySeverity'])
|
|
||||||
: null;
|
|
||||||
selectedAllergy = json['selectedAllergy'] != null
|
|
||||||
? new MasterKeyModel.fromJson(json['selectedAllergy'])
|
|
||||||
: null;
|
|
||||||
remark = json['remark'];
|
|
||||||
isChecked = json['isChecked'];
|
|
||||||
isExpanded = json['isExpanded'];
|
|
||||||
isLocal = json['isLocal'];
|
|
||||||
createdBy = json['createdBy'];
|
|
||||||
hasValidationError = json['hasValidationError'];
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
||||||
if (this.selectedAllergySeverity != null) {
|
|
||||||
data['selectedAllergySeverity'] = this.selectedAllergySeverity.toJson();
|
|
||||||
}
|
|
||||||
if (this.selectedAllergy != null) {
|
|
||||||
data['selectedAllergy'] = this.selectedAllergy.toJson();
|
|
||||||
}
|
|
||||||
data['remark'] = this.remark;
|
|
||||||
data['isChecked'] = this.isChecked;
|
|
||||||
data['isExpanded'] = this.isExpanded;
|
|
||||||
data['createdBy'] = this.createdBy;
|
|
||||||
data['isLocal'] = this.isLocal;
|
|
||||||
data['hasValidationError'] = this.hasValidationError;
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,65 +0,0 @@
|
|||||||
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
|
|
||||||
|
|
||||||
class MySelectedAssessment {
|
|
||||||
MasterKeyModel selectedICD;
|
|
||||||
MasterKeyModel selectedDiagnosisCondition;
|
|
||||||
MasterKeyModel selectedDiagnosisType;
|
|
||||||
String remark;
|
|
||||||
int appointmentId;
|
|
||||||
int createdBy;
|
|
||||||
String createdOn;
|
|
||||||
int doctorID;
|
|
||||||
String doctorName;
|
|
||||||
String icdCode10ID;
|
|
||||||
|
|
||||||
MySelectedAssessment(
|
|
||||||
{this.selectedICD,
|
|
||||||
this.selectedDiagnosisCondition,
|
|
||||||
this.selectedDiagnosisType,
|
|
||||||
this.remark, this.appointmentId, this.createdBy,
|
|
||||||
this.createdOn,
|
|
||||||
this.doctorID,
|
|
||||||
this.doctorName,
|
|
||||||
this.icdCode10ID});
|
|
||||||
|
|
||||||
MySelectedAssessment.fromJson(Map<String, dynamic> json) {
|
|
||||||
selectedICD = json['selectedICD'] != null
|
|
||||||
? new MasterKeyModel.fromJson(json['selectedICD'])
|
|
||||||
: null;
|
|
||||||
selectedDiagnosisCondition = json['selectedDiagnosisCondition'] != null
|
|
||||||
? new MasterKeyModel.fromJson(json['selectedDiagnosisCondition'])
|
|
||||||
: null;
|
|
||||||
selectedDiagnosisType = json['selectedDiagnosisType'] != null
|
|
||||||
? new MasterKeyModel.fromJson(json['selectedDiagnosisType'])
|
|
||||||
: null;
|
|
||||||
remark = json['remark'];
|
|
||||||
appointmentId = json['appointmentId'];
|
|
||||||
createdBy = json['createdBy'];
|
|
||||||
createdOn = json['createdOn'];
|
|
||||||
doctorID = json['doctorID'];
|
|
||||||
doctorName = json['doctorName'];
|
|
||||||
icdCode10ID = json['icdCode10ID'];
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
||||||
|
|
||||||
if (this.selectedICD != null) {
|
|
||||||
data['selectedICD'] = this.selectedICD.toJson();
|
|
||||||
}
|
|
||||||
if (this.selectedDiagnosisCondition != null) {
|
|
||||||
data['selectedICD'] = this.selectedDiagnosisCondition.toJson();
|
|
||||||
}
|
|
||||||
if (this.selectedDiagnosisType != null) {
|
|
||||||
data['selectedICD'] = this.selectedDiagnosisType.toJson();
|
|
||||||
}
|
|
||||||
data['remark'] = this.remark;
|
|
||||||
data['appointmentId'] = this.appointmentId;
|
|
||||||
data['createdBy'] = this.createdBy;
|
|
||||||
data['createdOn'] = this.createdOn;
|
|
||||||
data['doctorID'] = this.doctorID;
|
|
||||||
data['doctorName'] = this.doctorName;
|
|
||||||
data['icdCode10ID'] = this.icdCode10ID;
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,61 +0,0 @@
|
|||||||
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
|
|
||||||
|
|
||||||
class MySelectedExamination {
|
|
||||||
MasterKeyModel selectedExamination;
|
|
||||||
String remark;
|
|
||||||
bool isNormal;
|
|
||||||
bool isAbnormal;
|
|
||||||
bool notExamined;
|
|
||||||
bool isNew;
|
|
||||||
bool isLocal;
|
|
||||||
int createdBy;
|
|
||||||
String createdOn;
|
|
||||||
String editedOn;
|
|
||||||
|
|
||||||
MySelectedExamination({
|
|
||||||
this.selectedExamination,
|
|
||||||
this.remark,
|
|
||||||
this.isNormal = false,
|
|
||||||
this.isAbnormal = false,
|
|
||||||
this.notExamined = true,
|
|
||||||
this.isNew = true,
|
|
||||||
this.isLocal = true,
|
|
||||||
this.createdBy,
|
|
||||||
this.createdOn,
|
|
||||||
this.editedOn,
|
|
||||||
});
|
|
||||||
|
|
||||||
MySelectedExamination.fromJson(Map<String, dynamic> json) {
|
|
||||||
selectedExamination = json['selectedExamination'] != null
|
|
||||||
? new MasterKeyModel.fromJson(json['selectedExamination'])
|
|
||||||
: null;
|
|
||||||
remark = json['remark'];
|
|
||||||
isNormal = json['isNormal'];
|
|
||||||
isAbnormal = json['isAbnormal'];
|
|
||||||
notExamined = json['notExamined'];
|
|
||||||
isNew = json['isNew'];
|
|
||||||
createdBy = json['createdBy'];
|
|
||||||
createdOn = json['createdOn'];
|
|
||||||
editedOn = json['editedOn'];
|
|
||||||
isLocal = json['isLocal'];
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
||||||
|
|
||||||
if (this.selectedExamination != null) {
|
|
||||||
data['selectedExamination'] = this.selectedExamination.toJson();
|
|
||||||
}
|
|
||||||
data['remark'] = this.remark;
|
|
||||||
data['isNormal'] = this.isNormal;
|
|
||||||
data['isAbnormal'] = this.isAbnormal;
|
|
||||||
data['notExamined'] = this.notExamined;
|
|
||||||
data['isNew'] = this.isNew;
|
|
||||||
data['createdBy'] = this.createdBy;
|
|
||||||
data['createdOn'] = this.createdOn;
|
|
||||||
data['editedOn'] = this.editedOn;
|
|
||||||
data['isLocal'] = this.isLocal;
|
|
||||||
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
|
|
||||||
|
|
||||||
class MySelectedHistory {
|
|
||||||
MasterKeyModel selectedHistory;
|
|
||||||
String remark;
|
|
||||||
bool isChecked;
|
|
||||||
bool isLocal;
|
|
||||||
|
|
||||||
MySelectedHistory(
|
|
||||||
{ this.selectedHistory, this.remark, this.isChecked, this.isLocal = true});
|
|
||||||
|
|
||||||
MySelectedHistory.fromJson(Map<String, dynamic> json) {
|
|
||||||
|
|
||||||
selectedHistory = json['selectedHistory'] != null
|
|
||||||
? new MasterKeyModel.fromJson(json['selectedHistory'])
|
|
||||||
: null;
|
|
||||||
remark = json['remark'];
|
|
||||||
remark = json['isChecked'];
|
|
||||||
isLocal = json['isLocal'];
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
||||||
|
|
||||||
if (this.selectedHistory != null) {
|
|
||||||
data['selectedHistory'] = this.selectedHistory.toJson();
|
|
||||||
}
|
|
||||||
data['remark'] = this.remark;
|
|
||||||
data['isChecked'] = this.remark;
|
|
||||||
data['isLocal'] = this.isLocal;
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
|
||||||
|
|
||||||
|
class MySelectedAllergy {
|
||||||
|
MasterKeyModel selectedAllergySeverity;
|
||||||
|
MasterKeyModel selectedAllergy;
|
||||||
|
String remark;
|
||||||
|
bool isChecked;
|
||||||
|
bool isExpanded;
|
||||||
|
bool isLocal;
|
||||||
|
int createdBy;
|
||||||
|
bool hasValidationError;
|
||||||
|
|
||||||
|
MySelectedAllergy(
|
||||||
|
{this.selectedAllergySeverity,
|
||||||
|
this.selectedAllergy,
|
||||||
|
this.remark,
|
||||||
|
this.isChecked,
|
||||||
|
this.isExpanded = true,
|
||||||
|
this.isLocal = true,
|
||||||
|
this.createdBy,
|
||||||
|
this.hasValidationError = false});
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
|
||||||
|
|
||||||
|
class MySelectedAssessment {
|
||||||
|
MasterKeyModel selectedICD;
|
||||||
|
MasterKeyModel selectedDiagnosisCondition;
|
||||||
|
MasterKeyModel selectedDiagnosisType;
|
||||||
|
String remark;
|
||||||
|
int appointmentId;
|
||||||
|
int createdBy;
|
||||||
|
String createdOn;
|
||||||
|
int doctorID;
|
||||||
|
String doctorName;
|
||||||
|
String icdCode10ID;
|
||||||
|
|
||||||
|
MySelectedAssessment(
|
||||||
|
{this.selectedICD,
|
||||||
|
this.selectedDiagnosisCondition,
|
||||||
|
this.selectedDiagnosisType,
|
||||||
|
this.remark, this.appointmentId, this.createdBy,
|
||||||
|
this.createdOn,
|
||||||
|
this.doctorID,
|
||||||
|
this.doctorName,
|
||||||
|
this.icdCode10ID});
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
|
||||||
|
|
||||||
|
class MySelectedExamination {
|
||||||
|
MasterKeyModel selectedExamination;
|
||||||
|
String remark;
|
||||||
|
bool isNormal;
|
||||||
|
bool isAbnormal;
|
||||||
|
bool notExamined;
|
||||||
|
bool isNew;
|
||||||
|
bool isLocal;
|
||||||
|
int createdBy;
|
||||||
|
String createdOn;
|
||||||
|
String editedOn;
|
||||||
|
|
||||||
|
MySelectedExamination({
|
||||||
|
this.selectedExamination,
|
||||||
|
this.remark,
|
||||||
|
this.isNormal = false,
|
||||||
|
this.isAbnormal = false,
|
||||||
|
this.notExamined = true,
|
||||||
|
this.isNew = true,
|
||||||
|
this.isLocal = true,
|
||||||
|
this.createdBy,
|
||||||
|
this.createdOn,
|
||||||
|
this.editedOn,
|
||||||
|
});
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
|
||||||
|
|
||||||
|
class MySelectedHistory {
|
||||||
|
MasterKeyModel selectedHistory;
|
||||||
|
String remark;
|
||||||
|
bool isChecked;
|
||||||
|
bool isLocal;
|
||||||
|
|
||||||
|
MySelectedHistory(
|
||||||
|
{this.selectedHistory, this.remark, this.isChecked, this.isLocal = true});
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue