Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into special_clinic

 Conflicts:
	lib/config/config.dart
merge-requests/742/head
Elham Rababah 4 years ago
commit c46c339933

@ -39,7 +39,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.hmg.hmgDr"
minSdkVersion 18
minSdkVersion 21
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
@ -54,6 +54,11 @@ android {
signingConfig signingConfigs.debug
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
flutter {
@ -74,9 +79,10 @@ dependencies {
//permissions
implementation 'pub.devrel:easypermissions:0.4.0'
//retrofit
implementation 'com.squareup.retrofit2:retrofit:2.6.2'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
implementation 'com.squareup.okhttp3:logging-interceptor:3.14.1'
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1'
}
apply plugin: 'com.google.gms.google-services'

@ -9,12 +9,19 @@
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here.
-->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<application
android:name="io.flutter.app.FlutterApplication"
android:icon="@mipmap/ic_launcher"

@ -45,8 +45,9 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler
val tokenID = call.argument<String>("TokenID")
val generalId = call.argument<String>("generalId")
val doctorId = call.argument<Int>("DoctorId")
val patientName = call.argument<String>("patientName")
val sessionStatusModel = GetSessionStatusModel(VC_ID, tokenID, generalId, doctorId)
val sessionStatusModel = GetSessionStatusModel(VC_ID, tokenID, generalId, doctorId, patientName)
openVideoCall(apiKey, sessionId, token, appLang, baseUrl, sessionStatusModel)

@ -20,15 +20,19 @@ public class GetSessionStatusModel implements Parcelable {
@SerializedName("DoctorId")
@Expose
private Integer doctorId;
@SerializedName("PatientName")
@Expose
private String patientName;
public GetSessionStatusModel() {
}
public GetSessionStatusModel(Integer vCID, String tokenID, String generalid, Integer doctorId) {
public GetSessionStatusModel(Integer vCID, String tokenID, String generalid, Integer doctorId, String patientName) {
this.vCID = vCID;
this.tokenID = tokenID;
this.generalid = generalid;
this.doctorId = doctorId;
this.patientName = patientName;
}
protected GetSessionStatusModel(Parcel in) {
@ -44,6 +48,7 @@ public class GetSessionStatusModel implements Parcelable {
} else {
doctorId = in.readInt();
}
patientName = in.readString();
}
public static final Creator<GetSessionStatusModel> CREATOR = new Creator<GetSessionStatusModel>() {
@ -90,6 +95,16 @@ public class GetSessionStatusModel implements Parcelable {
this.doctorId = doctorId;
}
public String getPatientName() {
if (patientName == null)
patientName = "-";
return patientName;
}
public void setPatientName(String patientName) {
this.patientName = patientName;
}
@Override
public int describeContents() {
return 0;
@ -111,5 +126,6 @@ public class GetSessionStatusModel implements Parcelable {
dest.writeByte((byte) 1);
dest.writeInt(doctorId);
}
dest.writeString(patientName);
}
}

@ -11,8 +11,10 @@ import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.os.SystemClock;
import android.util.Log;
import android.view.View;
import android.widget.Chronometer;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.ProgressBar;
@ -75,7 +77,13 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
private boolean isSpeckerClicked;
private boolean isMicClicked;
private TextView patientName;
private Chronometer cmTimer;
long elapsedTime;
Boolean resume = false;
private ImageView mCallBtn;
private ImageView btnMinimize;
private ImageView mCameraBtn;
private ImageView mSwitchCameraBtn;
private ImageView mspeckerBtn;
@ -128,14 +136,14 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
@Override
protected void onDestroy() {
disconnectSession();
cmTimer.stop();
super.onDestroy();
}
@SuppressLint("ClickableViewAccessibility")
private void initUI() {
mPublisherViewContainer = (FrameLayout) findViewById(R.id.local_video_view_container);
mSubscriberViewContainer = (RelativeLayout) findViewById(R.id.remote_video_view_container);
mPublisherViewContainer = findViewById(R.id.local_video_view_container);
mSubscriberViewContainer = findViewById(R.id.remote_video_view_container);
apiKey = getIntent().getStringExtra("apiKey");
sessionId = getIntent().getStringExtra("sessionId");
@ -148,8 +156,28 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
videoCallPresenter = new VideoCallPresenterImpl(this, baseUrl);
patientName = findViewById(R.id.patient_name);
patientName.setText(sessionStatusModel.getPatientName());
cmTimer = findViewById(R.id.cmTimer);
cmTimer.setFormat("mm:ss");
cmTimer.setOnChronometerTickListener(arg0 -> {
long minutes;
long seconds;
if (!resume) {
minutes = ((SystemClock.elapsedRealtime() - cmTimer.getBase()) / 1000) / 60;
seconds = ((SystemClock.elapsedRealtime() - cmTimer.getBase()) / 1000) % 60;
elapsedTime = SystemClock.elapsedRealtime();
} else {
minutes = ((elapsedTime - cmTimer.getBase()) / 1000) / 60;
seconds = ((elapsedTime - cmTimer.getBase()) / 1000) % 60;
elapsedTime = elapsedTime + 1000;
}
Log.d(TAG, "onChronometerTick: " + minutes + " : " + seconds);
});
mCallBtn = findViewById(R.id.btn_call);
btnMinimize = findViewById(R.id.btn_minimize);
mCameraBtn = findViewById(R.id.btn_camera);
mSwitchCameraBtn = findViewById(R.id.btn_switch_camera);
mspeckerBtn = findViewById(R.id.btn_specker);
@ -184,17 +212,13 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
videoCallPresenter.callClintConnected(sessionStatusModel);
}
};
mConnectedHandler.postDelayed(mConnectedRunnable, 30 * 1000);
mConnectedHandler.postDelayed(mConnectedRunnable, 55 * 1000);
}
private void hiddenButtons() {
mVolHandler = new Handler();
mVolRunnable = new Runnable() {
public void run() {
controlPanel.setVisibility(View.GONE);
}
};
mVolRunnable = () -> controlPanel.setVisibility(View.GONE);
mVolHandler.postDelayed(mVolRunnable, 5 * 1000);
}
@ -256,6 +280,11 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
}
mSession.publish(mPublisher);
if (!resume) {
cmTimer.setBase(SystemClock.elapsedRealtime());
}
cmTimer.start();
}
@Override
@ -263,14 +292,15 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
Log.d(TAG, "onDisconnected: disconnected from session " + session.getSessionId());
mSession = null;
cmTimer.stop();
}
@Override
public void onError(Session session, OpentokError opentokError) {
Log.d(TAG, "onError: Error (" + opentokError.getMessage() + ") in session " + session.getSessionId());
Toast.makeText(this, "Session error. See the logcat please.", Toast.LENGTH_LONG).show();
finish();
// Toast.makeText(this, "Session error. See the logcat please.", Toast.LENGTH_LONG).show();
//finish();
}
@Override
@ -282,6 +312,8 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
}
isConnected = true;
subscribeToStream(stream);
if(mConnectedHandler!=null && mConnectedRunnable!=null)
mConnectedHandler.removeCallbacks(mConnectedRunnable);
videoCallPresenter.callChangeCallStatus(new ChangeCallStatusRequestModel(3,sessionStatusModel.getDoctorId(), sessionStatusModel.getGeneralid(),token,sessionStatusModel.getVCID()));
}
@ -315,8 +347,8 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
public void onError(PublisherKit publisherKit, OpentokError opentokError) {
Log.d(TAG, "onError: Error (" + opentokError.getMessage() + ") in publisher");
Toast.makeText(this, "Session error. See the logcat please.", Toast.LENGTH_LONG).show();
finish();
// Toast.makeText(this, "onError: Error (" + opentokError.getMessage() + ") in publisher", Toast.LENGTH_LONG).show();
// finish();
}
@Override
@ -379,6 +411,10 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
finish();
}
public void onMinimizedClicked(View view) {
}
public void onSwitchCameraClicked(View view) {
if (mPublisher != null) {
isSwitchCameraClicked = !isSwitchCameraClicked;
@ -427,6 +463,10 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
returnIntent.putExtra("sessionStatusNotRespond", sessionStatusModel);
setResult(Activity.RESULT_OK, returnIntent);
finish();
} else if( sessionStatusModel.getSessionStatus() == 4 ){
isConnected = true;
if(mConnectedHandler!=null && mConnectedRunnable!=null)
mConnectedHandler.removeCallbacks(mConnectedRunnable);
}
}

@ -0,0 +1,16 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M8,8l-2,0l0,9l11,0l0,-2l-9,0z"/>
<path
android:fillColor="@android:color/white"
android:pathData="M22,3H10v10h12V3zM20,11h-8V7h8V11z"/>
<path
android:fillColor="@android:color/white"
android:pathData="M4,12l-2,0l0,9l11,0l0,-2l-9,0z"/>
</vector>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="1000dp"/>
<solid android:color="@color/green_dark"/>
</shape>

@ -1,169 +1,181 @@
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_clingo_video_call"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.VideoCallActivity">
android:background="@color/text_color"
android:orientation="vertical">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_horizontal"
android:keepScreenOn="true"
android:clickable="true">
<LinearLayout
android:id="@+id/subscriberview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/padding_space_big">
<TextView
android:id="@+id/patient_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toStartOf="@+id/video_counter_fl"
android:textColor="@color/white"
android:textSize="@dimen/text_size_big"
android:textStyle="bold"
tools:text="Mousa Abuzaid" />
<FrameLayout
android:id="@+id/video_counter_fl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:orientation="horizontal"/>
android:layout_alignParentEnd="true"
android:background="@drawable/shape_capsule"
android:padding="@dimen/padding_space_small">
<Chronometer
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
tools:text="25:45"
android:textColor="@color/white"
android:textStyle="bold"
android:id="@+id/cmTimer" />
</FrameLayout>
<RelativeLayout
android:id="@+id/publisherview"
android:layout_height="200dp"
android:layout_width="150dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingRight="@dimen/activity_horizontal_margin" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/remote_video_view_container"
android:id="@+id/activity_clingo_video_call"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/remoteBackground">
android:layout_height="0dp"
android:layout_weight="1"
tools:context=".ui.VideoCallActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:gravity="center_horizontal"
android:keepScreenOn="true">
<LinearLayout
android:id="@+id/subscriberview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:orientation="horizontal" />
<RelativeLayout
android:id="@+id/publisherview"
android:layout_width="150dp"
android:layout_height="200dp"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/remote_video_view_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/icon_padding">
android:background="@color/remoteBackground">
<ImageView
android:layout_width="@dimen/remote_back_icon_size"
android:layout_height="@dimen/remote_back_icon_size"
android:layout_centerInParent="true"
android:src="@drawable/video_off_fill" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/icon_padding"
android:layout_width="match_parent"
android:layout_height="@dimen/remote_back_icon_margin_bottom"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
<FrameLayout
android:id="@+id/local_video_view_container"
android:layout_width="@dimen/local_preview_width"
android:layout_height="@dimen/local_preview_height"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginEnd="@dimen/local_preview_margin_right"
android:layout_marginRight="@dimen/local_preview_margin_right"
android:layout_marginTop="@dimen/local_preview_margin_top"
android:background="@color/localBackground">
<FrameLayout
android:id="@+id/local_video_view_container"
android:layout_width="@dimen/local_preview_width"
android:layout_height="@dimen/local_preview_height"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="@dimen/local_preview_margin_top"
android:layout_marginEnd="@dimen/local_preview_margin_right"
android:background="@color/localBackground">
<ImageView
android:layout_width="@dimen/local_back_icon_size"
android:layout_height="@dimen/local_back_icon_size"
android:layout_gravity="center"
android:scaleType="centerCrop"
android:src="@drawable/video_off_fill" />
</FrameLayout>
<ImageView
android:layout_width="@dimen/local_back_icon_size"
android:layout_height="@dimen/local_back_icon_size"
android:layout_gravity="center"
android:scaleType="centerCrop"
android:src="@drawable/video_off_fill" />
</FrameLayout>
<ImageView
android:id="@+id/btn_switch_camera"
android:layout_width="@dimen/video_icon_size"
android:layout_height="@dimen/video_icon_size"
android:layout_centerVertical="true"
android:layout_below="@+id/local_video_view_container"
android:layout_marginTop="@dimen/local_preview_margin_top"
android:layout_marginEnd="@dimen/local_preview_margin_right"
android:layout_alignParentEnd="true"
android:onClick="onSwitchCameraClicked"
android:scaleType="centerCrop"
android:src="@drawable/flip_enabled" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/control_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="60dp">
android:padding="@dimen/padding_space_big_2">
<ImageView
android:id="@+id/btn_call"
android:layout_width="71dp"
android:layout_height="71dp"
android:layout_centerInParent="true"
android:layout_width="@dimen/video_icon_size"
android:layout_height="@dimen/video_icon_size"
android:layout_alignParentEnd="true"
android:onClick="onCallClicked"
android:scaleType="centerCrop"
android:src="@drawable/call" />
<ImageView
android:id="@+id/btn_switch_camera"
android:layout_width="39dp"
android:layout_height="39dp"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/control_bottom_horizontal_margin"
android:layout_toEndOf="@id/btn_camera"
android:layout_toRightOf="@id/btn_camera"
android:onClick="onSwitchCameraClicked"
android:id="@+id/btn_minimize"
android:layout_width="@dimen/video_icon_size"
android:layout_height="@dimen/video_icon_size"
android:layout_alignParentStart="true"
android:onClick="onMinimizedClicked"
android:layout_marginEnd="@dimen/padding_space_small"
android:scaleType="centerCrop"
android:src="@drawable/flip_enabled" />
android:src="@drawable/ic_mini" />
<ImageView
android:id="@+id/btn_camera"
android:layout_width="39dp"
android:layout_height="39dp"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/control_bottom_horizontal_margin"
android:layout_toEndOf="@id/btn_call"
android:layout_toRightOf="@id/btn_call"
android:layout_width="@dimen/video_icon_size"
android:layout_height="@dimen/video_icon_size"
android:layout_toEndOf="@id/btn_minimize"
android:onClick="onCameraClicked"
android:scaleType="centerCrop"
android:layout_marginEnd="@dimen/padding_space_small"
android:src="@drawable/video_enabled" />
<ImageView
android:id="@+id/btn_mic"
android:layout_width="39dp"
android:layout_height="39dp"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/control_bottom_horizontal_margin"
android:layout_toStartOf="@id/btn_call"
android:layout_toLeftOf="@id/btn_call"
android:layout_width="@dimen/video_icon_size"
android:layout_height="@dimen/video_icon_size"
android:layout_toEndOf="@id/btn_camera"
android:onClick="onMicClicked"
android:layout_marginEnd="@dimen/padding_space_small"
android:scaleType="centerCrop"
android:src="@drawable/mic_enabled" />
<ImageView
android:id="@+id/btn_specker"
android:layout_width="39dp"
android:layout_height="39dp"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/control_bottom_horizontal_margin"
android:layout_toStartOf="@id/btn_mic"
android:layout_toLeftOf="@id/btn_mic"
android:layout_width="@dimen/video_icon_size"
android:layout_height="@dimen/video_icon_size"
android:layout_toEndOf="@id/btn_mic"
android:onClick="onSpeckerClicked"
android:scaleType="centerCrop"
android:layout_marginEnd="@dimen/padding_space_small"
android:src="@drawable/audio_enabled" />
</RelativeLayout>
</LinearLayout>
<!-- <RelativeLayout-->
<!-- android:id="@+id/progressBar"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="40dp"-->
<!-- android:layout_alignParentBottom="true">-->
<!-- <ProgressBar-->
<!-- android:id="@+id/progress_bar"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="31dp"-->
<!-- android:layout_alignParentEnd="true"-->
<!-- android:layout_alignParentBottom="true"-->
<!-- android:layout_marginEnd="0dp"-->
<!-- android:layout_marginBottom="0dp"-->
<!-- android:progressBackgroundTint="@color/colorProgressBarBackground"-->
<!-- style="@android:style/Widget.ProgressBar.Horizontal" />-->
<!-- <TextView-->
<!-- android:id="@+id/progress_bar_text"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginLeft="9dp"-->
<!-- android:gravity="center_vertical"-->
<!-- android:textColor="@color/colorPrimary"-->
<!-- android:layout_centerInParent="true"/>-->
<!-- </RelativeLayout>-->
</RelativeLayout>

@ -8,4 +8,10 @@
<!-- Chat Activity -->
<color name="localBackground">#827b92</color>
<color name="remoteBackground">#484258</color>
<color name="text_color">#FF2E303A</color>
<color name="white">#fff</color>
<color name="black">#000</color>
<color name="green_dark">#389842</color>
<color name="red_dark">#d51e26</color>
</resources>

@ -8,7 +8,11 @@
<!-- buttons -->
<dimen name="call_button_size">60dp</dimen>
<dimen name="other_button_size">54dp</dimen>
<dimen name="video_icon_size">64dp</dimen>
<!-- buttons -->
<dimen name="control_bottom_margin">24dp</dimen>
<dimen name="control_bottom_horizontal_margin">25dp</dimen>
<dimen name="local_preview_width">88dp</dimen>
<dimen name="local_preview_height">117dp</dimen>
@ -16,7 +20,16 @@
<dimen name="remote_back_icon_size">100dp</dimen>
<dimen name="remote_back_icon_margin_bottom">90dp</dimen>
<!-- buttons -->
<dimen name="control_bottom_margin">24dp</dimen>
<dimen name="control_bottom_horizontal_margin">25dp</dimen>
<!-- text-->
<dimen name="text_size_small">14sp</dimen>
<dimen name="text_size_medium">16sp</dimen>
<dimen name="text_size_big">24sp</dimen>
<!-- padding/margin-->
<dimen name="padding_space_small">4dp</dimen>
<dimen name="padding_space_medium">8sp</dimen>
<dimen name="padding_space_big">16dp</dimen>
<dimen name="padding_space_big_2">24dp</dimen>
</resources>

@ -16,10 +16,12 @@ allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://tokbox.bintray.com/maven' }
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"

@ -1,327 +0,0 @@
PODS:
- Alamofire (5.4.3)
- barcode_scan_fix (0.0.1):
- Flutter
- MTBBarcodeScanner
- connectivity (0.0.1):
- Flutter
- Reachability
- connectivity_for_web (0.1.0):
- Flutter
- connectivity_macos (0.0.1):
- Flutter
- device_info (0.0.1):
- Flutter
- Firebase/CoreOnly (6.33.0):
- FirebaseCore (= 6.10.3)
- Firebase/Messaging (6.33.0):
- Firebase/CoreOnly
- FirebaseMessaging (~> 4.7.0)
- firebase_core (0.5.3):
- Firebase/CoreOnly (~> 6.33.0)
- Flutter
- firebase_core_web (0.1.0):
- Flutter
- firebase_messaging (7.0.3):
- Firebase/CoreOnly (~> 6.33.0)
- Firebase/Messaging (~> 6.33.0)
- firebase_core
- Flutter
- FirebaseCore (6.10.3):
- FirebaseCoreDiagnostics (~> 1.6)
- GoogleUtilities/Environment (~> 6.7)
- GoogleUtilities/Logger (~> 6.7)
- FirebaseCoreDiagnostics (1.7.0):
- GoogleDataTransport (~> 7.4)
- GoogleUtilities/Environment (~> 6.7)
- GoogleUtilities/Logger (~> 6.7)
- nanopb (~> 1.30906.0)
- FirebaseInstallations (1.7.0):
- FirebaseCore (~> 6.10)
- GoogleUtilities/Environment (~> 6.7)
- GoogleUtilities/UserDefaults (~> 6.7)
- PromisesObjC (~> 1.2)
- FirebaseInstanceID (4.8.0):
- FirebaseCore (~> 6.10)
- FirebaseInstallations (~> 1.6)
- GoogleUtilities/Environment (~> 6.7)
- GoogleUtilities/UserDefaults (~> 6.7)
- FirebaseMessaging (4.7.1):
- FirebaseCore (~> 6.10)
- FirebaseInstanceID (~> 4.7)
- GoogleUtilities/AppDelegateSwizzler (~> 6.7)
- GoogleUtilities/Environment (~> 6.7)
- GoogleUtilities/Reachability (~> 6.7)
- GoogleUtilities/UserDefaults (~> 6.7)
- Protobuf (>= 3.9.2, ~> 3.9)
- Flutter (1.0.0)
- flutter_flexible_toast (0.0.1):
- Flutter
- flutter_inappwebview (0.0.1):
- Flutter
- flutter_plugin_android_lifecycle (0.0.1):
- Flutter
- GoogleDataTransport (7.5.1):
- nanopb (~> 1.30906.0)
- GoogleUtilities/AppDelegateSwizzler (6.7.2):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
- GoogleUtilities/Network
- GoogleUtilities/Environment (6.7.2):
- PromisesObjC (~> 1.2)
- GoogleUtilities/Logger (6.7.2):
- GoogleUtilities/Environment
- GoogleUtilities/Network (6.7.2):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (6.7.2)"
- GoogleUtilities/Reachability (6.7.2):
- GoogleUtilities/Logger
- GoogleUtilities/UserDefaults (6.7.2):
- GoogleUtilities/Logger
- hexcolor (0.0.1):
- Flutter
- imei_plugin (0.0.1):
- Flutter
- local_auth (0.0.1):
- Flutter
- maps_launcher (0.0.1):
- Flutter
- MTBBarcodeScanner (5.0.11)
- nanopb (1.30906.0):
- nanopb/decode (= 1.30906.0)
- nanopb/encode (= 1.30906.0)
- nanopb/decode (1.30906.0)
- nanopb/encode (1.30906.0)
- OpenTok (2.15.3)
- path_provider_linux (0.0.1):
- Flutter
- path_provider_windows (0.0.1):
- Flutter
- "permission_handler (5.1.0+2)":
- Flutter
- PromisesObjC (1.2.12)
- Protobuf (3.17.0)
- Reachability (3.2)
- screen (0.0.1):
- Flutter
- shared_preferences (0.0.1):
- Flutter
- shared_preferences_linux (0.0.1):
- Flutter
- shared_preferences_macos (0.0.1):
- Flutter
- shared_preferences_web (0.0.1):
- Flutter
- shared_preferences_windows (0.0.1):
- Flutter
- speech_to_text (0.0.1):
- Flutter
- Try
- Try (2.1.1)
- url_launcher (0.0.1):
- Flutter
- url_launcher_linux (0.0.1):
- Flutter
- url_launcher_macos (0.0.1):
- Flutter
- url_launcher_web (0.0.1):
- Flutter
- url_launcher_windows (0.0.1):
- Flutter
- video_player (0.0.1):
- Flutter
- video_player_web (0.0.1):
- Flutter
- wakelock (0.0.1):
- Flutter
- webview_flutter (0.0.1):
- Flutter
DEPENDENCIES:
- Alamofire (~> 5.2)
- barcode_scan_fix (from `.symlinks/plugins/barcode_scan_fix/ios`)
- connectivity (from `.symlinks/plugins/connectivity/ios`)
- connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`)
- connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`)
- device_info (from `.symlinks/plugins/device_info/ios`)
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
- firebase_core_web (from `.symlinks/plugins/firebase_core_web/ios`)
- firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`)
- Flutter (from `Flutter`)
- flutter_flexible_toast (from `.symlinks/plugins/flutter_flexible_toast/ios`)
- flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`)
- flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`)
- hexcolor (from `.symlinks/plugins/hexcolor/ios`)
- imei_plugin (from `.symlinks/plugins/imei_plugin/ios`)
- local_auth (from `.symlinks/plugins/local_auth/ios`)
- maps_launcher (from `.symlinks/plugins/maps_launcher/ios`)
- OpenTok
- path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`)
- path_provider_windows (from `.symlinks/plugins/path_provider_windows/ios`)
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
- screen (from `.symlinks/plugins/screen/ios`)
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
- shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`)
- shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`)
- shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`)
- shared_preferences_windows (from `.symlinks/plugins/shared_preferences_windows/ios`)
- speech_to_text (from `.symlinks/plugins/speech_to_text/ios`)
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
- url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`)
- url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`)
- url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`)
- url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`)
- video_player (from `.symlinks/plugins/video_player/ios`)
- video_player_web (from `.symlinks/plugins/video_player_web/ios`)
- wakelock (from `.symlinks/plugins/wakelock/ios`)
- webview_flutter (from `.symlinks/plugins/webview_flutter/ios`)
SPEC REPOS:
trunk:
- Alamofire
- Firebase
- FirebaseCore
- FirebaseCoreDiagnostics
- FirebaseInstallations
- FirebaseInstanceID
- FirebaseMessaging
- GoogleDataTransport
- GoogleUtilities
- MTBBarcodeScanner
- nanopb
- OpenTok
- PromisesObjC
- Protobuf
- Reachability
- Try
EXTERNAL SOURCES:
barcode_scan_fix:
:path: ".symlinks/plugins/barcode_scan_fix/ios"
connectivity:
:path: ".symlinks/plugins/connectivity/ios"
connectivity_for_web:
:path: ".symlinks/plugins/connectivity_for_web/ios"
connectivity_macos:
:path: ".symlinks/plugins/connectivity_macos/ios"
device_info:
:path: ".symlinks/plugins/device_info/ios"
firebase_core:
:path: ".symlinks/plugins/firebase_core/ios"
firebase_core_web:
:path: ".symlinks/plugins/firebase_core_web/ios"
firebase_messaging:
:path: ".symlinks/plugins/firebase_messaging/ios"
Flutter:
:path: Flutter
flutter_flexible_toast:
:path: ".symlinks/plugins/flutter_flexible_toast/ios"
flutter_inappwebview:
:path: ".symlinks/plugins/flutter_inappwebview/ios"
flutter_plugin_android_lifecycle:
:path: ".symlinks/plugins/flutter_plugin_android_lifecycle/ios"
hexcolor:
:path: ".symlinks/plugins/hexcolor/ios"
imei_plugin:
:path: ".symlinks/plugins/imei_plugin/ios"
local_auth:
:path: ".symlinks/plugins/local_auth/ios"
maps_launcher:
:path: ".symlinks/plugins/maps_launcher/ios"
path_provider_linux:
:path: ".symlinks/plugins/path_provider_linux/ios"
path_provider_windows:
:path: ".symlinks/plugins/path_provider_windows/ios"
permission_handler:
:path: ".symlinks/plugins/permission_handler/ios"
screen:
:path: ".symlinks/plugins/screen/ios"
shared_preferences:
:path: ".symlinks/plugins/shared_preferences/ios"
shared_preferences_linux:
:path: ".symlinks/plugins/shared_preferences_linux/ios"
shared_preferences_macos:
:path: ".symlinks/plugins/shared_preferences_macos/ios"
shared_preferences_web:
:path: ".symlinks/plugins/shared_preferences_web/ios"
shared_preferences_windows:
:path: ".symlinks/plugins/shared_preferences_windows/ios"
speech_to_text:
:path: ".symlinks/plugins/speech_to_text/ios"
url_launcher:
:path: ".symlinks/plugins/url_launcher/ios"
url_launcher_linux:
:path: ".symlinks/plugins/url_launcher_linux/ios"
url_launcher_macos:
:path: ".symlinks/plugins/url_launcher_macos/ios"
url_launcher_web:
:path: ".symlinks/plugins/url_launcher_web/ios"
url_launcher_windows:
:path: ".symlinks/plugins/url_launcher_windows/ios"
video_player:
:path: ".symlinks/plugins/video_player/ios"
video_player_web:
:path: ".symlinks/plugins/video_player_web/ios"
wakelock:
:path: ".symlinks/plugins/wakelock/ios"
webview_flutter:
:path: ".symlinks/plugins/webview_flutter/ios"
SPEC CHECKSUMS:
Alamofire: e447a2774a40c996748296fa2c55112fdbbc42f9
barcode_scan_fix: 80dd65de55f27eec6591dd077c8b85f2b79e31f1
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b
connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5
firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659
firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1
firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75
FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd
FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1
FirebaseInstallations: 466c7b4d1f58fe16707693091da253726a731ed2
FirebaseInstanceID: bd3ffc24367f901a43c063b36c640b345a4a5dd1
FirebaseMessaging: 5eca4ef173de76253352511aafef774caa1cba2a
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
flutter_flexible_toast: 0547e740cae0c33bb7c51bcd931233f4584e1143
flutter_inappwebview: 69dfbac46157b336ffbec19ca6dfd4638c7bf189
flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35
GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833
GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3
hexcolor: fdfb9c4258ad96e949c2dbcdf790a62194b8aa89
imei_plugin: cb1af7c223ac2d82dcd1457a7137d93d65d2a3cd
local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd
maps_launcher: eae38ee13a9c3f210fa04e04bb4c073fa4c6ed92
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc
OpenTok: fde03ecc5ea31fe0a453242847c4ee1f47e1d735
path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4
path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b
permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0
PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97
Protobuf: 7327d4444215b5f18e560a97f879ff5503c4581c
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
screen: abd91ca7bf3426e1cc3646d27e9b2358d6bf07b0
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78
shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087
shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9
shared_preferences_windows: 36b76d6f54e76ead957e60b49e2f124b4cd3e6ae
speech_to_text: b43a7d99aef037bd758ed8e45d79bbac035d2dfe
Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0
url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313
url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c
url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5
video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e
video_player_web: da8cadb8274ed4f8dbee8d7171b420dedd437ce7
wakelock: 0d4a70faf8950410735e3f61fb15d517c8a6efc4
webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96
PODFILE CHECKSUM: d0a3789a37635365b4345e456835ed9d30398217
COCOAPODS: 1.10.1

@ -31,7 +31,7 @@ class ViewController: UIViewController {
var callBack: ICallProtocol?
var timer = Timer()
var seconds = 30
var seconds = 55
var isUserConnect : Bool = false

@ -3,6 +3,7 @@ import 'dart:io' show Platform;
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/service/NavigationService.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
@ -12,6 +13,9 @@ import 'package:flutter/cupertino.dart';
import 'package:http/http.dart' as http;
import 'package:provider/provider.dart';
import '../locator.dart';
import '../routes.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Helpers helpers = new Helpers();
@ -116,7 +120,9 @@ class BaseAppClient {
await Provider.of<AuthenticationViewModel>(AppGlobal.CONTEX,
listen: false)
.logout();
Helpers.showErrorToast('Your session expired Please login again');
locator<NavigationService>().pushNamedAndRemoveUntil(ROOT);
}
if (isAllowAny) {
onFailure(getError(parsed), statusCode);

@ -56,6 +56,8 @@ const ADD_REFERRED_DOCTOR_REMARKS = 'Services/DoctorApplication.svc/REST/AddRefe
const GET_MY_REFERRED_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredPatient';
const GET_MY_REFERRED_OUT_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredOutPatient';
const GET_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/PendingReferrals';
const CREATE_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/CreateReferral';
@ -89,6 +91,7 @@ const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/RES
const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles';
const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin';
const SEND_SMS_INSTRUCTIONS = 'LiveCareApi/DoctorApp/SendSMSInstruction';
const GET_ALTERNATIVE_SERVICE = 'LiveCareApi/DoctorApp/GetAlternativeServices';
const END_CALL = 'LiveCareApi/DoctorApp/EndCall';
const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge';
@ -178,6 +181,8 @@ const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults";
const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient";
const GET_MY_REFERRAL_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient";
const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient";
const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient";
@ -219,6 +224,7 @@ const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/RE
const DOCTOR_CHECK_HAS_LIVE_CARE = "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare";
const LIVE_CARE_IS_LOGIN = "LiveCareApi/DoctorApp/UseIsLogin";
const ADD_REFERRED_REMARKS_NEW = "Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks_New";
const GET_SPECIAL_CLINICAL_CARE_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareList";
var selectedPatientType = 1;

@ -712,7 +712,7 @@ const Map<String, Map<String, String>> localizedValues = {
'days': {'en': "Days", 'ar': "أيام"},
'months': {'en': "Months", 'ar': "أشهر"},
'years': {'en': "Years", 'ar': "سنين"},
'hr': {'en': "HR", 'ar': "س"},
'hr': {'en': "Hr", 'ar': "س"},
'min': {'en': "Min", 'ar': "د"},
'appointmentNumber': {'en': "Appointment Number", 'ar': "رقم الموعد"},
'referralStatusHold': {'en': "Hold", 'ar': "معلق"},
@ -1008,4 +1008,6 @@ const Map<String, Map<String, String>> localizedValues = {
"allLab": {"en": "All Lab", "ar": "جميع المختبرات"},
"allPrescription": {"en": "All Prescription", "ar": "جميع الوصفات"},
"addPrescription": {"en": "Add prescription", "ar": "إضافة الوصفات"},
"edit": {"en": "Edit", "ar": "تعديل"},
"summeryReply": {"en": "Summary Reply", "ar": "موجز الرد"},
};

@ -0,0 +1,4 @@
enum PatientType{
IN_PATIENT,
OUT_PATIENT,
}

@ -11,6 +11,7 @@ class AlternativeService {
AlternativeService.fromJson(Map<String, dynamic> json) {
serviceID = json['ServicID'];
serviceName = json['ServiceName'];
isSelected = false;
}
Map<String, dynamic> toJson() {

@ -61,71 +61,74 @@ class MyReferralPatientModel {
String priorityDescription;
String referringClinicDescription;
String referringDoctorName;
int referalStatus;
MyReferralPatientModel(
{this.rowID,
this.projectID,
this.lineItemNo,
this.doctorID,
this.patientID,
this.doctorName,
this.doctorNameN,
this.firstName,
this.middleName,
this.lastName,
this.firstNameN,
this.middleNameN,
this.lastNameN,
this.gender,
this.dateofBirth,
this.mobileNumber,
this.emailAddress,
this.patientIdentificationNo,
this.patientType,
this.admissionNo,
this.admissionDate,
this.roomID,
this.bedID,
this.nursingStationID,
this.description,
this.nationalityName,
this.nationalityNameN,
this.clinicDescription,
this.clinicDescriptionN,
this.referralDoctor,
this.referringDoctor,
this.referralClinic,
this.referringClinic,
this.referralStatus,
this.referralDate,
this.referringDoctorRemarks,
this.referredDoctorRemarks,
this.referralResponseOn,
this.priority,
this.frequency,
this.mAXResponseTime,
this.episodeID,
this.appointmentNo,
this.appointmentDate,
this.appointmentType,
this.patientMRN,
this.createdOn,
this.clinicID,
this.nationalityID,
this.age,
this.doctorImageURL,
this.frequencyDescription,
this.genderDescription,
this.isDoctorLate,
this.isDoctorResponse,
this.nationalityFlagURL,
this.nursingStationName,
this.priorityDescription,
this.referringClinicDescription,
this.referringDoctorName});
this.projectID,
this.lineItemNo,
this.doctorID,
this.patientID,
this.doctorName,
this.doctorNameN,
this.firstName,
this.middleName,
this.lastName,
this.firstNameN,
this.middleNameN,
this.lastNameN,
this.gender,
this.dateofBirth,
this.mobileNumber,
this.emailAddress,
this.patientIdentificationNo,
this.patientType,
this.admissionNo,
this.admissionDate,
this.roomID,
this.bedID,
this.nursingStationID,
this.description,
this.nationalityName,
this.nationalityNameN,
this.clinicDescription,
this.clinicDescriptionN,
this.referralDoctor,
this.referringDoctor,
this.referralClinic,
this.referringClinic,
this.referralStatus,
this.referralDate,
this.referringDoctorRemarks,
this.referredDoctorRemarks,
this.referralResponseOn,
this.priority,
this.frequency,
this.mAXResponseTime,
this.episodeID,
this.appointmentNo,
this.appointmentDate,
this.appointmentType,
this.patientMRN,
this.createdOn,
this.clinicID,
this.nationalityID,
this.age,
this.doctorImageURL,
this.frequencyDescription,
this.genderDescription,
this.isDoctorLate,
this.isDoctorResponse,
this.nationalityFlagURL,
this.nursingStationName,
this.priorityDescription,
this.referringClinicDescription,
this.referringDoctorName,
this.referalStatus});
MyReferralPatientModel.fromJson(Map<String, dynamic> json) {
rowID = json['RowID'];
referalStatus = json['ReferalStatus'];
projectID = json['ProjectID'];
lineItemNo = json['LineItemNo'];
doctorID = json['DoctorID'];
@ -158,8 +161,21 @@ class MyReferralPatientModel {
referringDoctor = json['ReferringDoctor'];
referralClinic = json['ReferralClinic'];
referringClinic = json['ReferringClinic'];
referralStatus = json['ReferralStatus'];
referralDate = AppDateUtils.convertStringToDate(json['ReferralDate']);
referralStatus = json["ReferralStatus"] is String
? json['ReferralStatus'] == "Accepted"
? 46
: json['ReferralStatus'] == "Pending"
? 1
: 0
: json["ReferralStatus"];
try {
referralDate = AppDateUtils.getDateTimeFromString(json['ReferralDate']);
} catch (e) {
referralDate = AppDateUtils.convertStringToDate(json['ReferralDate']);
} finally {
referralDate = DateTime.now();
}
referringDoctorRemarks = json['ReferringDoctorRemarks'];
referredDoctorRemarks = json['ReferredDoctorRemarks'];
referralResponseOn = json['ReferralResponseOn'];
@ -190,6 +206,7 @@ class MyReferralPatientModel {
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['RowID'] = this.rowID;
data['ReferalStatus'] = this.referalStatus;
data['ProjectID'] = this.projectID;
data['LineItemNo'] = this.lineItemNo;
data['DoctorID'] = this.doctorID;
@ -253,6 +270,6 @@ class MyReferralPatientModel {
}
get patientName {
return this.firstName+" "+this.lastName;
return this.firstName + " " + this.lastName;
}
}

@ -0,0 +1,104 @@
class MyReferralPatientRequestModel {
int channel;
int clinicID;
int doctorID;
int editedBy;
String firstName;
String from;
String iPAdress;
bool isLoginForDoctorApp;
int languageID;
String lastName;
String middleName;
int patientID;
String patientIdentificationID;
String patientMobileNumber;
bool patientOutSA;
int patientTypeID;
int projectID;
String sessionID;
String stamp;
String to;
String tokenID;
double versionID;
String vidaAuthTokenID;
MyReferralPatientRequestModel(
{this.channel,
this.clinicID,
this.doctorID,
this.editedBy,
this.firstName,
this.from,
this.iPAdress,
this.isLoginForDoctorApp,
this.languageID,
this.lastName,
this.middleName,
this.patientID,
this.patientIdentificationID,
this.patientMobileNumber,
this.patientOutSA,
this.patientTypeID,
this.projectID,
this.sessionID,
this.stamp,
this.to,
this.tokenID,
this.versionID,
this.vidaAuthTokenID});
MyReferralPatientRequestModel.fromJson(Map<String, dynamic> json) {
channel = json['Channel'];
clinicID = json['ClinicID'];
doctorID = json['DoctorID'];
editedBy = json['EditedBy'];
firstName = json['FirstName'];
from = json['From'];
iPAdress = json['IPAdress'];
isLoginForDoctorApp = json['IsLoginForDoctorApp'];
languageID = json['LanguageID'];
lastName = json['LastName'];
middleName = json['MiddleName'];
patientID = json['PatientID'];
patientIdentificationID = json['PatientIdentificationID'];
patientMobileNumber = json['PatientMobileNumber'];
patientOutSA = json['PatientOutSA'];
patientTypeID = json['PatientTypeID'];
projectID = json['ProjectID'];
sessionID = json['SessionID'];
stamp = json['stamp'];
to = json['To'];
tokenID = json['TokenID'];
versionID = json['VersionID'];
vidaAuthTokenID = json['VidaAuthTokenID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Channel'] = this.channel;
data['ClinicID'] = this.clinicID;
data['DoctorID'] = this.doctorID;
data['EditedBy'] = this.editedBy;
data['FirstName'] = this.firstName;
data['From'] = this.from;
data['IPAdress'] = this.iPAdress;
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
data['LanguageID'] = this.languageID;
data['LastName'] = this.lastName;
data['MiddleName'] = this.middleName;
data['PatientID'] = this.patientID;
data['PatientIdentificationID'] = this.patientIdentificationID;
data['PatientMobileNumber'] = this.patientMobileNumber;
data['PatientOutSA'] = this.patientOutSA;
data['PatientTypeID'] = this.patientTypeID;
data['ProjectID'] = this.projectID;
data['SessionID'] = this.sessionID;
data['stamp'] = this.stamp;
data['To'] = this.to;
data['TokenID'] = this.tokenID;
data['VersionID'] = this.versionID;
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
return data;
}
}

@ -0,0 +1,72 @@
class AddReferredRemarksRequestModel {
int projectID;
int admissionNo;
int lineItemNo;
String referredDoctorRemarks;
int editedBy;
int referalStatus;
bool isLoginForDoctorApp;
String iPAdress;
bool patientOutSA;
String tokenID;
int languageID;
double versionID;
int channel;
String sessionID;
int deviceTypeID;
AddReferredRemarksRequestModel(
{this.projectID,
this.admissionNo,
this.lineItemNo,
this.referredDoctorRemarks,
this.editedBy,
this.referalStatus,
this.isLoginForDoctorApp,
this.iPAdress,
this.patientOutSA,
this.tokenID,
this.languageID,
this.versionID,
this.channel,
this.sessionID,
this.deviceTypeID});
AddReferredRemarksRequestModel.fromJson(Map<String, dynamic> json) {
projectID = json['ProjectID'];
admissionNo = json['AdmissionNo'];
lineItemNo = json['LineItemNo'];
referredDoctorRemarks = json['ReferredDoctorRemarks'];
editedBy = json['EditedBy'];
referalStatus = json['ReferalStatus'];
isLoginForDoctorApp = json['IsLoginForDoctorApp'];
iPAdress = json['IPAdress'];
patientOutSA = json['PatientOutSA'];
tokenID = json['TokenID'];
languageID = json['LanguageID'];
versionID = json['VersionID'];
channel = json['Channel'];
sessionID = json['SessionID'];
deviceTypeID = json['DeviceTypeID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ProjectID'] = this.projectID;
data['AdmissionNo'] = this.admissionNo;
data['LineItemNo'] = this.lineItemNo;
data['ReferredDoctorRemarks'] = this.referredDoctorRemarks;
data['EditedBy'] = this.editedBy;
data['ReferalStatus'] = this.referalStatus;
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
data['IPAdress'] = this.iPAdress;
data['PatientOutSA'] = this.patientOutSA;
data['TokenID'] = this.tokenID;
data['LanguageID'] = this.languageID;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['SessionID'] = this.sessionID;
data['DeviceTypeID'] = this.deviceTypeID;
return data;
}
}

@ -0,0 +1,12 @@
import 'package:flutter/material.dart';
class NavigationService {
final GlobalKey<NavigatorState> navigatorKey =
new GlobalKey<NavigatorState>();
Future<dynamic> navigateTo(String routeName) {
return navigatorKey.currentState.pushNamed(routeName);
}
Future<dynamic> pushNamedAndRemoveUntil(String routeName) {
return navigatorKey.currentState.pushNamedAndRemoveUntil(routeName,(asd)=>false);
}
}

@ -1,4 +1,3 @@
import 'dart:collection';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/live_care/AlternativeServicesList.dart';
@ -19,7 +18,7 @@ class LiveCarePatientServices extends BaseService {
bool _isFinished = false;
bool _isLive = false;
bool _isLive = true;
bool get isFinished => _isFinished;
@ -75,7 +74,7 @@ class LiveCarePatientServices extends BaseService {
}, body: startCallReq.toJson(), isLiveCare: _isLive);
}
Future endCallWithCharge(int vcID, String altServiceList) async {
Future endCallWithCharge(int vcID, List<int> altServiceList) async {
hasError = false;
await baseAppClient.post(END_CALL_WITH_CHARGE, onSuccess: (dynamic response, int statusCode) {
endCallResponse = response;
@ -85,6 +84,7 @@ class LiveCarePatientServices extends BaseService {
}, body: {
"VC_ID": vcID,
"AltServiceList": altServiceList,
"generalid":GENERAL_ID
}, isLiveCare: _isLive);
}
@ -102,8 +102,23 @@ class LiveCarePatientServices extends BaseService {
}, isLiveCare: _isLive);
}
Future sendSMSInstruction(int vcID) async {
hasError = false;
await baseAppClient.post(SEND_SMS_INSTRUCTIONS,
onSuccess: (dynamic response, int statusCode) {
transferToAdminResponse = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: {
"VC_ID": vcID, "generalid": GENERAL_ID
}, isLiveCare: _isLive);
}
Future isLogin({LiveCareUserLoginRequestModel isLoginRequestModel, int loginStatus}) async {
hasError = false;
await getDoctorProfile( );
isLoginRequestModel.doctorId = super.doctorProfile.doctorID;
await baseAppClient.post(LIVE_CARE_IS_LOGIN, onSuccess: (response, statusCode) async {
isLoginResponse = response;
}, onFailure: (String error, int statusCode) {
@ -126,6 +141,7 @@ class LiveCarePatientServices extends BaseService {
super.error = error;
}, body: {
"VC_ID": vcID,
}, isLiveCare: _isLive);
"generalid": GENERAL_ID
}, isLiveCare: _isLive);
}
}

@ -1,5 +1,7 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart';
import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientRequestModel.dart';
import 'package:doctor_app_flutter/core/model/referral/add_referred_remarks_request.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart';
@ -8,22 +10,21 @@ class MyReferralInPatientService extends BaseService {
Future getMyReferralPatientService() async {
hasError = false;
Map<String, dynamic> body = Map();
await getDoctorProfile();
body['DoctorID'] = doctorProfile.doctorID;
body['FirstName'] = "0";
body['MiddleName'] = "0";
body['LastName'] = "0";
body['PatientMobileNumber'] = "0";
body['PatientIdentificationID'] = "0";
body['PatientID'] = 0;
body['From'] = "0";
body['To'] = "0";
body['stamp'] = DateTime.now().toIso8601String();
body['IsLoginForDoctorApp'] = true;
body['IPAdress'] = "11.11.11.11";
body['PatientOutSA'] = false;
body['PatientTypeID'] = 1;
MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel(
doctorID: doctorProfile.doctorID,
firstName: "0",
middleName: "0",
lastName: "0",
patientMobileNumber: "0",
patientIdentificationID: "0",
patientID: 0,
from: "0",
to: "0",
stamp: DateTime.now().toIso8601String(),
isLoginForDoctorApp: true,
patientTypeID: 1);
myReferralPatients.clear();
await baseAppClient.post(
GET_MY_REFERRAL_INPATIENT,
@ -38,22 +39,53 @@ class MyReferralInPatientService extends BaseService {
hasError = true;
super.error = error;
},
body: body,
body: myReferralPatientRequestModel.toJson(),
);
}
Future getMyReferralOutPatientService() async {
hasError = false;
await getDoctorProfile();
MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel(
doctorID: doctorProfile.doctorID,
firstName: "0",
middleName: "0",
lastName: "0",
patientMobileNumber: "0",
patientIdentificationID: "0",
patientID: 0,
from: "0",
to: "0",
stamp: DateTime.now().toIso8601String(),
isLoginForDoctorApp: true,
patientTypeID: 1);
myReferralPatients.clear();
await baseAppClient.post(
GET_MY_REFERRAL_OUT_PATIENT,
onSuccess: (dynamic response, int statusCode) {
if (response['List_MyOutPatientReferral'] != null) {
response['List_MyOutPatientReferral'].forEach((v) {
myReferralPatients.add(MyReferralPatientModel.fromJson(v));
});
}
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: myReferralPatientRequestModel.toJson(),
);
}
Future replay(
String referredDoctorRemarks, MyReferralPatientModel referral) async {
Future replay(String referredDoctorRemarks, MyReferralPatientModel referral) async {
hasError = false;
await getDoctorProfile();
RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks =
RequestAddReferredDoctorRemarks();
RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks();
_requestAddReferredDoctorRemarks.projectID = referral.projectID;
_requestAddReferredDoctorRemarks.admissionNo =
referral.admissionNo.toString();
_requestAddReferredDoctorRemarks.admissionNo = referral.admissionNo.toString();
_requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo;
_requestAddReferredDoctorRemarks.referredDoctorRemarks =
referredDoctorRemarks;
_requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks;
_requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID;
_requestAddReferredDoctorRemarks.patientID = referral.patientID;
_requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor;
@ -67,4 +99,32 @@ class MyReferralInPatientService extends BaseService {
},
);
}
Future replayReferred(String referredDoctorRemarks, MyReferralPatientModel referral, int referalStatus) async {
hasError = false;
await getDoctorProfile();
AddReferredRemarksRequestModel _requestAddReferredDoctorRemarks = AddReferredRemarksRequestModel(
editedBy: doctorProfile.doctorID,
projectID: doctorProfile.projectID,
referredDoctorRemarks: referredDoctorRemarks,
referalStatus: referalStatus);
_requestAddReferredDoctorRemarks.projectID = referral.projectID;
_requestAddReferredDoctorRemarks.admissionNo = int.parse(referral.admissionNo);
_requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo;
_requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks;
_requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID;
_requestAddReferredDoctorRemarks.referalStatus = referalStatus;
// _requestAddReferredDoctorRemarks.patientID = referral.patientID;
// _requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor;
await baseAppClient.post(
ADD_REFERRED_REMARKS_NEW,
body: _requestAddReferredDoctorRemarks.toJson(),
onSuccess: (dynamic body, int statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
);
}
}

@ -157,6 +157,36 @@ class PatientReferralService extends LookupService {
);
}
Future getMyReferredOutPatient() async {
hasError = false;
RequestMyReferralPatientModel _requestMyReferralPatient =
RequestMyReferralPatientModel();
DoctorProfileModel doctorProfile = await getDoctorProfile();
await baseAppClient.post(
GET_MY_REFERRED_OUT_PATIENT,
onSuccess: (dynamic response, int statusCode) {
listMyReferredPatientModel.clear();
response['List_MyReferredOutPatient'].forEach((v) {
MyReferredPatientModel item = MyReferredPatientModel.fromJson(v);
if (doctorProfile != null) {
item.isReferralDoctorSameBranch =
doctorProfile.projectID == item.projectID;
} else {
item.isReferralDoctorSameBranch = false;
}
listMyReferredPatientModel.add(item);
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _requestMyReferralPatient.toJson(),
);
}
Future getPendingReferralList() async {
hasError = false;
DoctorProfileModel doctorProfile = await getDoctorProfile();

@ -1,36 +0,0 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/doctor/verify_referral_doctor_remarks.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart';
import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart';
class ReferredPatientService extends BaseService {
List<MyReferredPatientModel> _listMyReferredPatientModel = [];
List<MyReferredPatientModel> get listMyReferredPatientModel =>
_listMyReferredPatientModel;
RequestMyReferralPatientModel _requestMyReferralPatient =
RequestMyReferralPatientModel();
VerifyReferralDoctorRemarks _verifyreferraldoctorremarks =
VerifyReferralDoctorRemarks();
Future getMyReferredPatient() async {
await baseAppClient.post(
GET_MY_REFERRED_PATIENT,
onSuccess: (dynamic response, int statusCode) {
_listMyReferredPatientModel.clear();
response['List_MyReferredPatient'].forEach((v) {
listMyReferredPatientModel.add(MyReferredPatientModel.fromJson(v));
});
// print(response['List_MyReferredPatient']);
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _requestMyReferralPatient.toJson(),
);
}
}

@ -101,13 +101,13 @@ class LiveCarePatientViewModel extends BaseViewModel {
Future endCallWithCharge(int vcID, bool isConfirmed) async {
setState(ViewState.BusyLocal);
String selectedServicesString = "";
List<int> selectedServices = [];
if (isConfirmed) {
selectedServicesString = getSelectedAlternativeServices();
selectedServices = getSelectedAlternativeServices();
}
await _liveCarePatientServices.endCallWithCharge(
vcID, selectedServicesString);
vcID, selectedServices);
if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error;
setState(ViewState.ErrorLocal);
@ -117,14 +117,14 @@ class LiveCarePatientViewModel extends BaseViewModel {
}
}
String getSelectedAlternativeServices() {
List<int> getSelectedAlternativeServices() {
List<int> selectedServices = List();
for (AlternativeService service in alternativeServicesList) {
if (service.isSelected) {
selectedServices.add(service.serviceID);
}
}
return selectedServices.toString();
return selectedServices;
}
Future getAlternativeServices(int vcID) async {
@ -150,6 +150,18 @@ class LiveCarePatientViewModel extends BaseViewModel {
}
}
Future sendSMSInstruction(int vcID) async {
setState(ViewState.BusyLocal);
await _liveCarePatientServices.sendSMSInstruction(vcID);
if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error;
setState(ViewState.ErrorLocal);
} else {
await getPendingPatientERForDoctorApp();
setState(ViewState.Idle);
}
}
searchData(String str) {
var strExist = str.length > 0 ? true : false;
if (strExist) {

@ -25,12 +25,24 @@ class PatientMedicalReportViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
bool hasOnHold(){
bool hasHold = false;
medicalReportList.forEach((element) {
if(element.status == 1){
hasHold = true;
}
});
return hasHold;
}
Future getMedicalReportTemplate() async {
setState(ViewState.Busy);
setState(ViewState.BusyLocal);
await _service.getMedicalReportTemplate();
if (_service.hasError) {
error = _service.error;
setState(ViewState.Error);
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}

@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/referral/DischargeReferralPatient.dart';
import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart';
import 'package:doctor_app_flutter/core/model/referral/add_referred_remarks_request.dart';
import 'package:doctor_app_flutter/core/service/patient/DischargedPatientService.dart';
import 'package:doctor_app_flutter/core/service/patient/MyReferralPatientService.dart';
import 'package:doctor_app_flutter/core/service/patient/ReferralService.dart';
@ -18,16 +19,14 @@ import 'package:flutter/cupertino.dart';
import '../../locator.dart';
class PatientReferralViewModel extends BaseViewModel {
PatientReferralService _referralPatientService =
locator<PatientReferralService>();
PatientReferralService _referralPatientService = locator<PatientReferralService>();
ReferralService _referralService = locator<ReferralService>();
MyReferralInPatientService _myReferralService =
locator<MyReferralInPatientService>();
MyReferralInPatientService _myReferralService = locator<MyReferralInPatientService>();
DischargedPatientService _dischargedPatientService = locator<DischargedPatientService>();
DischargedPatientService _dischargedPatientService =
locator<DischargedPatientService>();
List<DischargeReferralPatient> get myDischargeReferralPatient =>
_dischargedPatientService.myDischargeReferralPatients;
@ -35,28 +34,21 @@ class PatientReferralViewModel extends BaseViewModel {
List<dynamic> get clinicsList => _referralPatientService.clinicsList;
List<dynamic> get referralFrequencyList =>
_referralPatientService.frequencyList;
List<dynamic> get referralFrequencyList => _referralPatientService.frequencyList;
List<dynamic> doctorsList = [];
List<ClinicDoctor> get clinicDoctorsList =>
_referralPatientService.doctorsList;
List<ClinicDoctor> get clinicDoctorsList => _referralPatientService.doctorsList;
List<MyReferralPatientModel> get myReferralPatients =>
_myReferralService.myReferralPatients;
List<MyReferralPatientModel> get myReferralPatients => _myReferralService.myReferralPatients;
List<MyReferredPatientModel> get listMyReferredPatientModel =>
_referralPatientService.listMyReferredPatientModel;
List<MyReferredPatientModel> get listMyReferredPatientModel => _referralPatientService.listMyReferredPatientModel;
List<PendingReferral> get pendingReferral =>
_referralPatientService.pendingReferralList;
List<PendingReferral> get pendingReferral => _referralPatientService.pendingReferralList;
List<PendingReferral> get patientReferral =>
_referralPatientService.patientReferralList;
List<PendingReferral> get patientReferral => _referralPatientService.patientReferralList;
List<PatiantInformtion> get patientArrivalList =>
_referralPatientService.patientArrivalList;
List<PatiantInformtion> get patientArrivalList => _referralPatientService.patientArrivalList;
Future getPatientReferral(PatiantInformtion patient) async {
setState(ViewState.Busy);
@ -105,8 +97,7 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getClinicDoctors(
PatiantInformtion patient, int clinicId, int branchId) async {
Future getClinicDoctors(PatiantInformtion patient, int clinicId, int branchId) async {
setState(ViewState.BusyLocal);
await _referralPatientService.getDoctorsList(patient, clinicId, branchId);
if (_referralPatientService.hasError) {
@ -124,17 +115,17 @@ class PatientReferralViewModel extends BaseViewModel {
Future<dynamic> getDoctorBranch() async {
DoctorProfileModel doctorProfile = await getDoctorProfile();
if (doctorProfile != null) {
dynamic _selectedBranch = {
"facilityId": doctorProfile.projectID,
"facilityName": doctorProfile.projectName
};
dynamic _selectedBranch = {"facilityId": doctorProfile.projectID, "facilityName": doctorProfile.projectName};
return _selectedBranch;
}
return null;
}
Future getMyReferredPatient() async {
setState(ViewState.Busy);
Future getMyReferredPatient({bool isFirstTime = true}) async {
if (isFirstTime)
setState(ViewState.Busy);
else
setState(ViewState.BusyLocal);
await _referralPatientService.getMyReferredPatient();
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
@ -143,6 +134,19 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getMyReferredOutPatient({bool isFirstTime = true}) async {
if (isFirstTime)
setState(ViewState.Busy);
else
setState(ViewState.BusyLocal);
await _referralPatientService.getMyReferredOutPatient();
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
MyReferredPatientModel getReferredPatientItem(int index) {
return listMyReferredPatientModel[index];
}
@ -157,18 +161,39 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getMyReferralPatientService() async {
setState(ViewState.Busy);
Future getMyReferralPatientService({bool localBusy = false}) async {
if (localBusy)
setState(ViewState.BusyLocal);
else
setState(ViewState.Busy);
await _myReferralService.getMyReferralPatientService();
if (_myReferralService.hasError) {
error = _myReferralService.error;
setState(ViewState.Error);
if (localBusy)
setState(ViewState.ErrorLocal);
else
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future replay(
String referredDoctorRemarks, MyReferralPatientModel referral) async {
Future getMyReferralOutPatientService({bool localBusy = false}) async {
if (localBusy)
setState(ViewState.BusyLocal);
else
setState(ViewState.Busy);
await _myReferralService.getMyReferralOutPatientService();
if (_myReferralService.hasError) {
error = _myReferralService.error;
if (localBusy)
setState(ViewState.ErrorLocal);
else
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future replay(String referredDoctorRemarks, MyReferralPatientModel referral) async {
setState(ViewState.Busy);
await _myReferralService.replay(referredDoctorRemarks, referral);
if (_myReferralService.hasError) {
@ -178,8 +203,7 @@ class PatientReferralViewModel extends BaseViewModel {
getMyReferralPatientService();
}
Future responseReferral(
PendingReferral pendingReferral, bool isAccepted) async {
Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async {
setState(ViewState.Busy);
await _referralPatientService.responseReferral(pendingReferral, isAccepted);
if (_referralPatientService.hasError) {
@ -189,11 +213,10 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future makeReferral(PatiantInformtion patient, String isoStringDate,
int projectID, int clinicID, int doctorID, String remarks) async {
Future makeReferral(PatiantInformtion patient, String isoStringDate, int projectID, int clinicID, int doctorID,
String remarks) async {
setState(ViewState.Busy);
await _referralPatientService.makeReferral(
patient, isoStringDate, projectID, clinicID, doctorID, remarks);
await _referralPatientService.makeReferral(patient, isoStringDate, projectID, clinicID, doctorID, remarks);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
@ -233,12 +256,10 @@ class PatientReferralViewModel extends BaseViewModel {
}
}
Future getPatientDetails(
String fromDate, String toDate, int patientMrn, int appointmentNo) async {
Future getPatientDetails(String fromDate, String toDate, int patientMrn, int appointmentNo) async {
setState(ViewState.Busy);
await _referralPatientService.getPatientArrivalList(toDate,
fromDate: fromDate, patientMrn: patientMrn);
await _referralPatientService.getPatientArrivalList(toDate, fromDate: fromDate, patientMrn: patientMrn);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
@ -257,8 +278,7 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future verifyReferralDoctorRemarks(
MyReferredPatientModel referredPatient) async {
Future verifyReferralDoctorRemarks(MyReferredPatientModel referredPatient) async {
setState(ViewState.Busy);
await _referralPatientService.verifyReferralDoctorRemarks(referredPatient);
if (_referralPatientService.hasError) {
@ -297,8 +317,7 @@ class PatientReferralViewModel extends BaseViewModel {
}
}
PatiantInformtion getPatientFromReferral(
MyReferredPatientModel referredPatient) {
PatiantInformtion getPatientFromReferral(MyReferredPatientModel referredPatient) {
PatiantInformtion patient = PatiantInformtion();
patient.doctorId = referredPatient.doctorID;
patient.doctorName = referredPatient.doctorName;
@ -323,8 +342,7 @@ class PatientReferralViewModel extends BaseViewModel {
return patient;
}
PatiantInformtion getPatientFromReferralO(
MyReferralPatientModel referredPatient) {
PatiantInformtion getPatientFromReferralO(MyReferralPatientModel referredPatient) {
PatiantInformtion patient = PatiantInformtion();
patient.doctorId = referredPatient.doctorID;
patient.doctorName = referredPatient.doctorName;
@ -349,8 +367,7 @@ class PatientReferralViewModel extends BaseViewModel {
return patient;
}
PatiantInformtion getPatientFromDischargeReferralPatient(
DischargeReferralPatient referredPatient) {
PatiantInformtion getPatientFromDischargeReferralPatient(DischargeReferralPatient referredPatient) {
PatiantInformtion patient = PatiantInformtion();
patient.doctorId = referredPatient.doctorID;
patient.doctorName = referredPatient.doctorName;
@ -369,10 +386,19 @@ class PatientReferralViewModel extends BaseViewModel {
patient.roomId = referredPatient.roomID;
patient.bedId = referredPatient.bedID;
patient.nationalityName = referredPatient.nationalityName;
patient.nationalityFlagURL =
''; // TODO from backend referredPatient.nationalityFlagURL;
patient.nationalityFlagURL = ''; // TODO from backend referredPatient.nationalityFlagURL;
patient.age = referredPatient.age;
patient.clinicDescription = referredPatient.clinicDescription;
return patient;
}
Future replayReferred(String referredDoctorRemarks, MyReferralPatientModel referral, int referalStatus) async {
setState(ViewState.Busy);
await _myReferralService.replayReferred(referredDoctorRemarks, referral, referalStatus);
if (_myReferralService.hasError) {
error = _myReferralService.error;
setState(ViewState.ErrorLocal);
} else
getMyReferralPatientService();
}
}

@ -1,24 +0,0 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/patient/referred_patient_service.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart';
import '../../locator.dart';
import 'base_view_model.dart';
class ReferredPatientViewModel extends BaseViewModel {
ReferredPatientService _referralPatientService =
locator<ReferredPatientService>();
List<MyReferredPatientModel> get listMyReferredPatientModel =>
_referralPatientService.listMyReferredPatientModel;
Future getMyReferredPatient() async {
setState(ViewState.Busy);
await _referralPatientService.getMyReferredPatient();
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
}

@ -8,35 +8,35 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:get_it/get_it.dart';
import 'core/service/NavigationService.dart';
import 'core/service/home/dasboard_service.dart';
import 'core/service/home/doctor_reply_service.dart';
import 'core/service/home/schedule_service.dart';
import 'core/service/hospitals/hospitals_service.dart';
import 'core/service/patient/DischargedPatientService.dart';
import 'core/service/patient/LiveCarePatientServices.dart';
import 'core/service/patient/patient_service.dart';
import 'core/service/patient_medical_file/insurance/InsuranceCardService.dart';
import 'core/service/patient/MyReferralPatientService.dart';
import 'core/service/patient/PatientMuseService.dart';
import 'core/service/patient/ReferralService.dart';
import 'core/service/patient/out_patient_service.dart';
import 'core/service/patient/patient-doctor-referral-service.dart';
import 'core/service/patient/patientInPatientService.dart';
import 'core/service/patient/patient_service.dart';
import 'core/service/patient/referral_patient_service.dart';
import 'core/service/patient_medical_file/admission_request/patient-admission-request-service.dart';
import 'core/service/patient_medical_file/insurance/InsuranceCardService.dart';
import 'core/service/patient_medical_file/lab_order/labs_service.dart';
import 'core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart';
import 'core/service/patient_medical_file/medical_report/medical_file_service.dart';
import 'core/service/patient_medical_file/prescription/medicine_service.dart';
import 'core/service/patient_medical_file/prescription/prescription_service.dart';
import 'core/service/patient_medical_file/prescription/prescriptions_service.dart';
import 'core/service/patient_medical_file/procedure/procedure_service.dart';
import 'core/service/patient_medical_file/radiology/radiology_service.dart';
import 'core/service/patient_medical_file/sick_leave/sickleave_service.dart';
import 'core/service/patient_medical_file/soap/SOAP_service.dart';
import 'core/service/home/doctor_reply_service.dart';
import 'core/service/hospitals/hospitals_service.dart';
import 'core/service/patient_medical_file/lab_order/labs_service.dart';
import 'core/service/patient_medical_file/prescription/medicine_service.dart';
import 'core/service/patient_medical_file/admission_request/patient-admission-request-service.dart';
import 'core/service/patient/patient-doctor-referral-service.dart';
import 'core/service/patient_medical_file/ucaf/patient-ucaf-service.dart';
import 'core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart';
import 'core/service/patient/out_patient_service.dart';
import 'core/service/patient/patientInPatientService.dart';
import 'core/service/patient_medical_file/prescription/prescriptions_service.dart';
import 'core/service/patient_medical_file/radiology/radiology_service.dart';
import 'core/service/patient/referral_patient_service.dart';
import 'core/service/patient/referred_patient_service.dart';
import 'core/service/home/schedule_service.dart';
import 'core/viewModel/DischargedPatientViewModel.dart';
import 'core/viewModel/InsuranceViewModel.dart';
import 'core/viewModel/LiveCarePatientViewModel.dart';
@ -54,7 +54,6 @@ import 'core/viewModel/patient-vital-sign-viewmodel.dart';
import 'core/viewModel/prescriptions_view_model.dart';
import 'core/viewModel/radiology_view_model.dart';
import 'core/viewModel/referral_view_model.dart';
import 'core/viewModel/referred_view_model.dart';
import 'core/viewModel/schedule_view_model.dart';
GetIt locator = GetIt.instance;
@ -65,7 +64,6 @@ void setupLocator() {
locator.registerLazySingleton(() => DoctorReplyService());
locator.registerLazySingleton(() => ScheduleService());
locator.registerLazySingleton(() => ReferralPatientService());
locator.registerLazySingleton(() => ReferredPatientService());
locator.registerLazySingleton(() => MedicineService());
locator.registerLazySingleton(() => PatientService());
locator.registerLazySingleton(() => DashboardService());
@ -92,12 +90,12 @@ void setupLocator() {
locator.registerLazySingleton(() => HospitalsService());
locator.registerLazySingleton(() => PatientMedicalReportService());
locator.registerLazySingleton(() => LiveCarePatientServices());
locator.registerLazySingleton(() => NavigationService());
/// View Model
locator.registerFactory(() => DoctorReplayViewModel());
locator.registerFactory(() => ScheduleViewModel());
locator.registerFactory(() => ReferralPatientViewModel());
locator.registerFactory(() => ReferredPatientViewModel());
locator.registerFactory(() => MedicineViewModel());
locator.registerFactory(() => PatientViewModel());
locator.registerFactory(() => DashboardViewModel());

@ -11,6 +11,7 @@ import 'package:provider/provider.dart';
import './config/size_config.dart';
import './routes.dart';
import 'config/config.dart';
import 'core/service/NavigationService.dart';
import 'core/viewModel/authentication_view_model.dart';
import 'locator.dart';
@ -66,6 +67,7 @@ class MyApp extends StatelessWidget {
dividerColor: Colors.grey[350],
backgroundColor: Color.fromRGBO(255, 255, 255, 1),
),
navigatorKey: locator<NavigationService>().navigatorKey,
initialRoute: INIT_ROUTE,
routes: routes,
debugShowCheckedModeBanner: false,

@ -1,56 +1,56 @@
class StartCallReq {
int vCID;
bool isrecall;
String tokenID;
String generalid;
String clincName;
int clinicId;
String docSpec;
String docotrName;
int doctorId;
String generalid;
bool isOutKsa;
bool isrecall;
String projectName;
String docotrName;
String clincName;
String docSpec;
int clinicId;
String tokenID;
int vCID;
StartCallReq(
{this.vCID,
this.isrecall,
this.tokenID,
this.generalid,
this.doctorId,
this.isOutKsa,
this.projectName,
this.docotrName,
this.clincName,
this.docSpec,
this.clinicId});
{this.clincName,
this.clinicId,
this.docSpec,
this.docotrName,
this.doctorId,
this.generalid,
this.isOutKsa,
this.isrecall,
this.projectName,
this.tokenID,
this.vCID});
StartCallReq.fromJson(Map<String, dynamic> json) {
vCID = json['VC_ID'];
isrecall = json['isrecall'];
tokenID = json['TokenID'];
generalid = json['generalid'];
clincName = json['clincName'];
clinicId = json['ClinicId'];
docSpec = json['Doc_Spec'];
docotrName = json['DocotrName'];
doctorId = json['DoctorId'];
generalid = json['generalid'];
isOutKsa = json['IsOutKsa'];
isrecall = json['isrecall'];
projectName = json['projectName'];
docotrName = json['DocotrName'];
clincName = json['clincName'];
docSpec = json['Doc_Spec'];
clinicId = json['ClinicId'];
tokenID = json['TokenID'];
vCID = json['VC_ID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['VC_ID'] = this.vCID;
data['isrecall'] = this.isrecall;
data['TokenID'] = this.tokenID;
data['generalid'] = this.generalid;
data['clincName'] = this.clincName;
data['ClinicId'] = this.clinicId;
data['Doc_Spec'] = this.docSpec;
data['DocotrName'] = this.docotrName;
data['DoctorId'] = this.doctorId;
data['generalid'] = this.generalid;
data['IsOutKsa'] = this.isOutKsa;
data['isrecall'] = this.isrecall;
data['projectName'] = this.projectName;
data['DocotrName'] = this.docotrName;
data['clincName'] = this.clincName;
data['Doc_Spec'] = this.docSpec;
data['ClinicId'] = this.clinicId;
data['TokenID'] = this.tokenID;
data['VC_ID'] = this.vCID;
return data;
}
}
}

@ -166,8 +166,9 @@ class MyReferredPatientModel {
referringDoctor = json['ReferringDoctor'];
referralClinic = json['ReferralClinic'];
referringClinic = json['ReferringClinic'];
referralStatus = json['ReferralStatus'];
referralDate = json['ReferralDate'];
createdOn = json['CreatedOn'];
referralStatus = json["ReferralStatus"] is String?json['ReferralStatus']== "Accepted"?46:json['ReferralStatus']=="Pending"?1:0 : json['ReferralStatus'];
referralDate = json['ReferralDate'] ?? createdOn;
referringDoctorRemarks = json['ReferringDoctorRemarks'];
referredDoctorRemarks = json['ReferredDoctorRemarks'];
referralResponseOn = json['ReferralResponseOn'];
@ -179,7 +180,6 @@ class MyReferredPatientModel {
appointmentDate = json['AppointmentDate'];
appointmentType = json['AppointmentType'];
patientMRN = json['PatientMRN'];
createdOn = json['CreatedOn'];
clinicID = json['ClinicID'];
nationalityID = json['NationalityID'];
age = json['Age'];

@ -10,6 +10,7 @@ class HomePatientCard extends StatelessWidget {
final String text;
final Color textColor;
final Function onTap;
final double iconSize;
HomePatientCard({
@required this.backgroundColor,
@ -18,6 +19,7 @@ class HomePatientCard extends StatelessWidget {
@required this.text,
@required this.textColor,
@required this.onTap,
this.iconSize = 30,
});
@override
@ -34,14 +36,13 @@ class HomePatientCard extends StatelessWidget {
Expanded(
child: Stack(
children: [
Positioned(
bottom: 0.1,
right: 0.5,
width: 23.0,
height: 25.0,
Container(
margin: EdgeInsets.only(top: 18, left: 10),
color:Colors.transparent,
child: Icon(
cardIcon,
size: 60,
size: iconSize * 2,
color: backgroundIconColor,
),
),
@ -52,7 +53,7 @@ class HomePatientCard extends StatelessWidget {
children: [
Icon(
cardIcon,
size: 30,
size: iconSize,
color: textColor,
),
SizedBox(

@ -331,6 +331,7 @@ class _HomeScreenState extends State<HomeScreen> {
backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.livecare,
textColor: textColors[colorIndex],
iconSize: 21,
text:
"${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}",
onTap: () {

@ -13,7 +13,7 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
@ -48,7 +48,9 @@ class _EndCallScreenState extends State<EndCallScreen> {
final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel(TranslationBase.of(context).resume,
TranslationBase.of(context).theCall, '', 'patient/vital_signs.png',
isInPatient: isInpatient, onTap: () async {
isInPatient: isInpatient,
color: Colors.green[800],
onTap: () async {
GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel
.startCall(isReCall: false, vCID: widget.patient.vcId)
@ -63,6 +65,7 @@ class _EndCallScreenState extends State<EndCallScreen> {
kSessionId: liveCareModel.startCallRes.openSessionID,
kApiKey: '46209962',
vcId: widget.patient.vcId,
patientName: widget.patient.fullName ?? (widget.patient.firstName != null ? "${widget.patient.firstName} ${widget.patient.lastName}" : "-"),
tokenID: await liveCareModel.getToken(),
generalId: GENERAL_ID,
doctorId: liveCareModel.doctorProfile.doctorID,
@ -105,7 +108,9 @@ class _EndCallScreenState extends State<EndCallScreen> {
TranslationBase.of(context).consultation,
'',
'patient/vital_signs.png',
isInPatient: isInpatient, onTap: () {
isInPatient: isInpatient,
color: Colors.red[800],
onTap: () {
Helpers.showConfirmationDialog(context,
"${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).endLC} ${TranslationBase.of(context).consultation} ?",
() async {
@ -136,10 +141,24 @@ class _EndCallScreenState extends State<EndCallScreen> {
TranslationBase.of(context).instruction,
"",
'patient/health_summary.png',
onTap: () {},
onTap: () {
Helpers.showConfirmationDialog(context,
"${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).sendLC} ${TranslationBase.of(context).instruction} ?",
() async {
Navigator.of(context).pop();
GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel.sendSMSInstruction(widget.patient.vcId);
GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error);
} else {
DrAppToastMsg.showSuccesToast("You successfully sent SMS instructions");
}
});
},
isInPatient: isInpatient,
isDartIcon: true,
isDisable: true,
// isDisable: true,
dartIcon: DoctorApp.send_instruction),
PatientProfileCardModel(
TranslationBase.of(context).transferTo,
@ -166,8 +185,8 @@ class _EndCallScreenState extends State<EndCallScreen> {
appBarTitle: TranslationBase.of(context).patientProfile,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(
widget.patient, arrivalType ?? '7', '1',
appBar: PatientProfileAppBar(
widget.patient,
isInpatient: isInpatient,
height: (widget.patient.patientStatusType != null &&
widget.patient.patientStatusType == 43)
@ -230,6 +249,7 @@ class _EndCallScreenState extends State<EndCallScreen> {
isLoading: cardsList[index].isLoading,
isDartIcon: cardsList[index].isDartIcon,
dartIcon: cardsList[index].dartIcon,
color: cardsList[index].color,
),
),
],

@ -120,7 +120,7 @@ class _LivaCareTransferToAdminState extends State<LivaCareTransferToAdmin> {
() async {
Navigator.of(context).pop();
GifLoaderDialogUtils.showMyDialog(context);
model.transferToAdmin(widget.patient.vcId, noteController.text);
await model.transferToAdmin(widget.patient.vcId, noteController.text);
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);

@ -6,7 +6,7 @@ import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';

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

@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/medical-file/medical_file_details.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
@ -30,10 +30,8 @@ class _HealthSummaryPageState extends State<HealthSummaryPage> {
builder:
(BuildContext context, MedicalFileViewModel model, Widget child) =>
AppScaffold(
appBar: PatientProfileHeaderNewDesignAppBar(
appBar: PatientProfileAppBar(
patient,
patientType.toString() ?? "0",
arrivalType,
isInpatient: isInpatient,
),
isShowAppBar: true,

@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
@ -102,20 +102,19 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
builder:
(BuildContext context, MedicalFileViewModel model, Widget child) =>
AppScaffold(
appBar: PatientProfileHeaderWhitAppointmentAppBar(
patient: patient,
patientType: patient.patientType.toString() ?? "0",
arrivalType: patient.arrivedOn.toString() ?? 0,
appBar: PatientProfileAppBar(
patient,
doctorName: doctorName,
profileUrl: doctorImage,
clinic: clinicName,
isPrescriptions: true,
isMedicalFile: true,
episode: episode,
vistDate:
visitDate:
'${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(
vistDate,
), isArabic: projectViewModel.isArabic)}',
isAppointmentHeader: true,
),
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(),

@ -6,7 +6,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
@ -31,7 +31,7 @@ class ECGPage extends StatelessWidget {
baseViewModel: model,
isShowAppBar: true,
backgroundColor: Color(0xffF8F8F8),
appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType),
appBar: PatientProfileAppBar(patient),
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(8.0),

@ -1,10 +1,9 @@
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';

@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/patients/insurance_approvals_details.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/doctor_card_insurance.dart';
@ -44,10 +44,8 @@ class _InsuranceApprovalScreenNewState
: (model) => model.getInsuranceApproval(patient),
builder: (BuildContext context, InsuranceViewModel model, Widget child) =>
AppScaffold(
appBar: PatientProfileHeaderNewDesignAppBar(
appBar: PatientProfileAppBar(
patient,
patientType.toString() ?? "0",
patientType,
isInpatient: isInpatient,
),
isShowAppBar: true,

@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
@ -54,8 +54,8 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
AppScaffold(
isShowAppBar: true,
baseViewModel: model,
appBar: PatientProfileHeaderNewDesignAppBar(
patient, patient.patientType.toString(), patient.arrivedOn),
appBar: PatientProfileAppBar(
patient),
body: patient.admissionNo != null
? SingleChildScrollView(
child: Container(

@ -1,10 +1,8 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
@ -14,7 +12,7 @@ import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';

@ -10,13 +10,11 @@ import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';

@ -12,7 +12,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page-stepper-wi
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
@ -47,8 +47,8 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(
patient, patientType, arrivalType),
appBar: PatientProfileAppBar(
patient),
appBarTitle: TranslationBase.of(context).ucaf,
body: Column(
children: [

@ -7,7 +7,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page-stepper-widget.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
@ -65,8 +65,8 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(
patient, patientType, arrivalType),
appBar: PatientProfileAppBar(
patient),
appBarTitle: TranslationBase.of(context).ucaf,
body: model.patientVitalSignsHistory.length > 0 &&
model.patientChiefComplaintList != null &&

@ -7,7 +7,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
@ -61,8 +61,8 @@ class _AdmissionRequestThirdScreenState
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(
patient, patientType, arrivalType),
appBar: PatientProfileAppBar(
patient),
appBarTitle: TranslationBase.of(context).admissionRequest,
body: GestureDetector(
onTap: () {

@ -8,7 +8,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
@ -52,8 +52,8 @@ class _AdmissionRequestThirdScreenState
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(
patient, patientType, arrivalType),
appBar: PatientProfileAppBar(
patient),
appBarTitle: TranslationBase.of(context).admissionRequest,
body: GestureDetector(
onTap: () {

@ -10,7 +10,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
@ -74,8 +74,8 @@ class _AdmissionRequestSecondScreenState
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(
patient, patientType, arrivalType),
appBar: PatientProfileAppBar(
patient),
appBarTitle: TranslationBase.of(context).admissionRequest,
body: GestureDetector(
onTap: () {

@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -32,31 +32,19 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
@override
Widget build(BuildContext context) {
return BaseView<LabsViewModel>(
// onModelReady: (model) => model.getLaboratoryResult(
// invoiceNo: widget.patientLabOrders.invoiceNo,
// clinicID: widget.patientLabOrders.clinicID,
// projectID: widget.patientLabOrders.projectID,
// orderNo: widget.patientLabOrders.orderNo,
// patient: widget.patient,
// isInpatient: widget.patientType == "1"),
onModelReady: (model) => model.getPatientLabResult(
patientLabOrder: widget.patientLabOrders,
patient: widget.patient,
isInpatient: true),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
appBar: PatientProfileHeaderWhitAppointmentAppBar(
patient: widget.patient,
patientType: widget.patientType ?? "0",
arrivalType: widget.arrivalType ?? "0",
orderNo: widget.patientLabOrders.orderNo,
appBar: PatientProfileAppBar(
widget.patient,
isFromLabResult: true,
appointmentDate: widget.patientLabOrders.orderDate,
doctorName: widget.patientLabOrders.doctorName,
branch: widget.patientLabOrders.projectName,
clinic: widget.patientLabOrders.clinicDescription,
profileUrl: widget.patientLabOrders.doctorImageURL,
invoiceNO: widget.patientLabOrders.invoiceNo,
),
baseViewModel: model,
body: AppScaffold(
isShowAppBar: false,

@ -7,7 +7,7 @@ import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart';
import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
@ -52,10 +52,9 @@ class _LabsHomePageState extends State<LabsHomePage> {
baseViewModel: model,
backgroundColor: Colors.grey[100],
isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(
appBar: PatientProfileAppBar(
patient,
patient.patientType.toString() ?? '0',
patientType,
isInpatient: isInpatient,
),
body: SingleChildScrollView(

@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
@ -40,27 +41,35 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
? TranslationBase.of(context).medicalReportAdd
: TranslationBase.of(context).medicalReportVerify,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: Column(
children: [
Expanded(
child: Container(
margin: EdgeInsets.all(16),
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
body: model.state == ViewState.BusyLocal
? AppLoaderWidget()
: Column(
children: [
Expanded(
child: Container(
margin: EdgeInsets.all(16),
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (model.medicalReportTemplate.length > 0)
// if (model.medicalReportTemplate.length > 0)
HtmlRichEditor(
initialText: model
.medicalReportTemplate[0]
.templateTextHtml,
initialText: (medicalReport != null
? medicalReport.reportDataHtml
: model.medicalReportTemplate
.length > 0 ? model
.medicalReportTemplate[0] : ""),
hint: "Write the medical report ",
height:
MediaQuery.of(context).size.height *
0.75,
MediaQuery
.of(context)
.size
.height *
0.75,
),
],
),

@ -7,7 +7,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
@ -31,10 +31,8 @@ class MedicalReportDetailPage extends StatelessWidget {
baseViewModel: model,
isShowAppBar: true,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
appBar: PatientProfileHeaderNewDesignAppBar(
appBar: PatientProfileAppBar(
patient,
patientType,
arrivalType,
),
body: Container(
child: SingleChildScrollView(

@ -7,17 +7,17 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:provider/provider.dart';
import '../../../../routes.dart';
@ -43,10 +43,8 @@ class MedicalReportPage extends StatelessWidget {
baseViewModel: model,
isShowAppBar: true,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
appBar: PatientProfileHeaderNewDesignAppBar(
appBar: PatientProfileAppBar(
patient,
patientType,
arrivalType,
),
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
@ -75,13 +73,18 @@ class MedicalReportPage extends StatelessWidget {
),
AddNewOrder(
onTap: () {
Navigator.of(context)
.pushNamed(PATIENT_MEDICAL_REPORT_INSERT, arguments: {
'patient': patient,
'patientType': patientType,
'arrivalType': arrivalType,
'type': MedicalReportStatus.ADD
});
if (model.hasOnHold()) {
Helpers.showErrorToast(
"Please Verified the on hold report to be able to add new one");
} else {
Navigator.of(context)
.pushNamed(PATIENT_MEDICAL_REPORT_INSERT, arguments: {
'patient': patient,
'patientType': patientType,
'arrivalType': arrivalType,
'type': MedicalReportStatus.ADD
});
}
},
label: TranslationBase.of(context).createNewMedicalReport,
),
@ -92,7 +95,7 @@ class MedicalReportPage extends StatelessWidget {
onTap: () {
if (model.medicalReportList[index].status == 1) {
Navigator.of(context).pushNamed(
PATIENT_MEDICAL_REPORT_DETAIL,
PATIENT_MEDICAL_REPORT_INSERT,
arguments: {
'patient': patient,
'patientType': patientType,
@ -101,7 +104,7 @@ class MedicalReportPage extends StatelessWidget {
});
} else {
Navigator.of(context).pushNamed(
PATIENT_MEDICAL_REPORT_INSERT,
PATIENT_MEDICAL_REPORT_DETAIL,
arguments: {
'patient': patient,
'patientType': patientType,
@ -116,7 +119,7 @@ class MedicalReportPage extends StatelessWidget {
child: CardWithBgWidget(
hasBorder: false,
bgColor: model.medicalReportList[index].status == 1
? Colors.red[700]
? Color(0xFFCC9B14)
: Colors.green[700],
widget: Column(
children: [
@ -132,9 +135,9 @@ class MedicalReportPage extends StatelessWidget {
: TranslationBase.of(context)
.verified,
color: model.medicalReportList[index]
.status ==
1
? Colors.red[700]
.status ==
1
? Color(0xFFCC9B14)
: Colors.green[700],
fontSize: 1.4 * SizeConfig.textMultiplier,
bold: true,
@ -226,8 +229,8 @@ class MedicalReportPage extends StatelessWidget {
Icon(
model.medicalReportList[index].status ==
1
? EvaIcons.eye
: DoctorApp.edit_1,
? DoctorApp.edit_1
:EvaIcons.eye ,
),
],
),

@ -10,7 +10,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/note/update_note.dar
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
@ -88,10 +88,8 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
.of(context)
.scaffoldBackgroundColor,
// appBarTitle: TranslationBase.of(context).progressNote,
appBar: PatientProfileHeaderNewDesignAppBar(
appBar: PatientProfileAppBar(
patient,
patient.patientType.toString() ?? '0',
arrivalType,
isInpatient: true,
),
body: model.patientProgressNoteList == null ||

@ -13,6 +13,7 @@ class PatientProfileCardModel {
final bool isSelectInpatient;
final bool isDartIcon;
final IconData dartIcon;
final Color color;
PatientProfileCardModel(
this.nameLine1,
@ -25,6 +26,8 @@ class PatientProfileCardModel {
this.onTap,
this.isDischargedPatient = false,
this.isSelectInpatient = false,
this.isDartIcon = false,this.dartIcon
this.isDartIcon = false,
this.dartIcon,
this.color,
});
}

@ -14,7 +14,7 @@ import 'package:doctor_app_flutter/util/VideoChannel.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
@ -102,13 +102,13 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
children: [
Column(
children: [
PatientProfileHeaderNewDesignAppBar(
patient, arrivalType ?? '0', patientType,
isInpatient: isInpatient,
PatientProfileAppBar(
patient,
isFromLiveCare: isFromLiveCare,
isInpatient: isInpatient,
height: (patient.patientStatusType != null &&
patient.patientStatusType == 43)
? 210
? 220
: isDischargedPatient
? 240
: 0,
@ -156,51 +156,57 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
SizedBox(
height: MediaQuery.of(context).size.height * 0.05,
)
],
),
),
],
),
if (patient.patientStatusType != null &&
patient.patientStatusType == 43)
BaseView<SOAPViewModel>(
onModelReady: (model) async {},
builder: (_, model, w) => Positioned(
top: 180,
left: 20,
right: 20,
child: Row(
children: [
Expanded(child: Container()),
if (patient.episodeNo == 0)
AppButton(
title:
"${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}",
color: patient.patientStatusType == 43
? Colors.red.shade700
: Colors.grey.shade700,
fontColor: Colors.white,
vPadding: 8,
radius: 30,
hPadding: 20,
fontWeight: FontWeight.normal,
fontSize: 1.6,
icon: Image.asset(
"assets/images/create-episod.png",
color: Colors.white,
),
],
),
if (isFromLiveCare
? patient.episodeNo != null
: patient.patientStatusType != null &&
patient.patientStatusType == 43)
BaseView<SOAPViewModel>(
onModelReady: (model) async {},
builder: (_, model, w) => Positioned(
top: 180,
left: 20,
right: 20,
child: Row(
children: [
Expanded(child: Container()),
if (patient.episodeNo == 0)
AppButton(
title:
"${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}",
color: isFromLiveCare
? Colors.red.shade700
: patient.patientStatusType == 43
? Colors.red.shade700
: Colors.grey.shade700,
fontColor: Colors.white,
vPadding: 8,
radius: 30,
hPadding: 20,
fontWeight: FontWeight.normal,
fontSize: 1.6,
icon: Image.asset(
"assets/images/create-episod.png",
color: Colors.white,
height: 30,
),
onPressed: () async {
if (patient.patientStatusType ==
43) {
if ((isFromLiveCare &&
patient.appointmentNo != null &&
patient.appointmentNo != 0) ||
patient.patientStatusType ==
43) {
PostEpisodeReqModel
postEpisodeReqModel =
PostEpisodeReqModel(
appointmentNo:
patient.appointmentNo,
patientMRN:
patient.patientMRN);
postEpisodeReqModel =
PostEpisodeReqModel(
appointmentNo:
patient.appointmentNo,
patientMRN:
patient.patientMRN);
GifLoaderDialogUtils.showMyDialog(
context);
await model.postEpisode(
@ -220,11 +226,18 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
if (patient.episodeNo != 0)
AppButton(
title:
"${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}",
"${TranslationBase
.of(context)
.update}\n${TranslationBase
.of(context)
.episode}",
color:
patient.patientStatusType == 43
? Colors.red.shade700
: Colors.grey.shade700,
isFromLiveCare
? Colors.red.shade700
: patient.patientStatusType ==
43
? Colors.red.shade700
: Colors.grey.shade700,
fontColor: Colors.white,
vPadding: 8,
radius: 30,
@ -237,8 +250,12 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
height: 30,
),
onPressed: () {
if (patient.patientStatusType ==
43) {
if ((isFromLiveCare &&
patient.appointmentNo !=
null &&
patient.appointmentNo != 0) ||
patient.patientStatusType ==
43) {
Navigator.of(context).pushNamed(
UPDATE_EPISODE,
arguments: {
@ -283,6 +300,11 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
TranslationBase.of(context).initiateCall,
disabled: model.state == ViewState.BusyLocal,
onPressed: () async {
// Navigator.push(context, MaterialPageRoute(
// builder: (BuildContext context) =>
// EndCallScreen(patient:patient)));
if(isCallFinished) {
Navigator.push(context, MaterialPageRoute(
builder: (BuildContext context) =>
@ -305,6 +327,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
kSessionId: model.startCallRes.openSessionID,
kApiKey: '46209962',
vcId: patient.vcId,
patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"),
tokenID: await model.getToken(),
generalId: GENERAL_ID,
doctorId: model.doctorProfile.doctorID,

@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/secondary_button.dart';
@ -16,13 +16,15 @@ class RadiologyDetailsPage extends StatelessWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final bool isInpatient;
RadiologyDetailsPage(
{Key key,
this.finalRadiology,
this.patient,
this.patientType,
this.arrivalType});
this.arrivalType,
this.isInpatient = false});
@override
Widget build(BuildContext context) {
@ -33,16 +35,16 @@ class RadiologyDetailsPage extends StatelessWidget {
lineItem: finalRadiology.invoiceLineItemNo,
invoiceNo: finalRadiology.invoiceNo),
builder: (_, model, widget) => AppScaffold(
appBar: PatientProfileHeaderWhitAppointmentAppBar(
patient: patient,
patientType: patientType ?? "0",
arrivalType: arrivalType ?? "0",
appBar: PatientProfileAppBar(
patient,
appointmentDate: finalRadiology.orderDate,
doctorName: finalRadiology.doctorName,
clinic: finalRadiology.clinicDescription,
branch: finalRadiology.projectName,
profileUrl: finalRadiology.doctorImageURL,
invoiceNO: finalRadiology.invoiceNo.toString(),
isAppointmentHeader: true,
),
isShowAppBar: true,
baseViewModel: model,

@ -7,7 +7,7 @@ import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart';
import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
@ -50,10 +50,8 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
isShowAppBar: true,
backgroundColor: Colors.grey[100],
// appBarTitle: TranslationBase.of(context).radiology,
appBar: PatientProfileHeaderNewDesignAppBar(
appBar: PatientProfileAppBar(
patient,
patient.patientType.toString() ?? '0',
arrivalType,
isInpatient: isInpatient,
),
baseViewModel: model,
@ -210,6 +208,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
finalRadiology:
model.radiologyList[index],
patient: patient,
isInpatient:isInpatient
),
),
);

@ -1,7 +1,7 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart';
import 'package:doctor_app_flutter/core/model/referral/add_referred_remarks_request.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
@ -19,30 +19,40 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt;
import 'ReplySummeryOnReferralPatient.dart';
class AddReplayOnReferralPatient extends StatefulWidget {
final PatientReferralViewModel patientReferralViewModel;
final MyReferralPatientModel myReferralInPatientModel;
final AddReferredRemarksRequestModel myReferralInPatientRequestModel;
final bool isEdited;
const AddReplayOnReferralPatient(
{Key key, this.patientReferralViewModel, this.myReferralInPatientModel})
{Key key,
this.patientReferralViewModel,
this.myReferralInPatientModel,
this.isEdited,
this.myReferralInPatientRequestModel})
: super(key: key);
@override
_AddReplayOnReferralPatientState createState() =>
_AddReplayOnReferralPatientState();
_AddReplayOnReferralPatientState createState() => _AddReplayOnReferralPatientState();
}
class _AddReplayOnReferralPatientState
extends State<AddReplayOnReferralPatient> {
class _AddReplayOnReferralPatientState extends State<AddReplayOnReferralPatient> {
bool isSubmitted = false;
int replay = 1;
int reject = 2;
stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord;
var event = RobotProvider();
TextEditingController replayOnReferralController = TextEditingController();
@override
void initState() {
requestPermissions();
super.initState();
replayOnReferralController.text = widget.myReferralInPatientModel.referredDoctorRemarks ?? "";
}
@override
@ -50,116 +60,206 @@ class _AddReplayOnReferralPatientState
return AppScaffold(
isShowAppBar: false,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 1.0,
child: Padding(
padding: EdgeInsets.all(0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BottomSheetTitle(title: 'Replay'),
SizedBox(
height: 10.0,
),
Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
children: [
Stack(
children: [
AppTextFieldCustom(
hintText: 'Replay your responses here',
controller: replayOnReferralController,
maxLines: 35,
minLines: 25,
hasBorder: true,
validationError:
replayOnReferralController.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage
: null,
),
Positioned(
top: 0, //MediaQuery.of(context).size.height * 0,
right: 15,
child: IconButton(
icon: Icon(
DoctorApp.speechtotext,
color: Colors.black,
size: 35,
),
onPressed: () {
onVoiceText();
},
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BottomSheetTitle(title: 'Reply'),
SizedBox(
height: 10.0,
),
Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
children: [
Stack(
children: [
AppTextFieldCustom(
hintText: 'Reply your responses here',
controller: replayOnReferralController,
maxLines: 35,
minLines: 25,
hasBorder: true,
validationError: replayOnReferralController.text.isEmpty && isSubmitted
? TranslationBase.of(context).emptyMessage
: null,
),
)
],
),
],
Positioned(
top: 0,
//MediaQuery.of(context).size.height * 0,
right: 15,
child: IconButton(
icon: Icon(
DoctorApp.speechtotext,
color: Colors.black,
size: 35,
),
onPressed: () {
onVoiceText();
},
),
)
],
),
],
),
),
),
),
],
],
),
),
),
),
),
bottomSheet: Container(
height: replayOnReferralController.text.isNotEmpty ? 130 : 70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Column(
children: <Widget>[
replayOnReferralController.text.isEmpty
? SizedBox()
: Container(
margin: EdgeInsets.all(5),
child: Expanded(
Container(
// height: replayOnReferralController.text.isNotEmpty ? 130 : 70,
// margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Column(
children: <Widget>[
replayOnReferralController.text.isEmpty
? SizedBox()
: Container(
margin: EdgeInsets.all(16),
child: AppButton(
title: TranslationBase.of(context).clearText,
onPressed: () {
setState(() {
replayOnReferralController.text = '';
});
},
)),
title: TranslationBase.of(context).clearText,
onPressed: () {
setState(() {
replayOnReferralController.text = '';
});
},
),
),
Container(
margin: EdgeInsets.fromLTRB(16, 0, 16, 16),
child: Row(
children: [
Expanded(
child: AppButton(
onPressed: () async {
if (replayOnReferralController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
await widget.patientReferralViewModel.replayReferred(
replayOnReferralController.text.trim(), widget.myReferralInPatientModel, reject);
if (widget.patientReferralViewModel.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(widget.patientReferralViewModel.error);
} else {
GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast("Has been rejected");
Navigator.of(context).pop();
Navigator.of(context).pop();
// Navigator.push(
// context,
// FadePage(
// page: ReplySummeryOnReferralPatient(
// widget.myReferralInPatientModel, replayOnReferralController.text.trim()),
// ),
// );
}
} else {
Helpers.showErrorToast("You can't add empty reply");
setState(() {
isSubmitted = false;
});
}
},
title: TranslationBase.of(context).reject,
fontColor: Colors.white,
color: Colors.red[600],
),
),
SizedBox(
width: 4,
),
Expanded(
child: AppButton(
onPressed: () async {
setState(() {
isSubmitted = true;
});
if (replayOnReferralController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
await widget.patientReferralViewModel.replayReferred(
replayOnReferralController.text.trim(), widget.myReferralInPatientModel, replay);
if (widget.patientReferralViewModel.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(widget.patientReferralViewModel.error);
} else {
GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast("Your Reply Added Successfully");
Navigator.of(context).pop();
Navigator.of(context).pop();
// Navigator.push(
// context,
// FadePage(
// page: ReplySummeryOnReferralPatient(
// widget.myReferralInPatientModel, replayOnReferralController.text.trim()),
// ),
// );
}
} else {
Helpers.showErrorToast("You can't add empty reply");
setState(() {
isSubmitted = false;
});
}
},
title: TranslationBase.of(context).noteConfirm,
fontColor: Colors.white,
color: Colors.green[600],
),
),
],
),
Container(
margin: EdgeInsets.all(5),
child: AppButton(
title: 'Submit Replay',
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () async {
setState(() {
isSubmitted = true;
});
if (replayOnReferralController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
await widget.patientReferralViewModel.replay(
replayOnReferralController.text.trim(),
widget.myReferralInPatientModel);
if (widget.patientReferralViewModel.state ==
ViewState.ErrorLocal) {
Helpers.showErrorToast(
widget.patientReferralViewModel.error);
} else {
GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast(
"Your Replay Added Successfully");
Navigator.of(context).pop();
Navigator.of(context).pop();
}
} else {
Helpers.showErrorToast("You can't add empty replay");
setState(() {
isSubmitted = false;
});
}
})),
],
),
),
// Container(
// margin: EdgeInsets.all(5),
// child: AppButton(
// title: 'Submit Reply',
// color: Color(0xff359846),
// fontWeight: FontWeight.w700,
// onPressed: () async {
// setState(() {
// isSubmitted = true;
// });
// if (replayOnReferralController.text.isNotEmpty) {
// GifLoaderDialogUtils.showMyDialog(context);
// await widget.patientReferralViewModel.replay(
// replayOnReferralController.text.trim(),
// widget.myReferralInPatientModel);
// if (widget.patientReferralViewModel.state ==
// ViewState.ErrorLocal) {
// Helpers.showErrorToast(
// widget.patientReferralViewModel.error);
// } else {
// GifLoaderDialogUtils.hideDialog(context);
// DrAppToastMsg.showSuccesToast(
// "Your Reply Added Successfully");
// Navigator.of(context).pop();
// Navigator.of(context).pop();
//
// Navigator.push(
// context,
// FadePage(
// page: ReplySummeryOnReferralPatient(
// widget.myReferralInPatientModel,
// replayOnReferralController.text.trim()),
// ),
// );
// }
// } else {
// Helpers.showErrorToast("You can't add empty reply");
// setState(() {
// isSubmitted = false;
// });
// }
// })),
],
),
),
],
),
);
}
@ -167,8 +267,7 @@ class _AddReplayOnReferralPatientState
onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
bool available = await speech.initialize(
onStatus: statusListener, onError: errorListener);
bool available = await speech.initialize(onStatus: statusListener, onError: errorListener);
if (available) {
speech.listen(
onResult: resultListener,

@ -0,0 +1,119 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/material.dart';
import '../../../../routes.dart';
class ReplySummeryOnReferralPatient extends StatefulWidget {
final MyReferralPatientModel referredPatient;
final String doctorReply;
ReplySummeryOnReferralPatient(this.referredPatient, this.doctorReply);
@override
_ReplySummeryOnReferralPatientState createState() =>
_ReplySummeryOnReferralPatientState(this.referredPatient);
}
class _ReplySummeryOnReferralPatientState
extends State<ReplySummeryOnReferralPatient> {
final MyReferralPatientModel referredPatient;
_ReplySummeryOnReferralPatientState(this.referredPatient);
@override
Widget build(BuildContext context) {
return BaseView<PatientReferralViewModel>(
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).summeryReply,
body: Container(
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Container(
width: double.infinity,
margin:
EdgeInsets.symmetric(horizontal: 16, vertical: 16),
padding: EdgeInsets.symmetric(
horizontal: 16, vertical: 16),
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(8)),
border: Border.fromBorderSide(BorderSide(
color: Colors.white,
width: 1.0,
)),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).reply,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 2.4 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
AppText(
widget.doctorReply ?? '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
SizedBox(
height: 8,
),
],
),
),
),
),
Container(
margin:
EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: Row(
children: [
Expanded(
child: AppButton(
onPressed: () {
Navigator.of(context).pop();
},
title: TranslationBase.of(context).cancel,
fontColor: Colors.white,
color: Colors.red[600],
),
),
SizedBox(width: 4,),
Expanded(
child: AppButton(
onPressed: () {},
title: TranslationBase.of(context).noteConfirm,
fontColor: Colors.white,
color: Colors.green[600],
),
),
],
),
),
],
),
),
));
}
}

@ -1,16 +1,20 @@
import 'package:doctor_app_flutter/core/enum/PatientType.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/referral_patient_detail_in-paint.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class MyReferralInPatientScreen extends StatelessWidget {
PatientType patientType = PatientType.IN_PATIENT;
@override
Widget build(BuildContext context) {
@ -20,72 +24,90 @@ class MyReferralInPatientScreen extends StatelessWidget {
baseViewModel: model,
isShowAppBar: false,
appBarTitle: TranslationBase.of(context).referPatient,
body: model.myReferralPatients.isEmpty
? Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
body: Column(
children: [
Container(
margin: EdgeInsets.only(top: 70),
child: PatientTypeRadioWidget(
(patientType) async {
this.patientType = patientType;
GifLoaderDialogUtils.showMyDialog(context);
if (patientType == PatientType.IN_PATIENT) {
await model.getMyReferralPatientService(localBusy: true);
} else {
await model.getMyReferralOutPatientService(localBusy: true);
}
GifLoaderDialogUtils.hideDialog(context);
},
),
),
model.myReferralPatients.isEmpty
? Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(
TranslationBase.of(context).referralEmptyMsg,
color: Theme.of(context).errorColor,
),
)
],
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(
TranslationBase.of(context).referralEmptyMsg,
color: Theme.of(context).errorColor,
),
)
],
),
)
: SingleChildScrollView(
child: Container(
margin: EdgeInsets.only(top: 70),
// color: Colors.white,
// height: MediaQuery.of(context).size.height,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// SizedBox(height: 50),
...List.generate(
model.myReferralPatients.length,
(index) => InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: ReferralPatientDetailScreen(model.myReferralPatients[index],model),
)
: Expanded(
child: SingleChildScrollView(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
...List.generate(
model.myReferralPatients.length,
(index) => InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: ReferralPatientDetailScreen(model.myReferralPatients[index], model),
),
);
},
child: PatientReferralItemWidget(
referralStatus: model.getReferralStatusNameByCode(
model.myReferralPatients[index].referralStatus, context),
referralStatusCode: model.myReferralPatients[index].referralStatus,
patientName: model.myReferralPatients[index].patientName,
patientGender: model.myReferralPatients[index].gender,
referredDate: AppDateUtils.getDayMonthYearDateFormatted(
model.myReferralPatients[index].referralDate),
referredTime: AppDateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate),
patientID: "${model.myReferralPatients[index].patientID}",
isSameBranch: false,
isReferral: true,
isReferralClinic: true,
referralClinic: "${model.myReferralPatients[index].referringClinicDescription}",
remark: model.myReferralPatients[index].referringDoctorRemarks,
nationality: model.myReferralPatients[index].nationalityName,
nationalityFlag: model.myReferralPatients[index].nationalityFlagURL,
doctorAvatar: model.myReferralPatients[index].doctorImageURL,
referralDoctorName: model.myReferralPatients[index].referringDoctorName,
clinicDescription: model.myReferralPatients[index].referringClinicDescription,
infoIcon: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black),
),
),
);
},
child: PatientReferralItemWidget(
referralStatus: model.getReferralStatusNameByCode(model.myReferralPatients[index].referralStatus,context),
referralStatusCode: model.myReferralPatients[index].referralStatus,
patientName: model.myReferralPatients[index].patientName,
patientGender: model.myReferralPatients[index].gender,
referredDate: AppDateUtils.getDayMonthYearDateFormatted(model.myReferralPatients[index].referralDate),
referredTime: AppDateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate),
patientID: "${model.myReferralPatients[index].patientID}",
isSameBranch: false,
isReferral: true,
isReferralClinic: true,
referralClinic:"${model.myReferralPatients[index].referringClinicDescription}",
remark: model.myReferralPatients[index].referringDoctorRemarks,
nationality: model.myReferralPatients[index].nationalityName,
nationalityFlag: model.myReferralPatients[index].nationalityFlagURL,
doctorAvatar: model.myReferralPatients[index].doctorImageURL,
referralDoctorName: model.myReferralPatients[index].referringDoctorName,
clinicDescription: model.myReferralPatients[index].referringClinicDescription,
infoIcon: Icon(FontAwesomeIcons.arrowRight,
size: 25, color: Colors.black),
),
),
],
),
),
],
),
),
),
),
],
),
),
);
}

@ -8,7 +8,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
@ -136,10 +136,8 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient,
isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(
appBar: PatientProfileAppBar(
patient,
patientType,
arrivalType,
isInpatient: isInpatient,
),
body: SingleChildScrollView(

@ -7,7 +7,7 @@ import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
@ -74,8 +74,8 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient,
isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(
patient, patientType, arrivalType),
appBar: PatientProfileAppBar(
patient),
body: SingleChildScrollView(
child: Container(
child: Column(

@ -19,8 +19,8 @@ import 'AddReplayOnReferralPatient.dart';
class ReferralPatientDetailScreen extends StatelessWidget {
final MyReferralPatientModel referredPatient;
final PatientReferralViewModel patientReferralViewModel;
ReferralPatientDetailScreen(
this.referredPatient, this.patientReferralViewModel);
ReferralPatientDetailScreen(this.referredPatient, this.patientReferralViewModel);
@override
Widget build(BuildContext context) {
@ -51,8 +51,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
),
Expanded(
child: AppText(
(Helpers.capitalize(
"${referredPatient.firstName} ${referredPatient.lastName}")),
(Helpers.capitalize("${referredPatient.firstName} ${referredPatient.lastName}")),
fontSize: SizeConfig.textMultiplier * 2.5,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
@ -69,18 +68,14 @@ class ReferralPatientDetailScreen extends StatelessWidget {
),
InkWell(
onTap: () {
PatiantInformtion patient = model
.getPatientFromReferralO(referredPatient);
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
PatiantInformtion patient = model.getPatientFromReferralO(referredPatient);
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patient,
"patientType": "1",
"isInpatient": true,
"arrivalType": "1",
"from": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
"to": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
"from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
"to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
});
},
child: Icon(
@ -97,18 +92,14 @@ class ReferralPatientDetailScreen extends StatelessWidget {
children: [
InkWell(
onTap: () {
PatiantInformtion patient = model
.getPatientFromReferralO(referredPatient);
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
PatiantInformtion patient = model.getPatientFromReferralO(referredPatient);
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patient,
"patientType": "1",
"isInpatient": true,
"arrivalType": "1",
"from": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
"to": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
"from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
"to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
});
},
child: Padding(
@ -143,8 +134,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
"${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}",
@ -153,7 +143,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
fontWeight: FontWeight.w700,
color: referredPatient.referralStatus == 1
? Color(0xffc4aa54)
: referredPatient.referralStatus == 46
: referredPatient.referralStatus == 46 || referredPatient.referralStatus == 2
? Colors.green[700]
: Colors.red[700],
),
@ -169,28 +159,23 @@ class ReferralPatientDetailScreen extends StatelessWidget {
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.fileNumber,
TranslationBase.of(context).fileNumber,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize:
1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
AppText(
"${referredPatient.patientID}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
],
@ -207,94 +192,79 @@ class ReferralPatientDetailScreen extends StatelessWidget {
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).refClinic}: ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 *
SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
AppText(
referredPatient
.referringClinicDescription,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 *
SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.frequency +
": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 *
SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient
.frequencyDescription,
referredPatient.referringClinicDescription,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 *
SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
],
),
if (referredPatient.frequency != null)
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).frequency + ": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient.frequencyDescription ?? '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
],
),
],
),
),
Row(
children: [
AppText(
referredPatient.nationalityName !=
null
referredPatient.nationalityName != null
? referredPatient.nationalityName
: "",
fontWeight: FontWeight.bold,
color: Color(0xFF2E303A),
fontSize:
1.4 * SizeConfig.textMultiplier,
fontSize: 1.4 * SizeConfig.textMultiplier,
),
referredPatient.nationalityFlagURL !=
null
referredPatient.nationalityFlagURL != null
? ClipRRect(
borderRadius:
BorderRadius.circular(20.0),
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
referredPatient
.nationalityFlagURL,
referredPatient.nationalityFlagURL,
height: 25,
width: 30,
errorBuilder: (BuildContext
context,
Object exception,
StackTrace stackTrace) {
errorBuilder:
(BuildContext context, Object exception, StackTrace stackTrace) {
return Text('No Image');
},
))
@ -303,63 +273,60 @@ class ReferralPatientDetailScreen extends StatelessWidget {
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).priority +
": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient.priorityDescription,
if (referredPatient.priorityDescription != null)
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).priority + ": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.maxResponseTime +
": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
AppDateUtils.convertDateFromServerFormat(
referredPatient.mAXResponseTime,
"dd MMM,yyyy"),
Expanded(
child: AppText(
referredPatient.priorityDescription ?? '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
],
),
if (referredPatient.mAXResponseTime != null)
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).maxResponseTime + ": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
),
],
),
Expanded(
child: AppText(
referredPatient.mAXResponseTime != null
? AppDateUtils.convertDateFromServerFormat(
referredPatient.mAXResponseTime, "dd MMM,yyyy")
: '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin:
EdgeInsets.only(left: 10, right: 0),
margin: EdgeInsets.only(left: 10, right: 0),
child: Image.asset(
'assets/images/patient/ic_ref_arrow_up.png',
height: 50,
@ -367,26 +334,17 @@ class ReferralPatientDetailScreen extends StatelessWidget {
),
),
Container(
margin: EdgeInsets.only(
left: 0,
top: 25,
right: 0,
bottom: 0),
padding: EdgeInsets.only(
left: 4.0, right: 4.0),
child: referredPatient.doctorImageURL !=
null
margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0),
padding: EdgeInsets.only(left: 4.0, right: 4.0),
child: referredPatient.doctorImageURL != null
? ClipRRect(
borderRadius:
BorderRadius.circular(20.0),
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
referredPatient.doctorImageURL,
height: 25,
width: 30,
errorBuilder:
(BuildContext context,
Object exception,
StackTrace stackTrace) {
(BuildContext context, Object exception, StackTrace stackTrace) {
return Text('No Image');
},
))
@ -402,30 +360,22 @@ class ReferralPatientDetailScreen extends StatelessWidget {
Expanded(
flex: 4,
child: Container(
margin: EdgeInsets.only(
left: 10,
top: 30,
right: 10,
bottom: 0),
margin: EdgeInsets.only(left: 10, top: 30, right: 10, bottom: 0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).dr} ${referredPatient.referringDoctorName}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w800,
fontSize: 1.5 *
SizeConfig.textMultiplier,
fontSize: 1.5 * SizeConfig.textMultiplier,
color: Colors.black,
),
AppText(
referredPatient
.referringClinicDescription,
referredPatient.referringClinicDescription,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.3 *
SizeConfig.textMultiplier,
fontSize: 1.3 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
],
@ -445,67 +395,110 @@ class ReferralPatientDetailScreen extends StatelessWidget {
),
Expanded(
child: SingleChildScrollView(
child: Container(
width: double.infinity,
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(8)),
border: Border.fromBorderSide(BorderSide(
color: Colors.white,
width: 1.0,
)),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).remarks,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 2.4 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
child: Column(
children: [
Container(
width: double.infinity,
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(8)),
border: Border.fromBorderSide(BorderSide(
color: Colors.white,
width: 1.0,
)),
),
AppText(
referredPatient.referringDoctorRemarks,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).remarks,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 2.4 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
AppText(
referredPatient.referringDoctorRemarks ?? '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
SizedBox(
height: 8,
),
],
),
SizedBox(
height: 8,
),
if (referredPatient.referredDoctorRemarks.isNotEmpty)
Container(
width: double.infinity,
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 0),
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(8)),
border: Border.fromBorderSide(BorderSide(
color: Colors.white,
width: 1.0,
)),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).reply,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 2.4 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
AppText(
referredPatient.referredDoctorRemarks ?? '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
SizedBox(
height: 8,
),
],
),
),
],
),
],
),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: AppButton(
title: TranslationBase.of(context).replay,
color: Colors.red[700],
fontColor: Colors.white,
fontWeight: FontWeight.w700,
fontSize: 1.8,
hPadding: 8,
vPadding: 12,
onPressed: () async {
Navigator.push(
context,
SlideUpPageRoute(
widget: AddReplayOnReferralPatient(
patientReferralViewModel: patientReferralViewModel,
myReferralInPatientModel: referredPatient,
if (referredPatient.referralStatus == 1)
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: AppButton(
title: TranslationBase.of(context).replay,
color: Colors.red[700],
fontColor: Colors.white,
fontWeight: FontWeight.w700,
fontSize: 1.8,
hPadding: 8,
vPadding: 12,
onPressed: () async {
Navigator.push(
context,
SlideUpPageRoute(
widget: AddReplayOnReferralPatient(
patientReferralViewModel: patientReferralViewModel,
myReferralInPatientModel: referredPatient,
isEdited: referredPatient.referredDoctorRemarks.isNotEmpty,
),
),
),
);
},
);
},
),
),
),
],
),
),

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/core/enum/PatientType.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/referred_patient_detail_in-paint.dart';
@ -6,12 +7,15 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class ReferredPatientScreen extends StatelessWidget {
// previous design page is: MyReferredPatient
PatientType patientType = PatientType.IN_PATIENT;
@override
Widget build(BuildContext context) {
return BaseView<PatientReferralViewModel>(
@ -20,103 +24,172 @@ class ReferredPatientScreen extends StatelessWidget {
baseViewModel: model,
isShowAppBar: false,
appBarTitle: TranslationBase.of(context).referredPatient,
body: model.listMyReferredPatientModel == null ||
model.listMyReferredPatientModel.length == 0
? Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
height: 100,
body: Column(
children: [
Container(
margin: EdgeInsets.only(top: 70),
child: PatientTypeRadioWidget(
(patientType) async {
this.patientType = patientType;
GifLoaderDialogUtils.showMyDialog(context);
if (patientType == PatientType.IN_PATIENT) {
await model.getMyReferredPatient(isFirstTime: false);
} else {
await model.getMyReferredOutPatient(isFirstTime: false);
}
GifLoaderDialogUtils.hideDialog(context);
},
),
),
model.listMyReferredPatientModel == null ||
model.listMyReferredPatientModel.length == 0
? Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
height: 100,
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(
TranslationBase.of(context).referralEmptyMsg,
color: Theme.of(context).errorColor,
),
)
],
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(
TranslationBase.of(context).referralEmptyMsg,
color: Theme.of(context).errorColor,
),
)
],
),
)
: SingleChildScrollView(
// DoctorApplication.svc/REST/GtMyReferredPatient
child: Container(
margin: EdgeInsets.only(top: 70),
child: Column(
children: [
// const Divider(
// color: Color(0xffCCCCCC),
// height: 1,
// thickness: 2,
// indent: 0,
// endIndent: 0,
// ),
...List.generate(
model.listMyReferredPatientModel.length,
(index) => InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: ReferredPatientDetailScreen(
model.getReferredPatientItem(index)),
)
: Expanded(
child: SingleChildScrollView(
// DoctorApplication.svc/REST/GtMyReferredPatient
child: Container(
child: Column(
children: [
...List.generate(
model.listMyReferredPatientModel.length,
(index) => InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: ReferredPatientDetailScreen(
model.getReferredPatientItem(index)),
),
);
},
child: PatientReferralItemWidget(
referralStatus: model
.getReferredPatientItem(index)
.referralStatusDesc,
referralStatusCode: model
.getReferredPatientItem(index)
.referralStatus,
patientName:
"${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}",
patientGender:
model.getReferredPatientItem(index).gender,
referredDate:
AppDateUtils.convertDateFromServerFormat(
model
.getReferredPatientItem(index)
.referralDate,
"dd/MM/yyyy"),
referredTime:
AppDateUtils.convertDateFromServerFormat(
model
.getReferredPatientItem(index)
.referralDate,
"hh:mm a"),
patientID:
"${model.getReferredPatientItem(index).patientID}",
isSameBranch: model
.getReferredPatientItem(index)
.isReferralDoctorSameBranch,
isReferral: false,
remark: model
.getReferredPatientItem(index)
.referringDoctorRemarks,
nationality: model
.getReferredPatientItem(index)
.nationalityName,
nationalityFlag: model
.getReferredPatientItem(index)
.nationalityFlagURL,
doctorAvatar: model
.getReferredPatientItem(index)
.doctorImageURL,
referralDoctorName:
"${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}",
clinicDescription: model
.getReferredPatientItem(index)
.referralClinicDescription,
infoIcon: Icon(FontAwesomeIcons.arrowRight,
size: 25, color: Colors.black),
),
),
);
},
child: PatientReferralItemWidget(
referralStatus:model.getReferredPatientItem(index).referralStatusDesc,
referralStatusCode: model
.getReferredPatientItem(index)
.referralStatus,
patientName:
"${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}",
patientGender:
model.getReferredPatientItem(index).gender,
referredDate: AppDateUtils.convertDateFromServerFormat(
model
.getReferredPatientItem(index)
.referralDate,
"dd/MM/yyyy"),
referredTime: AppDateUtils.convertDateFromServerFormat(
model
.getReferredPatientItem(index)
.referralDate,
"hh:mm a"),
patientID:
"${model.getReferredPatientItem(index).patientID}",
isSameBranch: model
.getReferredPatientItem(index)
.isReferralDoctorSameBranch,
isReferral: false,
remark: model
.getReferredPatientItem(index)
.referringDoctorRemarks,
nationality: model
.getReferredPatientItem(index)
.nationalityName,
nationalityFlag: model
.getReferredPatientItem(index)
.nationalityFlagURL,
doctorAvatar: model
.getReferredPatientItem(index)
.doctorImageURL,
referralDoctorName:
"${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}",
clinicDescription: model
.getReferredPatientItem(index)
.referralClinicDescription,
infoIcon: Icon(FontAwesomeIcons.arrowRight,
size: 25, color: Colors.black),
),
),
],
),
),
],
),
),
),
),
],
),
),
);
}
}
class PatientTypeRadioWidget extends StatefulWidget {
final Function(PatientType) radioOnChange;
PatientTypeRadioWidget(this.radioOnChange);
@override
_PatientTypeRadioWidgetState createState() =>
_PatientTypeRadioWidgetState(this.radioOnChange);
}
class _PatientTypeRadioWidgetState extends State<PatientTypeRadioWidget> {
final Function(PatientType) radioOnChange;
_PatientTypeRadioWidgetState(this.radioOnChange);
PatientType patientType = PatientType.IN_PATIENT;
@override
Widget build(BuildContext context) {
return Row(
children: [
Expanded(
child: RadioListTile<PatientType>(
title: AppText(TranslationBase.of(context).inPatient),
value: PatientType.IN_PATIENT,
groupValue: patientType,
onChanged: (PatientType value) {
setState(() {
patientType = value;
radioOnChange(value);
});
},
),
),
Expanded(
child: RadioListTile<PatientType>(
title: AppText(TranslationBase.of(context).outpatient),
value: PatientType.OUT_PATIENT,
groupValue: patientType,
onChanged: (PatientType value) {
setState(() {
patientType = value;
radioOnChange(value);
});
},
),
),
],
);
}
}

@ -236,6 +236,8 @@ class ReferredPatientDetailScreen extends StatelessWidget {
),
],
),
if(referredPatient
.frequencyDescription != null)
Row(
mainAxisAlignment:
MainAxisAlignment.start,
@ -301,6 +303,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
)
],
),
if(referredPatient.priorityDescription != null)
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
@ -322,6 +325,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
),
],
),
if(referredPatient.mAXResponseTime != null)
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
@ -337,9 +341,9 @@ class ReferredPatientDetailScreen extends StatelessWidget {
),
Expanded(
child: AppText(
AppDateUtils.convertDateFromServerFormat(
referredPatient.mAXResponseTime != null?AppDateUtils.convertDateFromServerFormat(
referredPatient.mAXResponseTime,
"dd MMM,yyyy"),
"dd MMM,yyyy"):'',
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
@ -515,6 +519,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
),
AppText(
referredPatient
.referredDoctorRemarks == null ?'':referredPatient
.referredDoctorRemarks.isNotEmpty
? referredPatient.referredDoctorRemarks
: TranslationBase.of(context).notRepliedYet,
@ -543,7 +548,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
fontSize: 1.8,
hPadding: 8,
vPadding: 12,
disabled: referredPatient.referredDoctorRemarks.isNotEmpty
disabled: referredPatient.referredDoctorRemarks == null? true: referredPatient.referredDoctorRemarks.isNotEmpty
? false
: true,
onPressed: () async {

@ -7,7 +7,7 @@ import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/update_subjective_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -82,7 +82,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
PatientProfileHeaderNewDesign(patient, '7', '7',),
PatientProfileAppBar(patient),
Container(
width: double.infinity,
height: 1,

@ -6,7 +6,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item.dart';
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
@ -40,8 +40,8 @@ class VitalSignDetailsScreen extends StatelessWidget {
baseViewModel: mode,
isShowAppBar: true,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
appBar: PatientProfileHeaderNewDesignAppBar(
patient, patientType, arrivalType),
appBar: PatientProfileAppBar(
patient),
appBarTitle: TranslationBase.of(context).vitalSign,
body: mode.patientVitalSignsHistory.length > 0
? Column(

@ -7,7 +7,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sig
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart';
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
@ -190,8 +190,8 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
appBarTitle: pageTitle,
backgroundColor: Color.fromRGBO(248, 248, 248, 1),
isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(
patient, patientType, arrivalType),
appBar: PatientProfileAppBar(
patient,),
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,

@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
@ -44,8 +44,8 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
isShowAppBar: true,
backgroundColor: Colors.grey[100],
baseViewModel: model,
appBar: PatientProfileHeaderNewDesignAppBar(
patient, patient.patientType.toString(), patient.arrivedOn),
appBar: PatientProfileAppBar(
patient),
body: SingleChildScrollView(
child: Container(
child: Column(

@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/ShowImageDialog.dart';
@ -28,16 +28,15 @@ class PrescriptionItemsPage extends StatelessWidget {
isShowAppBar: true,
backgroundColor: Colors.grey[100],
baseViewModel: model,
appBar: PatientProfileHeaderWhitAppointmentAppBar(
patient: patient,
patientType: patientType??"0",
arrivalType: arrivalType??"0",
appBar: PatientProfileAppBar(
patient,
clinic: prescriptions.clinicDescription,
branch: prescriptions.name,
isPrescriptions: true,
appointmentDate: AppDateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate),
doctorName: prescriptions.doctorName,
profileUrl: prescriptions.doctorImageURL,
isAppointmentHeader: true,
),
body: SingleChildScrollView(
child: Container(

@ -1,591 +0,0 @@
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.dart';
import 'package:doctor_app_flutter/screens/prescription/update_prescription_form.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart';
class NewPrescriptionScreen extends StatefulWidget {
@override
_NewPrescriptionScreenState createState() => _NewPrescriptionScreenState();
}
class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
PersistentBottomSheetController _controller;
TextEditingController strengthController = TextEditingController();
int testNum = 0;
int strengthChar;
PatiantInformtion patient;
@override
void initState() {
super.initState();
}
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient'];
return BaseView<PrescriptionViewModel>(
onModelReady: (model) => model.getPrescription(mrn: patient.patientId),
builder: (BuildContext context, PrescriptionViewModel model, Widget child) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).prescription,
body: NetworkBaseView(
baseViewModel: model,
child: SingleChildScrollView(
child: Container(
color: Colors.white,
child: Column(
children: [
PatientPageHeaderWidget(patient),
Divider(
height: 1.0,
thickness: 1.0,
color: Colors.grey,
),
(model.prescriptionList.length != 0)
? SizedBox(height: model.prescriptionList[0].rowcount == 0 ? 200.0 : 10.0)
: SizedBox(height: 200.0),
//model.prescriptionList == null
(model.prescriptionList.length != 0)
? model.prescriptionList[0].rowcount == 0
? Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
InkWell(
onTap: () {
addPrescriptionForm(context, model, patient, model.prescriptionList);
//model.postPrescription();
},
child: CircleAvatar(
radius: 65,
backgroundColor: Color(0XFFB8382C),
child: CircleAvatar(
radius: 60,
backgroundColor: Colors.white,
child: Icon(
Icons.add,
color: Colors.black,
size: 45.0,
),
),
),
),
SizedBox(
height: 15.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
TranslationBase.of(context).noPrescriptionListed,
color: Colors.black,
fontWeight: FontWeight.w900,
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
TranslationBase.of(context).addNow,
color: Color(0XFFB8382C),
fontWeight: FontWeight.w900,
),
],
),
],
)
: Padding(
padding: EdgeInsets.all(14.0),
child: NetworkBaseView(
baseViewModel: model,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
InkWell(
child: Container(
height: 50.0,
width: 450.0,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(10.0),
),
child: Padding(
padding: EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
' Add more medication',
fontWeight: FontWeight.w100,
fontSize: 12.5,
),
Icon(
Icons.add,
color: Color(0XFFB8382C),
)
],
),
),
),
onTap: () {
addPrescriptionForm(context, model, patient, model.prescriptionList);
//model.postPrescription();
},
),
SizedBox(
height: 10.0,
),
...List.generate(
model.prescriptionList[0].rowcount,
(index) => Container(
color: Colors.white,
child: Column(
children: [
SizedBox(
height: MediaQuery.of(context).size.height * 0.022,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment:
// CrossAxisAlignment.start,
children: [
Container(
color: Colors.white,
height: MediaQuery.of(context).size.height * 0.21,
width: MediaQuery.of(context).size.width * 0.1,
child: Column(
children: [
AppText(
(DateTime.parse(model.prescriptionList[0].entityList[index]
.createdOn) !=
null
? (DateTime.parse(model.prescriptionList[0]
.entityList[index].createdOn)
.year)
.toString()
: DateTime.now().year)
.toString(),
color: Colors.green,
fontSize: 13.5,
),
AppText(
AppDateUtils.getMonth(model.prescriptionList[0]
.entityList[index].createdOn !=
null
? (DateTime.parse(model.prescriptionList[0]
.entityList[index].createdOn)
.month)
: DateTime.now().month)
.toUpperCase(),
color: Colors.green,
),
AppText(
DateTime.parse(
model.prescriptionList[0].entityList[index].createdOn)
.day
.toString(),
color: Colors.green,
),
AppText(
AppDateUtils.getTimeFormated(DateTime.parse(model
.prescriptionList[0].entityList[index].createdOn))
.toString(),
color: Colors.green,
),
],
),
),
Container(
color: Colors.white,
// height: MediaQuery.of(
// context)
// .size
// .height *
// 0.3499,
width: MediaQuery.of(context).size.width * 0.77,
child: Column(
children: [
Row(
children: [
AppText(
'Start Date:',
fontWeight: FontWeight.w700,
fontSize: 14.0,
),
Expanded(
child: AppText(
AppDateUtils.getDateFormatted(DateTime.parse(model
.prescriptionList[0].entityList[index].startDate)),
fontSize: 13.5,
),
),
SizedBox(
width: 6.0,
),
AppText(
'Order Type:',
fontWeight: FontWeight.w700,
fontSize: 14.0,
),
Expanded(
child: AppText(
model.prescriptionList[0].entityList[index]
.orderTypeDescription,
fontSize: 13.0,
),
),
],
),
SizedBox(
height: 5.5,
),
Row(
children: [
Container(
color: Colors.white,
child: Expanded(
child: AppText(
model.prescriptionList[0].entityList[index]
.medicationName,
fontWeight: FontWeight.w700,
fontSize: 15.0,
),
),
)
],
),
SizedBox(
height: 5.5,
),
Row(
children: [
Expanded(
child: AppText(
model.prescriptionList[0].entityList[index].doseDetail,
fontSize: 15.0,
),
)
],
),
SizedBox(
height: 10.0,
),
Row(
children: [
AppText(
'Indication: ',
fontWeight: FontWeight.w700,
fontSize: 17.0,
),
Expanded(
child: RichText(
maxLines: 3,
overflow: TextOverflow.ellipsis,
strutStyle: StrutStyle(fontSize: 12.0),
text: TextSpan(
style: TextStyle(color: Colors.black),
text: model.prescriptionList[0].entityList[index]
.indication),
),
),
],
),
Row(
children: [
AppText(
'UOM: ',
fontWeight: FontWeight.w700,
fontSize: 17.0,
),
Expanded(
child: RichText(
maxLines: 3,
overflow: TextOverflow.ellipsis,
strutStyle: StrutStyle(fontSize: 12.0),
text: TextSpan(
style: TextStyle(color: Colors.black),
text: model
.prescriptionList[0].entityList[index].uom),
),
),
],
),
Row(
children: [
AppText(
'BOX Quantity: ',
fontWeight: FontWeight.w700,
fontSize: 17.0,
),
Expanded(
child: RichText(
maxLines: 3,
overflow: TextOverflow.ellipsis,
strutStyle: StrutStyle(fontSize: 12.0),
text: TextSpan(
style: TextStyle(color: Colors.black),
text: model.prescriptionList[0].entityList[index]
.quantity
.toString() ==
null
? ""
: model.prescriptionList[0].entityList[index]
.quantity
.toString()),
),
),
],
),
Row(
children: [
AppText(
'pharmacy Intervention ',
fontWeight: FontWeight.w700,
fontSize: 17.0,
),
Expanded(
child: RichText(
maxLines: 3,
overflow: TextOverflow.ellipsis,
strutStyle: StrutStyle(fontSize: 12.0),
text: TextSpan(
style: TextStyle(color: Colors.black),
text: model.prescriptionList[0].entityList[index]
.pharmacyInervention ==
null
? ""
: model.prescriptionList[0].entityList[index]
.pharmacyInervention
.toString()),
),
),
],
),
SizedBox(height: 5.0),
Row(
children: [
AppText(
'pharmacist Remarks : ',
fontWeight: FontWeight.w700,
fontSize: 15.0,
),
Expanded(
child: AppText(
model.prescriptionList[0].entityList[index]
.pharmacistRemarks ==
null
? ""
: model.prescriptionList[0].entityList[index]
.pharmacistRemarks,
fontSize: 15.0),
)
],
),
SizedBox(
height: 20.0,
),
Row(
children: [
AppText(
TranslationBase.of(context).doctorName + ": ",
fontWeight: FontWeight.w600,
),
Expanded(
child: AppText(
model.prescriptionList[0].entityList[index].doctorName,
fontWeight: FontWeight.w700,
),
)
],
),
SizedBox(
height: 8.0,
),
Row(
children: [
AppText(
'Doctor Remarks : ',
fontWeight: FontWeight.w700,
fontSize: 13.0,
),
Expanded(
child: Container(
color: Colors.white,
// height: MediaQuery.of(context).size.height *
// 0.038,
child: RichText(
// maxLines:
// 2,
// overflow:
// TextOverflow.ellipsis,
strutStyle: StrutStyle(fontSize: 10.0),
text: TextSpan(
style: TextStyle(color: Colors.black),
text: model.prescriptionList[0].entityList[index]
.remarks !=
null
? model.prescriptionList[0].entityList[index]
.remarks
: "",
),
),
),
),
],
),
SizedBox(
height: 10.0,
),
// SizedBox(
// height: 40,
// ),
],
),
),
Container(
color: Colors.white,
height: MediaQuery.of(context).size.height * 0.16,
width: MediaQuery.of(context).size.width * 0.06,
child: Column(
children: [
InkWell(
child: Icon(Icons.edit),
onTap: () {
updatePrescriptionForm(
box: model
.prescriptionList[0].entityList[index].quantity,
uom: model.prescriptionList[0].entityList[index].uom,
drugNameGeneric: model.prescriptionList[0]
.entityList[index].medicationName,
doseUnit: model.prescriptionList[0].entityList[index]
.doseDailyUnitID
.toString(),
doseStreangth: model.prescriptionList[0]
.entityList[index].doseDailyQuantity
.toString(),
duration: model.prescriptionList[0].entityList[index]
.doseDurationDays
.toString(),
startDate: model
.prescriptionList[0].entityList[index].startDate
.toString(),
dose: model.prescriptionList[0].entityList[index].doseTimingID
.toString(),
frequency: model
.prescriptionList[0].entityList[index].frequencyID
.toString(),
rouat: model.prescriptionList[0].entityList[index].routeID
.toString(),
patient: patient,
drugId: model.prescriptionList[0].entityList[index].medicineCode,
drugName: model.prescriptionList[0].entityList[index].medicationName,
remarks: model.prescriptionList[0].entityList[index].remarks,
model: model,
enteredRemarks: model.prescriptionList[0].entityList[index].remarks,
context: context);
//model.postPrescription();
},
),
],
),
),
],
),
Divider(
height: 0,
thickness: 1.0,
color: Colors.grey,
),
],
),
),
),
],
),
),
)
: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
InkWell(
onTap: () {
addPrescriptionForm(context, model, patient, model.prescriptionList);
//model.postPrescription();
},
child: CircleAvatar(
radius: 65,
backgroundColor: Color(0XFFB8382C),
child: CircleAvatar(
radius: 60,
backgroundColor: Colors.white,
child: Icon(
Icons.add,
color: Colors.black,
size: 45.0,
),
),
),
),
SizedBox(
height: 15.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
TranslationBase.of(context).noPrescriptionListed,
color: Colors.black,
fontWeight: FontWeight.w900,
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
TranslationBase.of(context).addNow,
color: Color(0XFFB8382C),
fontWeight: FontWeight.w900,
),
],
),
],
)
],
),
),
),
)),
);
}
selectDate(BuildContext context, PrescriptionViewModel model) async {
DateTime selectedDate;
selectedDate = DateTime.now();
final DateTime picked = await showDatePicker(
context: context,
initialDate: selectedDate,
firstDate: DateTime.now().add(Duration(hours: 2)),
lastDate: DateTime(2040),
initialEntryMode: DatePickerEntryMode.calendar,
);
if (picked != null && picked != selectedDate) {
setState(() {
selectedDate = picked;
});
}
}
}

@ -1,516 +0,0 @@
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart';
class NewPrescriptionHistoryScreen extends StatefulWidget {
@override
_NewPrescriptionHistoryScreenState createState() =>
_NewPrescriptionHistoryScreenState();
}
class _NewPrescriptionHistoryScreenState
extends State<NewPrescriptionHistoryScreen> {
PersistentBottomSheetController _controller;
final _scaffoldKey = GlobalKey<ScaffoldState>();
TextEditingController strengthController = TextEditingController();
int testNum = 0;
int strengthChar;
PatiantInformtion patient;
@override
void initState() {
super.initState();
}
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient'];
return BaseView<PrescriptionViewModel>(
onModelReady: (model) => model.getPrescription(mrn: patient.patientId),
builder:
(BuildContext context, PrescriptionViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).prescription,
body: NetworkBaseView(
baseViewModel: model,
child: SingleChildScrollView(
child: Container(
color: Colors.white,
child: Column(
children: [
PatientPageHeaderWidget(patient),
Divider(
height: 1.0,
thickness: 1.0,
color: Colors.grey,
),
(model.prescriptionList.length != 0)
? SizedBox(
height:
model.prescriptionList[0].rowcount == 0
? 200.0
: 10.0)
: SizedBox(height: 200.0),
//model.prescriptionList == null
(model.prescriptionList.length != 0)
? model.prescriptionList[0].rowcount == 0
? Container(
child: AppText(
'Sorry , Theres no prescriptions for this patient',
color: Color(0xFFB9382C),
),
)
: Padding(
padding: EdgeInsets.all(14.0),
child: NetworkBaseView(
baseViewModel: model,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
...List.generate(
model.prescriptionList[0]
.rowcount,
(index) => Container(
color: Colors.white,
child: Column(
children: [
SizedBox(
height: MediaQuery.of(
context)
.size
.height *
0.022,
),
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
// crossAxisAlignment:
// CrossAxisAlignment.start,
children: [
Container(
height: MediaQuery.of(
context)
.size
.height *
0.21,
width: MediaQuery.of(
context)
.size
.width *
0.1,
child: Column(
children: [
AppText(
(DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) !=
null
? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn).year)
.toString()
: DateTime.now()
.year)
.toString(),
color: Colors
.green,
fontSize:
13.5,
),
AppText(
AppDateUtils.getMonth(model.prescriptionList[0].entityList[index].createdOn !=
null
? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn)
.month)
: DateTime.now()
.month)
.toUpperCase(),
color: Colors
.green,
),
AppText(
DateTime.parse(model
.prescriptionList[
0]
.entityList[
index]
.createdOn)
.day
.toString(),
color: Colors
.green,
),
AppText(
AppDateUtils.getTimeFormated(DateTime.parse(model
.prescriptionList[
0]
.entityList[
index]
.createdOn))
.toString(),
color: Colors
.green,
),
],
),
),
Container(
// height: MediaQuery.of(
// context)
// .size
// .height *
// 0.3499,
width: MediaQuery.of(
context)
.size
.width *
0.77,
child: Column(
children: [
Row(
children: [
AppText(
'Start Date:',
fontWeight:
FontWeight
.w700,
fontSize:
14.0,
),
Expanded(
child:
AppText(
AppDateUtils.getDateFormatted(DateTime.parse(model
.prescriptionList[0]
.entityList[index]
.startDate)),
fontSize:
13.5,
),
),
SizedBox(
width:
6.0,
),
AppText(
'Order Type:',
fontWeight:
FontWeight
.w700,
fontSize:
14.0,
),
Expanded(
child:
AppText(
model
.prescriptionList[0]
.entityList[index]
.orderTypeDescription,
fontSize:
13.0,
),
),
],
),
SizedBox(
height: 5.5,
),
Row(
children: [
Container(
child:
Expanded(
child:
AppText(
model
.prescriptionList[0]
.entityList[index]
.medicationName,
fontWeight:
FontWeight.w700,
fontSize:
15.0,
),
),
)
],
),
SizedBox(
height: 5.5,
),
Row(
children: [
Expanded(
child:
AppText(
model
.prescriptionList[0]
.entityList[index]
.doseDetail,
fontSize:
15.0,
),
)
],
),
SizedBox(
height: 10.0,
),
Row(
children: [
AppText(
'Indication: ',
fontWeight:
FontWeight
.w700,
fontSize:
17.0,
),
Expanded(
child:
RichText(
maxLines:
3,
overflow:
TextOverflow.ellipsis,
strutStyle:
StrutStyle(fontSize: 12.0),
text: TextSpan(
style:
TextStyle(color: Colors.black),
text: model.prescriptionList[0].entityList[index].indication),
),
),
],
),
Row(
children: [
AppText(
'UOM: ',
fontWeight:
FontWeight
.w700,
fontSize:
17.0,
),
Expanded(
child:
RichText(
maxLines:
3,
overflow:
TextOverflow.ellipsis,
strutStyle:
StrutStyle(fontSize: 12.0),
text: TextSpan(
style:
TextStyle(color: Colors.black),
text: model.prescriptionList[0].entityList[index].uom),
),
),
],
),
Row(
children: [
AppText(
'BOX Quantity: ',
fontWeight:
FontWeight
.w700,
fontSize:
17.0,
),
Expanded(
child:
RichText(
maxLines:
3,
overflow:
TextOverflow.ellipsis,
strutStyle:
StrutStyle(fontSize: 12.0),
text: TextSpan(
style:
TextStyle(color: Colors.black),
text: model.prescriptionList[0].entityList[index].quantity.toString() == null ? "" : model.prescriptionList[0].entityList[index].quantity.toString()),
),
),
],
),
Row(
children: [
AppText(
'pharmacy Intervention ',
fontWeight:
FontWeight
.w700,
fontSize:
17.0,
),
Expanded(
child:
RichText(
maxLines:
3,
overflow:
TextOverflow.ellipsis,
strutStyle:
StrutStyle(fontSize: 12.0),
text: TextSpan(
style:
TextStyle(color: Colors.black),
text: model.prescriptionList[0].entityList[index].pharmacyInervention == null ? "" : model.prescriptionList[0].entityList[index].pharmacyInervention.toString()),
),
),
],
),
SizedBox(
height:
5.0),
Row(
children: [
AppText(
'pharmacist Remarks : ',
fontWeight:
FontWeight
.w700,
fontSize:
15.0,
),
Expanded(
child: AppText(
// commening below code because there is an error coming in the model please fix it before pushing it
model.prescriptionList[0].entityList[index].pharmacistRemarks == null ? "" : model.prescriptionList[0].entityList[index].pharmacistRemarks,
fontSize: 15.0),
)
],
),
SizedBox(
height: 20.0,
),
Row(
children: [
AppText(
TranslationBase.of(context)
.doctorName +
": ",
fontWeight:
FontWeight
.w600,
),
Expanded(
child:
AppText(
model
.prescriptionList[0]
.entityList[index]
.doctorName,
fontWeight:
FontWeight.w700,
),
)
],
),
SizedBox(
height: 8.0,
),
Row(
children: [
AppText(
'Doctor Remarks : ',
fontWeight:
FontWeight
.w700,
fontSize:
13.0,
),
Expanded(
child:
Container(
// height: MediaQuery.of(context).size.height *
// 0.038,
child:
RichText(
// maxLines:
// 2,
// overflow:
// TextOverflow.ellipsis,
strutStyle:
StrutStyle(fontSize: 10.0),
text:
TextSpan(
style:
TextStyle(color: Colors.black),
text: model.prescriptionList[0].entityList[index].remarks != null
? model.prescriptionList[0].entityList[index].remarks
: "",
),
),
),
),
],
),
SizedBox(
height: 10.0,
),
// SizedBox(
// height: 40,
// ),
],
),
),
],
),
Divider(
height: 0,
thickness: 1.0,
color: Colors.grey,
),
],
),
),
),
],
),
),
)
: Container(
child: AppText(
'Sorry , theres no prescriptions listed for this patient',
color: Color(0xFFB9382C),
),
)
],
),
),
),
)),
);
}
selectDate(BuildContext context, PrescriptionViewModel model) async {
DateTime selectedDate;
selectedDate = DateTime.now();
final DateTime picked = await showDatePicker(
context: context,
initialDate: selectedDate,
firstDate: DateTime.now().add(Duration(hours: 2)),
lastDate: DateTime(2040),
initialEntryMode: DatePickerEntryMode.calendar,
);
if (picked != null && picked != selectedDate) {
setState(() {
selectedDate = picked;
});
}
}
}

@ -8,7 +8,7 @@ import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_pag
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
@ -35,10 +35,8 @@ class PrescriptionsPage extends StatelessWidget {
baseViewModel: model,
isShowAppBar: true,
backgroundColor: Colors.grey[100],
appBar: PatientProfileHeaderNewDesignAppBar(
appBar: PatientProfileAppBar(
patient,
patientType ?? '0',
arrivalType,
isInpatient: isInpatient,
),
body: patient.admissionNo == null

@ -8,7 +8,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/procedures/update-procedure.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
@ -44,10 +44,8 @@ class ProcedureScreen extends StatelessWidget {
isShowAppBar: true,
backgroundColor: Colors.grey[100],
baseViewModel: model,
appBar: PatientProfileHeaderNewDesignAppBar(
appBar: PatientProfileAppBar(
patient,
arrivalType ?? '0',
patientType,
isInpatient: isInpatient,
),
body: SingleChildScrollView(

@ -61,8 +61,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
appBarTitle:
TranslationBase.of(context).qr + TranslationBase.of(context).reader,
appBarTitle: TranslationBase.of(context).qr + TranslationBase.of(context).reader,
body: Center(
child: Container(
margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7),
@ -80,9 +79,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
height: 7,
),
AppText(TranslationBase.of(context).scanQrCode,
fontSize: 14,
fontWeight: FontWeight.w400,
textAlign: TextAlign.center),
fontSize: 14, fontWeight: FontWeight.w400, textAlign: TextAlign.center),
SizedBox(
height: 15,
),
@ -106,18 +103,13 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
margin: EdgeInsets.only(top: 8),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.0),
color:
Theme.of(context).errorColor.withOpacity(0.06),
color: Theme.of(context).errorColor.withOpacity(0.06),
),
padding: EdgeInsets.symmetric(
vertical: 8.0, horizontal: 12.0),
padding: EdgeInsets.symmetric(vertical: 8.0, horizontal: 12.0),
child: Row(
children: <Widget>[
Expanded(
child: AppText(
error ??
TranslationBase.of(context)
.errorMessage,
child: AppText(error ?? TranslationBase.of(context).errorMessage,
color: Theme.of(context).errorColor)),
],
),
@ -162,9 +154,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
case "0":
if (response['List_MyOutPatient'] != null) {
setState(() {
patientList =
ModelResponse.fromJson(response['List_MyOutPatient'])
.list;
patientList = ModelResponse.fromJson(response['List_MyOutPatient']).list;
isLoading = false;
});
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
@ -181,8 +171,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
case "1":
if (response['List_MyInPatient'] != null) {
setState(() {
patientList =
ModelResponse.fromJson(response['List_MyInPatient']).list;
patientList = ModelResponse.fromJson(response['List_MyInPatient']).list;
isLoading = false;
error = "";
});
@ -203,8 +192,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
isLoading = false;
isError = true;
});
DrAppToastMsg.showErrorToast(
response['ErrorEndUserMessage'] ?? response['ErrorMessage']);
DrAppToastMsg.showErrorToast(response['ErrorEndUserMessage'] ?? response['ErrorMessage']);
}
}).catchError((error) {
setState(() {

@ -9,7 +9,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
@ -34,10 +34,8 @@ class AddSickLeavScreen extends StatelessWidget {
baseViewModel: model,
isShowAppBar: true,
backgroundColor: Colors.grey[100],
appBar: PatientProfileHeaderNewDesignAppBar(
appBar: PatientProfileAppBar(
patient,
routeArgs['patientType'] ?? "0",
routeArgs['arrivalType'] ?? "0",
isInpatient: isInpatient,
),
body: SingleChildScrollView(

@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
@ -25,10 +25,8 @@ class ShowSickLeaveScreen extends StatelessWidget {
baseViewModel: model,
isShowAppBar: true,
backgroundColor: Colors.grey[100],
appBar: PatientProfileHeaderNewDesignAppBar(
appBar: PatientProfileAppBar(
patient,
routeArgs['patientType'] ?? "0",
routeArgs['arrivalType'] ?? "0",
),
body: SingleChildScrollView(
child: Column(

@ -10,7 +10,7 @@ class VideoChannel{
/// channel name
static const _channel = const MethodChannel("Dr.cloudSolution/videoCall");
static openVideoCallScreen(
{kApiKey, kSessionId, kToken, callDuration, warningDuration,int vcId,String tokenID,String generalId,int doctorId, Function() onCallEnd , Function(SessionStatusModel sessionStatusModel) onCallNotRespond ,Function(String error) onFailure}) async {
{kApiKey, kSessionId, kToken, callDuration, warningDuration,int vcId,String tokenID,String generalId,int doctorId, String patientName, Function() onCallEnd , Function(SessionStatusModel sessionStatusModel) onCallNotRespond ,Function(String error) onFailure}) async {
var result;
try {
result = await _channel.invokeMethod(
@ -25,6 +25,7 @@ class VideoChannel{
"TokenID": tokenID,
"generalId": generalId,
"DoctorId": doctorId ,
"patientName": patientName,
},
);
if(result['callResponse'] == 'CallEnd') {

@ -16,7 +16,11 @@ class AppDateUtils {
}
static String convertStringToDateFormat(String date, String dateFormat) {
DateTime dateTime = DateTime.parse(date);
DateTime dateTime ;
if(date.contains("/Date"))
dateTime= getDateTimeFromServerFormat(date);
else
dateTime = DateTime.parse(date);
return convertDateToFormat(dateTime, dateFormat);
}
@ -68,20 +72,26 @@ class AppDateUtils {
return "$days ${TranslationBase.of(context).days}, $months ${TranslationBase.of(context).months}, $years ${TranslationBase.of(context).years}";
}
static String differenceBetweenDateAndCurrent(DateTime firstDate, BuildContext context) {
static String differenceBetweenDateAndCurrent(DateTime firstDate, BuildContext context, {bool isShowSecond = false, bool isShowDays = true }) {
DateTime now = DateTime.now();
// DateTime now = nows.add(Duration(days: 400, minutes: 25, hours: 0));
var difference = now.difference(firstDate);
int minutesInDays = difference.inMinutes;
int secondInDays = difference.inSeconds;
int hoursInDays = minutesInDays ~/ 60; // ~/ : truncating division to make the result int
int second = secondInDays % 60;
int minutes = minutesInDays % 60;
int days = hoursInDays ~/ 24;
int hours = hoursInDays % 24;
double hoursInOneDay = difference.inHours / difference.inDays;
return "$days ${TranslationBase.of(context).days}, $hours ${TranslationBase.of(context).hr}, $minutes ${TranslationBase.of(context).min}";
return (isShowDays
? (days > 0 ? "$days ${TranslationBase.of(context).days}," : '')
: "") +
(hours > 0 ? "$hours ${TranslationBase.of(context).hr}," : "") +
" $minutes ${TranslationBase.of(context).min}" +
(isShowSecond ? ", $second Sec" : "");
}
static String differenceBetweenServerDateAndCurrent(String str, BuildContext context) {
@ -365,4 +375,44 @@ class AppDateUtils {
else
return "";
}
// handel date like "09/05/2021 17:00"
static DateTime getDateTimeFromString(String str) {
List<String> array = str.split('/');
int day = int.parse(array[0]);
int month = int.parse(array[1]);
List<String> array2 = array[2].split(' ');
int year = int.parse(array2[0]);
String hour = array2[1];
List<String> hourList = hour.split(":");
DateTime date = DateTime(year, month, day, int.parse(hourList[0]), int.parse(hourList[1]));
return date;
}
static convertDateFormatImproved(String str) {
String newDate;
const start = "/Date(";
if (str.isNotEmpty) {
const end = "+0300)";
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
newDate = date.year.toString() +
"/" +
date.month.toString().padLeft(2, '0') +
"/" +
date.day.toString().padLeft(2, '0');
}
return newDate??'';
}
}

@ -1363,6 +1363,8 @@ class TranslationBase {
String get allLab => localizedValues['allLab'][locale.languageCode];
String get allPrescription => localizedValues['allPrescription'][locale.languageCode];
String get addPrescription => localizedValues['addPrescription'][locale.languageCode];
String get edit => localizedValues['edit'][locale.languageCode];
String get summeryReply => localizedValues['summeryReply'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -58,7 +58,7 @@ class PatientReferralItemWidget extends StatelessWidget {
child: CardWithBgWidget(
bgColor: referralStatusCode == 1
? Color(0xffc4aa54)
: referralStatusCode == 46
: referralStatusCode == 46 || referralStatusCode == 2
? Colors.green[700]
: Colors.red[700],
hasBorder: false,
@ -78,7 +78,7 @@ class PatientReferralItemWidget extends StatelessWidget {
fontWeight: FontWeight.w700,
color: referralStatusCode == 1
? Color(0xffc4aa54)
: referralStatusCode == 46
: referralStatusCode == 46 || referralStatusCode == 2
? Colors.green[700]
: Colors.red[700],
),
@ -155,6 +155,7 @@ class PatientReferralItemWidget extends StatelessWidget {
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
isSameBranch ? TranslationBase.of(context).referredFrom :TranslationBase.of(context).refClinic,
@ -163,13 +164,14 @@ class PatientReferralItemWidget extends StatelessWidget {
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
AppText(
!isReferralClinic? isSameBranch ? TranslationBase.of(context).sameBranch : TranslationBase.of(context).otherBranch: " "+referralClinic,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
Expanded(
child: AppText(
!isReferralClinic? isSameBranch ? TranslationBase.of(context).sameBranch : TranslationBase.of(context).otherBranch: " "+referralClinic,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
],
),
@ -215,7 +217,7 @@ class PatientReferralItemWidget extends StatelessWidget {
),
Expanded(
child: AppText(
remark,
remark??"",
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier,

@ -9,6 +9,8 @@ import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'ShowTimer.dart';
class PatientCard extends StatelessWidget {
final PatiantInformtion patientInfo;
final Function onTap;
@ -19,7 +21,7 @@ class PatientCard extends StatelessWidget {
final bool isFromSearch;
final bool isFromLiveCare;
const PatientCard(
PatientCard(
{Key key,
this.patientInfo,
this.onTap,
@ -33,6 +35,7 @@ class PatientCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
width: SizeConfig.screenWidth * 0.9,
margin: EdgeInsets.all(6),
@ -257,9 +260,9 @@ class PatientCard extends StatelessWidget {
patientInfo.fullName)
: (Helpers.capitalize(
patientInfo.firstName) +
" " +
Helpers.capitalize(
patientInfo.lastName)),
" " +
Helpers.capitalize(
patientInfo.lastName)),
fontSize: 16,
color: Color(0xff2e303a),
fontWeight: FontWeight.w700,
@ -267,6 +270,7 @@ class PatientCard extends StatelessWidget {
textOverflow: TextOverflow.ellipsis,
),
),
if (patientInfo.gender == 1)
Icon(
DoctorApp.male_2,
@ -277,6 +281,9 @@ class PatientCard extends StatelessWidget {
DoctorApp.female_1,
color: Colors.pink,
),
if(isFromLiveCare)
ShowTimer(patientInfo: patientInfo,),
]),
),
Row(
@ -515,12 +522,14 @@ class PatientCard extends StatelessWidget {
height: 25,
width: 35,
)),
])
: SizedBox()
])
: SizedBox()
],
),
onTap: onTap,
)),
));
}
}
}

@ -0,0 +1,59 @@
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class ShowTimer extends StatefulWidget {
final PatiantInformtion patientInfo;
const ShowTimer({
Key key, this.patientInfo,
}) : super(key: key);
@override
_ShowTimerState createState() => _ShowTimerState();
}
class _ShowTimerState extends State<ShowTimer> {
int remainingTime = 600;
String displayTime = '';
@override
Widget build(BuildContext context) {
if (displayTime.isEmpty) {
startShowTimer();
}
return AppText(
"$displayTime",
color: Colors.red,
textAlign: TextAlign.start,
fontWeight: FontWeight.bold,
fontSize: 11,
);
}
startShowTimer() {
// this.remainingTime--;
setState(() {
displayTime = this.generateShowTimerString();
});
Future.delayed(Duration(seconds: 1), () {
if (this.remainingTime > 0) {
startShowTimer();
}
});
}
generateShowTimerString() {
DateTime now = DateTime.now();
DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime);
String timer = AppDateUtils.differenceBetweenDateAndCurrent(
liveCareDate, context, isShowSecond: true, isShowDays: false);
return timer;
}
}

@ -1,73 +0,0 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class PatientHeaderWidgetNoAvatar extends StatelessWidget {
final PatiantInformtion patient;
PatientHeaderWidgetNoAvatar(this.patient);
@override
Widget build(BuildContext context) {
return Column(
children: [
Container(
margin: EdgeInsets.all(16),
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
patient.firstName + ' ' + patient.lastName,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.2,
),
Row(
children: [
AppText(
"VIP",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.2,
),
SizedBox(
width: 8,
),
AppText(
" ${patient.age}",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
],
),
AppText(
patient.visitType ?? "",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"${patient.companyName != null ? patient.companyName : ""}",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
],
),
),
Icon(
Icons.info_outline,
color: Colors.black,
),
],
),
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
],
);
}
}

@ -28,6 +28,7 @@ class PatientProfileButton extends StatelessWidget {
final bool isDartIcon;
final IconData dartIcon;
final bool isFromLiveCare;
final Color color;
PatientProfileButton({
Key key,
@ -47,7 +48,7 @@ class PatientProfileButton extends StatelessWidget {
this.isDischargedPatient = false,
this.isSelectInpatient = false,
this.isDartIcon = false,
this.dartIcon, this.isFromLiveCare = false,
this.dartIcon, this.isFromLiveCare = false, this.color,
}) : super(key: key);
@override
@ -73,7 +74,7 @@ class PatientProfileButton extends StatelessWidget {
children: <Widget>[
Container(
child: isDartIcon ? Icon(
dartIcon, size: 30, color: Color(0xFF333C45),) : new Image
dartIcon, size: 30, color: color?? Color(0xFF333C45),) : new Image
.asset(
url + icon,
width: 30,
@ -93,14 +94,14 @@ class PatientProfileButton extends StatelessWidget {
children: [
AppText(
!projectsProvider.isArabic ? this.nameLine1 : nameLine2,
color: Color(0xFF2B353E),
color: color??Color(0xFF2B353E),
fontWeight: FontWeight.w600,
textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 1.5,
),
AppText(
!projectsProvider.isArabic ? this.nameLine2 : nameLine1,
color: Color(0xFF2B353E),
color: color??Color(0xFF2B353E),
fontWeight: FontWeight.w600,
textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 1.5,
@ -116,7 +117,7 @@ class PatientProfileButton extends StatelessWidget {
color: isDisable ? Colors.grey.withOpacity(0.4) : Colors.white,
borderRadius: BorderRadius.all(Radius.circular(10)),
border: Border.fromBorderSide(BorderSide(
color: Color(0xffBBBBBB),
color: color??Color(0xffBBBBBB),
width: 1,
)),
),

@ -1,114 +0,0 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_screen.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class PatientPageHeaderWidget extends StatelessWidget {
final PatiantInformtion patient;
PatientPageHeaderWidget(this.patient);
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<SOAPViewModel>(
onModelReady: (model) async {
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
patientMRN: patient.patientMRN??patient.patientId,
doctorID: '',
editedBy: '');
await model.getPatientAllergy(generalGetReqForSOAP);
if (model.allergiesList.length == 0) {
await model.getMasterLookup(MasterKeysService.Allergies);
}
if (model.allergySeverityList.length == 0) {
await model.getMasterLookup(MasterKeysService.AllergySeverity);
}
},
builder: (_, model, w) => Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
AvatarWidget(
Icon(
patient.genderDescription == "Male"
? DoctorApp.male
: DoctorApp.female_icon,
size: 70,
color: Colors.white,
),
),
SizedBox(
width: 20,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
height: 5,
),
AppText(
patient.patientDetails.fullName != null ? patient.patientDetails.fullName : patient.firstName,
color: Colors.black,
fontWeight: FontWeight.bold,
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).age ,
color: Colors.black,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 20,
),
AppText(
patient.age.toString(),
color: Colors.black,
fontWeight: FontWeight.normal,
),
],
),
model.patientAllergiesList.isNotEmpty && model.getAllergicNames(projectViewModel.isArabic)!='' ?AppText(
TranslationBase.of(context).allergicTO +" : "+model.getAllergicNames(projectViewModel.isArabic),
color: Color(0xFFB9382C),
fontWeight: FontWeight.bold,
) : AppText(''),
],
),
)
],
),
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
SizedBox(
width: 20,
),
],
),
));
}
}

@ -0,0 +1,556 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import 'large_avatar.dart';
class PatientProfileAppBar extends StatelessWidget
with PreferredSizeWidget {
final PatiantInformtion patient;
final double height;
final bool isInpatient;
final bool isDischargedPatient;
final bool isFromLiveCare;
final String doctorName;
final String branch;
final DateTime appointmentDate;
final String profileUrl;
final String invoiceNO;
final String orderNo;
final bool isPrescriptions;
final bool isMedicalFile;
final String episode;
final String visitDate;
final String clinic;
final bool isAppointmentHeader;
final bool isFromLabResult;
PatientProfileAppBar(
this.patient,
{this.height = 0.0,
this.isInpatient = false,
this.isDischargedPatient = false,
this.isFromLiveCare = false,
this.doctorName,
this.branch,
this.appointmentDate,
this.profileUrl,
this.invoiceNO,
this.orderNo,
this.isPrescriptions = false,
this.clinic,
this.isMedicalFile = false,
this.episode,
this.visitDate,
this.isAppointmentHeader = false,
this.isFromLabResult = false});
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
int gender = 1;
if (patient.patientDetails != null) {
gender = patient.patientDetails.gender;
} else {
gender = patient.gender;
}
return Container(
padding: EdgeInsets.only(
left: 0,
right: 5,
bottom: 5,
),
decoration: BoxDecoration(
color: Colors.white,
),
// height: height == 0
// ? isInpatient
// ? 215
// : isAppointmentHeader
// ? 325
// : 200
// : height,
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50),
child: Column(
children: [
Container(
padding: EdgeInsets.only(left: 12.0),
child: Row(children: [
IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Color(0xFF2B353E), //Colors.black,
onPressed: () => Navigator.pop(context),
),
Expanded(
child: AppText(
patient.firstName != null
? (Helpers.capitalize(patient.firstName) +
" " +
Helpers.capitalize(patient.lastName))
: Helpers.capitalize(patient.fullName??patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
color: Color(0xFF2B353E),
),
),
gender == 1
? Icon(
DoctorApp.male_2,
color: Colors.blue,
)
: Icon(
DoctorApp.female_1,
color: Colors.pink,
),
Container(
margin: EdgeInsets.symmetric(horizontal: 4),
child: InkWell(
onTap: () {
launch("tel://" + patient.mobileNumber);
},
child: Icon(
Icons.phone,
color: Colors.black87,
),
),
),
]),
),
Row(children: [
Padding(
padding: EdgeInsets.only(left: 12.0),
child: Container(
width: 60,
height: 60,
child: Image.asset(
gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
patient.patientStatusType != null
? Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
patient.patientStatusType == 43
? AppText(
TranslationBase
.of(context)
.arrivedP,
color: Colors.green,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
)
: AppText(
TranslationBase.of(context).notArrived,
color: Colors.red[800],
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
),
patient.startTime != null
? AppText(
patient.startTime != null
? patient.startTime
: '',
fontWeight: FontWeight.w700,
fontSize: 12,
color: Color(0xFF2E303A))
: SizedBox()
],
))
: SizedBox(),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RichText(
text: TextSpan(
style: TextStyle(
fontSize: 1.6 * SizeConfig.textMultiplier,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase
.of(context)
.fileNumber,
style: TextStyle(
fontSize: 10,
fontFamily: 'Poppins',
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),),
new TextSpan(
text: patient.patientId.toString(),
style: TextStyle(
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
fontSize: 12, color: Color(0xFF2E303A),)),
],
),
),
Row(
children: [
AppText(
patient.nationalityName ?? patient.nationality?? patient.nationalityId ?? '',
fontWeight: FontWeight.bold,
fontSize: 12,
),
patient.nationalityFlagURL != null
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
patient.nationalityFlagURL,
height: 25,
width: 30,
errorBuilder: (BuildContext context,
Object exception,
StackTrace stackTrace) {
return Text('No Image');
},
))
: SizedBox()
],
)
],
),
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 1.6 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: TranslationBase
.of(context)
.age + " : ",
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),)),
new TextSpan(
text:
"${AppDateUtils.getAgeByBirthday(
patient.patientDetails != null
? patient.patientDetails.dateofBirth ??
""
: patient.dateofBirth ?? "", context,
isServerFormat: !isFromLiveCare)}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 12,
color: Color(0xFF2E303A),)),
],
),
),
),
if ( patient.appointmentDate != null && patient.appointmentDate.isNotEmpty)
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).appointmentDate +
" : ",
fontSize: 10,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
),
SizedBox(
width: 3.5,
),
AppText(
AppDateUtils
.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(
patient.appointmentDate))
,
fontWeight: FontWeight.w700,
fontSize: 12,
color: Color(0xFF2E303A),
),
SizedBox(
height: 0.5,
)
],
),
if(isFromLabResult)Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 1.6 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: "Result Date: ",
style: TextStyle( fontSize: 10,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',)),
new TextSpan(
text:
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',
style: TextStyle(
fontWeight: FontWeight.w700, fontSize: 12)),
],
),
),
),
// if(isInpatient)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if(patient.admissionDate != null && patient.admissionDate.isNotEmpty)
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: patient.admissionDate == null
? ""
: TranslationBase.of(context)
.admissionDate +
" : ",
style: TextStyle(fontSize: 10)),
new TextSpan(
text: patient.admissionDate == null
? ""
: "${AppDateUtils
.getDayMonthYearDateFormatted(
(AppDateUtils
.getDateTimeFromServerFormat(
patient.admissionDate
.toString())))}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 12,
color: Color(0xFF2E303A),)),
]))),
if (patient.admissionDate != null)
Row(
children: [
AppText(
"${TranslationBase.of(context).numOfDays}: ",
fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757)
),
if(isDischargedPatient &&
patient.dischargeDate != null)
AppText(
"${AppDateUtils
.getDateTimeFromServerFormat(
patient.dischargeDate)
.difference(AppDateUtils
.getDateTimeFromServerFormat(
patient.admissionDate))
.inDays + 1}",
fontWeight: FontWeight.w700,
fontSize: 12,
color: Color(0xFF2E303A),
)
else
AppText(
"${DateTime
.now()
.difference(AppDateUtils
.getDateTimeFromServerFormat(
patient.admissionDate))
.inDays + 1}",
fontWeight: FontWeight.w700,
fontSize: 12,
color: Color(0xFF2E303A),),
],
),
],
),
],
),
),
]),
if(isAppointmentHeader)
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 30,
height: 30,
margin: EdgeInsets.only(
left: projectViewModel.isArabic ? 10 : 85,
right: projectViewModel.isArabic ? 85 : 10,
top: 5),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
border: Border(
bottom: BorderSide(
color: Colors.grey[400], width: 2.5),
left: BorderSide(
color: Colors.grey[400], width: 2.5),
)),
),
Expanded(
child: Container(
margin: EdgeInsets.only(top: 10),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
child: LargeAvatar(
name: doctorName ?? "",
url: profileUrl,
),
width: 25,
height: 25,
margin: EdgeInsets.only(top: 10),
),
Expanded(
flex: 5,
child: Container(
margin: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment
.start,
children: <Widget>[
AppText(
'${TranslationBase
.of(context)
.dr}$doctorName',
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
fontSize: 12,
),
if (orderNo != null &&
!isPrescriptions)
Row(
children: <Widget>[
AppText('Order No: ',
fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),),
AppText(orderNo ?? '',
fontSize: 12)
],
),
if (invoiceNO != null &&
!isPrescriptions)
Row(
children: <Widget>[
AppText('Invoice: ',
fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),),
AppText(invoiceNO ?? "",
fontSize: 12)
],
),
if (branch != null)
Row(
children: [
AppText('Branch: ',
fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),),
AppText(branch ?? '',
fontSize: 12)
],
),
if (clinic != null)
Row(
children: [
AppText('Clinic: ',
fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),),
AppText(clinic ?? '',
fontSize: 12)
],
),
if (isMedicalFile &&
episode != null)
Row(
children: [
AppText('Episode: ',
fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),),
AppText(episode ?? '',
fontSize: 12)
],
),
if (isMedicalFile &&
visitDate != null)
Row(
children: [
AppText('Visit Date: ',
fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),),
AppText(visitDate ?? '',
fontSize: 12)
],
),
if (!isMedicalFile)
Row(
children: <Widget>[
AppText(
!isPrescriptions
? 'Result Date:'
: 'Prescriptions Date ',
fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),
),
AppText(
'${AppDateUtils
.getDayMonthYearDateFormatted(
appointmentDate,
isArabic: projectViewModel
.isArabic)}',
fontSize: 12,
)
],
)
]),
),
),
],
),
),
),
],
)
],
),
),
);
}
@override
Size get preferredSize =>
Size(double.maxFinite, height == 0
? isInpatient ? 160 : isAppointmentHeader ? 290 : 170
: height);
}

@ -1,371 +0,0 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart';
import 'package:url_launcher/url_launcher.dart';
class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
with PreferredSizeWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final double height;
final bool isInpatient;
final bool isDischargedPatient;
final bool isFromLiveCare;
PatientProfileHeaderNewDesignAppBar(
this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false, this.isDischargedPatient=false, this.isFromLiveCare = false});
@override
Widget build(BuildContext context) {
int gender = 1;
if (patient.patientDetails != null) {
gender = patient.patientDetails.gender;
} else {
gender = patient.gender;
}
return Container(
padding: EdgeInsets.only(
left: 0,
right: 5,
bottom: 5,
),
decoration: BoxDecoration(
color: Colors.white,
),
height: height == 0 ? isInpatient? 215:200 : height,
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50),
child: Column(
children: [
Container(
padding: EdgeInsets.only(left: 12.0),
child: Row(children: [
IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context),
),
Expanded(
child: AppText(
patient.firstName != null
? (Helpers.capitalize(patient.firstName) +
" " +
Helpers.capitalize(patient.lastName))
: Helpers.capitalize(patient.fullName??patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),
),
gender == 1
? Icon(
DoctorApp.male_2,
color: Colors.blue,
)
: Icon(
DoctorApp.female_1,
color: Colors.pink,
),
Container(
margin: EdgeInsets.symmetric(horizontal: 4),
child: InkWell(
onTap: () {
launch("tel://" + patient.mobileNumber);
},
child: Icon(
Icons.phone,
color: Colors.black87,
),
),
),
]),
),
Row(children: [
Padding(
padding: EdgeInsets.only(left: 12.0),
child: Container(
width: 60,
height: 60,
child: Image.asset(
gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SERVICES_PATIANT2[int.parse(patientType)] ==
"patientArrivalList"
? Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
patient.patientStatusType == 43
? AppText(
TranslationBase.of(context).arrivedP,
color: Colors.green,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
)
: AppText(
TranslationBase.of(context).notArrived,
color: Colors.red[800],
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
),
arrivalType == '1'|| patient.arrivedOn == null
? AppText(
patient.startTime != null
? patient.startTime
: '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
)
: AppText(
patient.arrivedOn != null
? AppDateUtils.convertStringToDateFormat(
patient.arrivedOn,
'MM-dd-yyyy HH:mm')
: '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
)
],
))
: SizedBox(),
if (SERVICES_PATIANT2[int.parse(patientType)] ==
"List_MyOutPatient" && !isFromLiveCare)
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).appointmentDate +
" : ",
fontSize: 14,
),
patient.startTime != null
? Container(
height: 15,
width: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: HexColor("#20A169"),
),
child: AppText(
patient.startTime??"",
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
),
)
: SizedBox(),
SizedBox(
width: 3.5,
),
Container(
child: AppText(
convertDateFormat2(
patient.appointmentDate ?? ''),
fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 0.5,
)
],
),
margin: EdgeInsets.only(
top: 8,
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RichText(
text: TextSpan(
style: TextStyle(
fontSize: 1.6 * SizeConfig.textMultiplier,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).fileNumber,
style: TextStyle(
fontSize: 12, fontFamily: 'Poppins')),
new TextSpan(
text: patient.patientId.toString(),
style: TextStyle(
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
fontSize: 14)),
],
),
),
Row(
children: [
AppText(
patient.nationalityName ?? patient.nationality?? patient.nationalityId ?? '',
fontWeight: FontWeight.bold,
fontSize: 12,
),
patient.nationalityFlagURL != null
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
patient.nationalityFlagURL,
height: 25,
width: 30,
errorBuilder: (BuildContext context,
Object exception,
StackTrace stackTrace) {
return Text('No Image');
},
))
: SizedBox()
],
)
],
),
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 1.6 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).age+ " : ",
style: TextStyle(fontSize: 14)),
new TextSpan(
text:
"${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth??"" : patient.dateofBirth??"", context,isServerFormat: !isFromLiveCare)}",
style: TextStyle(
fontWeight: FontWeight.w700, fontSize: 14)),
],
),
),
),
if(isInpatient)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize:
2.0 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: patient.admissionDate == null
? ""
: TranslationBase.of(context)
.admissionDate +
" : ",
style: TextStyle(fontSize: 14)),
new TextSpan(
text: patient.admissionDate == null
? ""
: "${AppDateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 15)),
]))),
if (patient.admissionDate != null)
Row(
children: [
AppText(
"${TranslationBase.of(context).numOfDays}: ",
fontSize: 15,
),
if(isDischargedPatient && patient.dischargeDate!=null)
AppText(
"${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}",
fontSize: 15,
fontWeight: FontWeight.w700)
else
AppText(
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}",
fontSize: 15,
fontWeight: FontWeight.w700),
],
),
],
)
],
),
),
]),
],
),
),
);
}
convertDateFormat2(String str) {
String newDate;
const start = "/Date(";
if (str.isNotEmpty) {
const end = "+0300)";
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
newDate = date.year.toString() +
"/" +
date.month.toString().padLeft(2, '0') +
"/" +
date.day.toString().padLeft(2, '0');
}
return newDate??'';
}
isToday(date) {
DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date);
return DateFormat("yyyy-MM-dd").format(tempDate) ==
DateFormat("yyyy-MM-dd").format(DateTime.now());
}
myBoxDecoration() {
return BoxDecoration(
border: Border(
top: BorderSide(
color: Colors.green,
width: 5,
),
),
borderRadius: BorderRadius.circular(10));
}
@override
Size get preferredSize => Size(double.maxFinite, 200);
}

@ -1,316 +0,0 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart';
import 'package:url_launcher/url_launcher.dart';
class PatientProfileHeaderNewDesign extends StatelessWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final double height;
final bool isHaveMargin;
PatientProfileHeaderNewDesign(
this.patient, this.patientType, this.arrivalType,
{this.height = 0.0, this.isHaveMargin=true});
@override
Widget build(BuildContext context) {
int gender = 1;
if (patient.patientDetails != null) {
gender = patient.patientDetails.gender;
} else {
gender = patient.gender;
}
return Container(
padding: EdgeInsets.only(
left: 0,
right: 5,
bottom: 5,
),
decoration: BoxDecoration(
color: Colors.white,
),
height: height == 0 ? 200 : height,
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50),
child: Column(
children: [
Container(
padding: EdgeInsets.only(left: 12.0),
child: Row(children: [
IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context),
),
Expanded(
child: AppText(
patient.firstName != null
? (Helpers.capitalize(patient.firstName) +
" " +
Helpers.capitalize(patient.lastName))
: Helpers.capitalize(patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier * 2.2,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),
),
gender == 1
? Icon(
DoctorApp.male_2,
color: Colors.blue,
)
: Icon(
DoctorApp.female_1,
color: Colors.pink,
),
Container(
margin: EdgeInsets.symmetric(horizontal: 4),
child: InkWell(
onTap: () {
launch("tel://" + patient.mobileNumber);
},
child: Icon(
Icons.phone,
color: Colors.black87,
),
),
),
]),
),
Row(children: [
Padding(
padding: EdgeInsets.only(left: 12.0),
child: Container(
width: 60,
height: 60,
child: Image.asset(
gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SERVICES_PATIANT2[int.parse(patientType)] ==
"patientArrivalList"
? Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
patient.patientStatusType == 43
? AppText(
TranslationBase.of(context).arrivedP,
color: Colors.green,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
)
: AppText(
TranslationBase.of(context).notArrived,
color: Colors.red[800],
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
),
arrivalType == '1' || patient.arrivedOn == null
? AppText(
patient.startTime != null
? patient.startTime
: '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
)
: AppText(
AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(patient.arrivedOn)),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
)
],
))
: SizedBox(),
if (SERVICES_PATIANT2[int.parse(patientType)] ==
"List_MyOutPatient")
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).appointmentDate +
" : ",
fontSize: 14,
),
patient.startTime != null
? Container(
height: 15,
width: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: HexColor("#20A169"),
),
child: AppText(
patient.startTime ?? "",
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
),
)
: SizedBox(),
SizedBox(
width: 3.5,
),
Container(
child: AppText(
convertDateFormat2(
patient.appointmentDate.toString() ?? ''),
fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 0.5,
)
],
),
margin: EdgeInsets.only(
top: 8,
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RichText(
text: TextSpan(
style: TextStyle(
fontSize: 1.6 * SizeConfig.textMultiplier,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).fileNumber,
style: TextStyle(
fontSize: 12, fontFamily: 'Poppins')),
new TextSpan(
text: patient.patientId.toString(),
style: TextStyle(
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
fontSize: 14)),
],
),
),
Row(
children: [
AppText(
patient.nationalityName ??
patient.nationality ??
patient.nationalityId ??
'',
fontWeight: FontWeight.bold,
fontSize: 12,
),
patient.nationalityFlagURL != null
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
patient.nationalityFlagURL,
height: 25,
width: 30,
errorBuilder: (BuildContext context,
Object exception,
StackTrace stackTrace) {
return Text('No Image');
},
))
: SizedBox()
],
)
],
),
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 1.6 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).age + " : ",
style: TextStyle(fontSize: 14)),
new TextSpan(
text:
"${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context)}",
style: TextStyle(
fontWeight: FontWeight.w700, fontSize: 14)),
],
),
),
),
],
),
),
]),
],
),
),
);
}
convertDateFormat2(String str) {
String newDate;
const start = "/Date(";
if (str.isNotEmpty) {
const end = "+0300)";
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
newDate = date.year.toString() +
"/" +
date.month.toString().padLeft(2, '0') +
"/" +
date.day.toString().padLeft(2, '0');
}
return newDate.toString();
}
isToday(date) {
DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date);
return DateFormat("yyyy-MM-dd").format(tempDate) ==
DateFormat("yyyy-MM-dd").format(DateTime.now());
}
myBoxDecoration() {
return BoxDecoration(
border: Border(
top: BorderSide(
color: Colors.green,
width: 5,
),
),
borderRadius: BorderRadius.circular(10));
}
}

@ -1,242 +0,0 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:url_launcher/url_launcher.dart';
class PatientProfileHeaderNewDesignInPatient extends StatelessWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final double height;
PatientProfileHeaderNewDesignInPatient(
this.patient, this.patientType, this.arrivalType,
{this.height = 0.0});
@override
Widget build(BuildContext context) {
int gender = 1;
if (patient.patientDetails != null) {
gender = patient.patientDetails.gender;
} else {
gender = patient.gender;
}
return Container(
padding: EdgeInsets.only(
left: 0,
right: 5,
bottom: 5,
),
decoration: BoxDecoration(
color: Colors.white,
),
height: height == 0 ? 200 : height,
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
// margin: EdgeInsets.only(top: 50),
child: Column(
children: [
Container(
padding: EdgeInsets.only(left: 12.0),
child: Row(children: [
IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context),
),
Expanded(
child: AppText(
patient.firstName != null
? (Helpers.capitalize(patient.firstName) +
" " +
Helpers.capitalize(patient.lastName))
: Helpers.capitalize(patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier * 2.2,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),
),
gender == 1
? Icon(
DoctorApp.male_2,
color: Colors.blue,
)
: Icon(
DoctorApp.female_1,
color: Colors.pink,
),
Container(
margin: EdgeInsets.symmetric(horizontal: 4),
child: InkWell(
onTap: () {
launch("tel://" + patient.mobileNumber);
},
child: Icon(
Icons.phone,
color: Colors.black87,
),
),
),
]),
),
Row(children: [
Padding(
padding: EdgeInsets.only(left: 12.0),
child: Container(
width: 60,
height: 60,
child: Image.asset(
gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
TranslationBase.of(context).fileNumber,
fontSize: 1.2 * SizeConfig.textMultiplier,
),
AppText(patient.patientId.toString(),
fontSize: 1.4 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w700),
],
),
if(patient.admissionDate!=null)
Row(
children: [
AppText(
AppDateUtils.convertDateFromServerFormat(
patient.admissionDate, "hh:mm a"),
fontWeight: FontWeight.bold,
fontSize: 1.4 * SizeConfig.textMultiplier,
),
],
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
if(patient.admissionDate!=null)
Row(
children: [
AppText(
"${TranslationBase.of(context).admissionDate}: ",
fontSize: 1.2 * SizeConfig.textMultiplier,
),
AppText(
AppDateUtils.convertDateFromServerFormat(
patient.admissionDate, "dd MMM,yyyy"),
fontSize: 1.4 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w700),
],
),
Row(
children: [
AppText(
patient.nationalityName ??
patient.nationality ??
patient.nationalityId ??
'',
fontWeight: FontWeight.bold,
fontSize: 1.4 * SizeConfig.textMultiplier,
),
patient.nationalityFlagURL != null
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
patient.nationalityFlagURL,
height: 25,
width: 30,
errorBuilder: (BuildContext context,
Object exception,
StackTrace stackTrace) {
return Text('No Image');
},
))
: SizedBox()
],
)
],
),
if(patient.admissionDate!=null)
Row(
children: [
AppText(
"${TranslationBase.of(context).numOfDays}: ",
fontSize: 1.2 * SizeConfig.textMultiplier,
),
AppText(
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}",
fontSize: 1.4 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w700),
],
),
],
),
),
]),
],
),
),
);
}
convertDateFormat2(String str) {
String newDate;
const start = "/Date(";
if (str.isNotEmpty) {
const end = "+0300)";
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
newDate = date.year.toString() +
"/" +
date.month.toString().padLeft(2, '0') +
"/" +
date.day.toString().padLeft(2, '0');
}
return newDate.toString();
}
isToday(date) {
DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date);
return DateFormat("yyyy-MM-dd").format(tempDate) ==
DateFormat("yyyy-MM-dd").format(DateTime.now());
}
myBoxDecoration() {
return BoxDecoration(
border: Border(
top: BorderSide(
color: Colors.green,
width: 5,
),
),
borderRadius: BorderRadius.circular(10));
}
}

@ -1,507 +0,0 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import 'large_avatar.dart';
class PatientProfileHeaderWhitAppointment extends StatelessWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final String doctorName;
final String branch;
final DateTime appointmentDate;
final String profileUrl;
final String invoiceNO;
final String orderNo;
final bool isPrescriptions;
final String clinic;
PatientProfileHeaderWhitAppointment(
{this.patient,
this.patientType,
this.arrivalType,
this.doctorName,
this.branch,
this.appointmentDate,
this.profileUrl,
this.invoiceNO,
this.orderNo, this.isPrescriptions = false, this.clinic});
@override
Widget build(BuildContext context) {
int gender = 1;
if (patient.patientDetails != null) {
gender = patient.patientDetails.gender;
} else {
gender = patient.gender;
}
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
padding: EdgeInsets.only(
left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
color: Colors.white,
),
//height: 300,
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.only(left: 12.0),
child: Row(children: [
IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context),
),
Expanded(
child: AppText(
patient.firstName != null ?
(Helpers.capitalize(patient.firstName) +
" " +
Helpers.capitalize(
patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier *2.2,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),
),
gender == 1
? Icon(
DoctorApp.male_2,
color: Colors.blue,
)
: Icon(
DoctorApp.female_1,
color: Colors.pink,
),
Container(
margin: EdgeInsets.symmetric(horizontal: 4),
child: InkWell(
onTap: () {
launch("tel://" + patient.mobileNumber);
},
child: Icon(
Icons.phone,
color: Colors.black87,
),
),
)
]),
),
Row(children: [
Padding(
padding: EdgeInsets.only(left: 12.0),
child: Container(
width: 60,
height: 60,
child: Image.asset(
gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
SERVICES_PATIANT2[
int.parse(patientType)] ==
"patientArrivalList"
? Container(
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
patient.patientStatusType ==
43
? AppText(
TranslationBase.of(
context)
.arrivedP,
color: Colors.green,
fontWeight:
FontWeight.bold,
fontFamily:
'Poppins',
fontSize: 12,
)
: AppText(
TranslationBase.of(
context)
.notArrived,
color:
Colors.red[800],
fontWeight:
FontWeight.bold,
fontFamily:
'Poppins',
fontSize: 12,
),
arrivalType == '1' || patient.arrivedOn == null
? AppText(
patient.startTime !=
null
? patient
.startTime
: '',
fontFamily:
'Poppins',
fontWeight:
FontWeight.w600,
)
: AppText(
AppDateUtils.convertStringToDateFormat(
patient
.arrivedOn,
'MM-dd-yyyy HH:mm'),
fontFamily:
'Poppins',
fontWeight:
FontWeight.w600,
)
],
))
: SizedBox(),
if (SERVICES_PATIANT2[
int.parse(patientType)] ==
"List_MyOutPatient")
Container(
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context)
.appointmentDate +
" : ",
fontSize: 14,
),
patient.startTime != null
? Container(
height: 15,
width: 60,
decoration:
BoxDecoration(
borderRadius:
BorderRadius
.circular(
25),
color: HexColor(
"#20A169"),
),
child: AppText(
patient.startTime,
color: Colors.white,
fontSize: 1.5 *
SizeConfig
.textMultiplier,
textAlign: TextAlign
.center,
fontWeight:
FontWeight.bold,
),
)
: SizedBox(),
SizedBox(
width: 3.5,
),
Container(
child: AppText(
convertDateFormat2(patient.appointmentDate.toString()?? ''),
fontSize: 1.5 *
SizeConfig
.textMultiplier,
fontWeight:
FontWeight.bold,
),
),
SizedBox(
height: 0.5,
)
],
),
margin: EdgeInsets.only(
top: 8,
),
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
RichText(
text: TextSpan(
style: TextStyle(
fontSize: 1.6 *
SizeConfig
.textMultiplier,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text:
TranslationBase.of(
context)
.fileNumber,
style: TextStyle(
fontSize: 12,
fontFamily:
'Poppins')),
new TextSpan(
text: patient.patientId
.toString(),
style: TextStyle(
fontWeight:
FontWeight.w700,
fontFamily:
'Poppins',
fontSize: 14)),
],
),
),
Row(
children: [
AppText(
patient.nationalityName ??
patient.nationality??"",
fontWeight: FontWeight.bold,
fontSize: 12,
),
patient.nationality != null
? ClipRRect(
borderRadius:
BorderRadius
.circular(
20.0),
child: Image.network(
patient.nationalityFlagURL,
height: 25,
width: 30,
errorBuilder:
(BuildContext
context,
Object
exception,
StackTrace
stackTrace) {
return Text(
'No Image');
},
))
: SizedBox()
],
)
],
),
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 1.6 *
SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(
context)
.age +
" : ",
style: TextStyle(
fontSize: 14)),
new TextSpan(
text:
"${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ??"": patient.dateofBirth??"", context)}",
style: TextStyle(
fontWeight:
FontWeight.w700,
fontSize: 14)),
],
),
),
),
],
),
),
]),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 30,
height: 30,
margin: EdgeInsets.only(left: projectViewModel.isArabic?10:85, right: projectViewModel.isArabic?85:10,top: 5),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
border: Border(
bottom:BorderSide(color: Colors.grey[400],width: 2.5),
left: BorderSide(color: Colors.grey[400],width: 2.5),
)
),
),
Expanded(
child: Container(
margin: EdgeInsets.only(top: 10),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
child: LargeAvatar(
name: doctorName,
url: profileUrl,
),
width: 25,
height: 25,
margin: EdgeInsets.only(top: 10),
),
Expanded(
flex: 4,
child: Container(
margin: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
'${TranslationBase.of(context).dr}.$doctorName',
color: Colors.black,
fontWeight: FontWeight.w600,
fontSize: 14,
),
if (orderNo != null && !isPrescriptions)
Row(
children: <Widget>[
AppText(
'Order No:',
color: Colors.grey[800],
),
AppText(
orderNo ?? '',
)
],
),
if (invoiceNO != null && !isPrescriptions)
Row(
children: <Widget>[
AppText(
'Invoice:',
color: Colors.grey[800],
),
AppText(
invoiceNO,
)
],
),
if(isPrescriptions)
Row(
children: [
AppText(
'Branch:',
color: Colors.grey[800],
),
AppText(
branch?? '',
)
],
),
if(isPrescriptions)
Row(
children: [
AppText(
'Clinic:',
color: Colors.grey[800],
),
AppText(
clinic?? '',
)
],
),
Row(
children: <Widget>[
AppText(
!isPrescriptions? 'Result Date:': 'Prescriptions Date',
color: Colors.grey[800],
),
Expanded(
child: AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',
),
)
],
)
]),
),
),
],
),
),
),
],
)
],
),
),
);
}
convertDateFormat2(String str) {
String newDate ="";
const start = "/Date(";
const end = "+0300)";
if (str.isNotEmpty) {
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
newDate = date.year.toString() +
"/" +
date.month.toString().padLeft(2, '0') +
"/" +
date.day.toString().padLeft(2, '0');
}
return newDate.toString();
}
isToday(date) {
DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date);
return DateFormat("yyyy-MM-dd").format(tempDate) ==
DateFormat("yyyy-MM-dd").format(DateTime.now());
}
myBoxDecoration() {
return BoxDecoration(
border: Border(
top: BorderSide(
color: Colors.green,
width: 5,
),
),
borderRadius: BorderRadius.circular(10));
}
}

@ -1,456 +0,0 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import 'large_avatar.dart';
class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget
with PreferredSizeWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final String doctorName;
final String branch;
final DateTime appointmentDate;
final String profileUrl;
final String invoiceNO;
final String orderNo;
final bool isPrescriptions;
final bool isMedicalFile;
final String episode;
final String vistDate;
final String clinic;
PatientProfileHeaderWhitAppointmentAppBar(
{this.patient,
this.patientType,
this.arrivalType,
this.doctorName,
this.branch,
this.appointmentDate,
this.profileUrl,
this.invoiceNO,
this.orderNo,
this.isPrescriptions = false,
this.clinic,
this.isMedicalFile = false,
this.episode,
this.vistDate});
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
int gender = 1;
if (patient.patientDetails != null) {
gender = patient.patientDetails.gender;
} else {
gender = patient.gender;
}
return Container(
padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
color: Colors.white,
),
//height: 300,
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.only(left: 12.0),
child: Row(children: [
IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context),
),
Expanded(
child: AppText(
patient.firstName != null
? (Helpers.capitalize(patient.firstName) +
" " +
Helpers.capitalize(patient.lastName))
: Helpers.capitalize(patient.fullName??patient?.patientDetails?.fullName??""),
fontSize: SizeConfig.textMultiplier * 2.2,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),
),
gender == 1
? Icon(
DoctorApp.male_2,
color: Colors.blue,
)
: Icon(
DoctorApp.female_1,
color: Colors.pink,
),
Container(
margin: EdgeInsets.symmetric(horizontal: 4),
child: InkWell(
onTap: () {
launch("tel://" + patient?.mobileNumber??"");
},
child: Icon(
Icons.phone,
color: Colors.black87,
),
),
)
]),
),
Row(children: [
Padding(
padding: EdgeInsets.only(left: 12.0),
child: Container(
width: 60,
height: 60,
child: Image.asset(
gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SERVICES_PATIANT2[int.parse(patientType)] ==
"patientArrivalList"
? Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
patient.patientStatusType == 43
? AppText(
TranslationBase.of(context).arrivedP,
color: Colors.green,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
)
: AppText(
TranslationBase.of(context).notArrived,
color: Colors.red[800],
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
),
arrivalType == '1' || patient.arrivedOn == null
? AppText(
patient.startTime != null
? patient.startTime
: '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
)
: AppText(
AppDateUtils.convertStringToDateFormat(
patient.arrivedOn,
'MM-dd-yyyy HH:mm'),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
)
],
))
: SizedBox(),
if (SERVICES_PATIANT2[int.parse(patientType)] ==
"List_MyOutPatient")
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).appointmentDate +
" : ",
fontSize: 14,
),
patient.startTime != null
? Container(
height: 15,
width: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: HexColor("#20A169"),
),
child: AppText(
patient.startTime ?? "",
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
),
)
: SizedBox(),
SizedBox(
width: 3.5,
),
Container(
child: AppText(
convertDateFormat2(
patient.appointmentDate.toString() ?? ''),
fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 0.5,
)
],
),
margin: EdgeInsets.only(
top: 8,
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RichText(
text: TextSpan(
style: TextStyle(
fontSize: 1.6 * SizeConfig.textMultiplier,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).fileNumber,
style: TextStyle(
fontSize: 12, fontFamily: 'Poppins')),
new TextSpan(
text: patient?.patientId?.toString() ?? "",
style: TextStyle(
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
fontSize: 14)),
],
),
),
Row(
children: [
AppText(
patient.nationalityName ??
patient.nationality ??
"",
fontWeight: FontWeight.bold,
fontSize: 12,
),
patient.nationality != null
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
patient?.nationalityFlagURL??"",
height: 25,
width: 30,
errorBuilder: (BuildContext context,
Object exception,
StackTrace stackTrace) {
return Text('No Image');
},
))
: SizedBox()
],
)
],
),
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 1.6 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).age + " : ",
style: TextStyle(fontSize: 14)),
new TextSpan(
text:
"${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth : patient.dateofBirth, context)}",
style: TextStyle(
fontWeight: FontWeight.w700, fontSize: 14)),
],
),
),
),
],
),
),
]),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 30,
height: 30,
margin: EdgeInsets.only(
left: projectViewModel.isArabic ? 10 : 85,
right: projectViewModel.isArabic ? 85 : 10,
top: 5),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
border: Border(
bottom: BorderSide(color: Colors.grey[400], width: 2.5),
left: BorderSide(color: Colors.grey[400], width: 2.5),
)),
),
Expanded(
child: Container(
margin: EdgeInsets.only(top: 10),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
child: LargeAvatar(
name: doctorName ?? "",
url: profileUrl,
),
width: 25,
height: 25,
margin: EdgeInsets.only(top: 10),
),
Expanded(
flex: 5,
child: Container(
margin: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
'${TranslationBase.of(context).dr}$doctorName',
color: Colors.black,
fontWeight: FontWeight.w600,
fontSize: 9,
),
if (orderNo != null && !isPrescriptions)
Row(
children: <Widget>[
AppText('Order No: ',
color: Colors.grey[800],
fontSize: 12),
AppText(orderNo ?? '', fontSize: 12)
],
),
if (invoiceNO != null && !isPrescriptions)
Row(
children: <Widget>[
AppText('Invoice: ',
color: Colors.grey[800],
fontSize: 12),
AppText(invoiceNO??"", fontSize: 12)
],
),
if (branch != null)
Row(
children: [
AppText('Branch: ',
color: Colors.grey[800],
fontSize: 12),
AppText(branch ?? '', fontSize: 12)
],
),
if (clinic != null)
Row(
children: [
AppText('Clinic: ',
color: Colors.grey[800],
fontSize: 12),
AppText(clinic ?? '', fontSize: 12)
],
),
if (isMedicalFile && episode != null)
Row(
children: [
AppText('Episode: ',
color: Colors.grey[800],
fontSize: 12),
AppText(episode ?? '', fontSize: 12)
],
),
if (isMedicalFile && vistDate != null)
Row(
children: [
AppText('Visit Date: ',
color: Colors.grey[800],
fontSize: 12),
AppText(vistDate ?? '', fontSize: 12)
],
),
if (!isMedicalFile)
Row(
children: <Widget>[
Expanded(
child: AppText(
!isPrescriptions
? 'Result Date: '
: 'Prescriptions Date ',
color: Colors.grey[800],
fontSize: 12,
),
),
AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',
fontSize: 14,
)
],
)
]),
),
),
],
),
),
),
],
)
],
),
),
);
}
convertDateFormat2(String str) {
String newDate = "";
const start = "/Date(";
const end = "+0300)";
if (str.isNotEmpty) {
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
newDate = date.year.toString() +
"/" +
date.month.toString().padLeft(2, '0') +
"/" +
date.day.toString().padLeft(2, '0');
}
return newDate.toString();
}
@override
Size get preferredSize => Size(double.maxFinite, 310);
}

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

Loading…
Cancel
Save