Merge branches 'development' and 'fix_medical_report' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into fix_medical_report

 Conflicts:
	pubspec.lock
merge-requests/734/head
Elham Rababah 5 years ago
commit b0938562fa

@ -54,6 +54,11 @@ android {
signingConfig signingConfigs.debug signingConfig signingConfigs.debug
} }
} }
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
} }
flutter { flutter {
@ -74,9 +79,10 @@ dependencies {
//permissions //permissions
implementation 'pub.devrel:easypermissions:0.4.0' implementation 'pub.devrel:easypermissions:0.4.0'
//retrofit //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.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' apply plugin: 'com.google.gms.google-services'

@ -9,12 +9,19 @@
additional functionality it is fine to subclass or reimplement additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. 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.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 <application
android:name="io.flutter.app.FlutterApplication" android:name="io.flutter.app.FlutterApplication"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"

@ -134,8 +134,8 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
@SuppressLint("ClickableViewAccessibility") @SuppressLint("ClickableViewAccessibility")
private void initUI() { private void initUI() {
mPublisherViewContainer = (FrameLayout) findViewById(R.id.local_video_view_container); mPublisherViewContainer = findViewById(R.id.local_video_view_container);
mSubscriberViewContainer = (RelativeLayout) findViewById(R.id.remote_video_view_container); mSubscriberViewContainer = findViewById(R.id.remote_video_view_container);
apiKey = getIntent().getStringExtra("apiKey"); apiKey = getIntent().getStringExtra("apiKey");
sessionId = getIntent().getStringExtra("sessionId"); sessionId = getIntent().getStringExtra("sessionId");
@ -184,17 +184,13 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
videoCallPresenter.callClintConnected(sessionStatusModel); videoCallPresenter.callClintConnected(sessionStatusModel);
} }
}; };
mConnectedHandler.postDelayed(mConnectedRunnable, 30 * 1000); mConnectedHandler.postDelayed(mConnectedRunnable, 55 * 1000);
} }
private void hiddenButtons() { private void hiddenButtons() {
mVolHandler = new Handler(); mVolHandler = new Handler();
mVolRunnable = new Runnable() { mVolRunnable = () -> controlPanel.setVisibility(View.GONE);
public void run() {
controlPanel.setVisibility(View.GONE);
}
};
mVolHandler.postDelayed(mVolRunnable, 5 * 1000); mVolHandler.postDelayed(mVolRunnable, 5 * 1000);
} }
@ -269,8 +265,8 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
public void onError(Session session, OpentokError opentokError) { public void onError(Session session, OpentokError opentokError) {
Log.d(TAG, "onError: Error (" + opentokError.getMessage() + ") in session " + session.getSessionId()); Log.d(TAG, "onError: Error (" + opentokError.getMessage() + ") in session " + session.getSessionId());
Toast.makeText(this, "Session error. See the logcat please.", Toast.LENGTH_LONG).show(); // Toast.makeText(this, "Session error. See the logcat please.", Toast.LENGTH_LONG).show();
finish(); //finish();
} }
@Override @Override
@ -282,6 +278,8 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
} }
isConnected = true; isConnected = true;
subscribeToStream(stream); subscribeToStream(stream);
if(mConnectedHandler!=null && mConnectedRunnable!=null)
mConnectedHandler.removeCallbacks(mConnectedRunnable);
videoCallPresenter.callChangeCallStatus(new ChangeCallStatusRequestModel(3,sessionStatusModel.getDoctorId(), sessionStatusModel.getGeneralid(),token,sessionStatusModel.getVCID())); videoCallPresenter.callChangeCallStatus(new ChangeCallStatusRequestModel(3,sessionStatusModel.getDoctorId(), sessionStatusModel.getGeneralid(),token,sessionStatusModel.getVCID()));
} }
@ -315,8 +313,8 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
public void onError(PublisherKit publisherKit, OpentokError opentokError) { public void onError(PublisherKit publisherKit, OpentokError opentokError) {
Log.d(TAG, "onError: Error (" + opentokError.getMessage() + ") in publisher"); Log.d(TAG, "onError: Error (" + opentokError.getMessage() + ") in publisher");
Toast.makeText(this, "Session error. See the logcat please.", Toast.LENGTH_LONG).show(); // Toast.makeText(this, "onError: Error (" + opentokError.getMessage() + ") in publisher", Toast.LENGTH_LONG).show();
finish(); // finish();
} }
@Override @Override
@ -427,6 +425,10 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
returnIntent.putExtra("sessionStatusNotRespond", sessionStatusModel); returnIntent.putExtra("sessionStatusNotRespond", sessionStatusModel);
setResult(Activity.RESULT_OK, returnIntent); setResult(Activity.RESULT_OK, returnIntent);
finish(); finish();
} else if( sessionStatusModel.getSessionStatus() == 4 ){
isConnected = true;
if(mConnectedHandler!=null && mConnectedRunnable!=null)
mConnectedHandler.removeCallbacks(mConnectedRunnable);
} }
} }

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

@ -31,7 +31,7 @@ class ViewController: UIViewController {
var callBack: ICallProtocol? var callBack: ICallProtocol?
var timer = Timer() var timer = Timer()
var seconds = 30 var seconds = 55
var isUserConnect : Bool = false 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/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.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/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
@ -12,6 +13,9 @@ import 'package:flutter/cupertino.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../locator.dart';
import '../routes.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Helpers helpers = new Helpers(); Helpers helpers = new Helpers();
@ -116,7 +120,9 @@ class BaseAppClient {
await Provider.of<AuthenticationViewModel>(AppGlobal.CONTEX, await Provider.of<AuthenticationViewModel>(AppGlobal.CONTEX,
listen: false) listen: false)
.logout(); .logout();
Helpers.showErrorToast('Your session expired Please login again'); Helpers.showErrorToast('Your session expired Please login again');
locator<NavigationService>().pushNamedAndRemoveUntil(ROOT);
} }
if (isAllowAny) { if (isAllowAny) {
onFailure(getError(parsed), statusCode); 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_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 GET_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/PendingReferrals';
const CREATE_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/CreateReferral'; const CREATE_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/CreateReferral';
@ -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 GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles';
const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin'; const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin';
const SEND_SMS_INSTRUCTIONS = 'LiveCareApi/DoctorApp/SendSMSInstruction';
const GET_ALTERNATIVE_SERVICE = 'LiveCareApi/DoctorApp/GetAlternativeServices'; const GET_ALTERNATIVE_SERVICE = 'LiveCareApi/DoctorApp/GetAlternativeServices';
const END_CALL = 'LiveCareApi/DoctorApp/EndCall'; const END_CALL = 'LiveCareApi/DoctorApp/EndCall';
const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge'; 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_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_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient";
const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient";

@ -712,7 +712,7 @@ const Map<String, Map<String, String>> localizedValues = {
'days': {'en': "Days", 'ar': "أيام"}, 'days': {'en': "Days", 'ar': "أيام"},
'months': {'en': "Months", 'ar': "أشهر"}, 'months': {'en': "Months", 'ar': "أشهر"},
'years': {'en': "Years", 'ar': "سنين"}, 'years': {'en': "Years", 'ar': "سنين"},
'hr': {'en': "HR", 'ar': "س"}, 'hr': {'en': "Hr", 'ar': "س"},
'min': {'en': "Min", 'ar': "د"}, 'min': {'en': "Min", 'ar': "د"},
'appointmentNumber': {'en': "Appointment Number", 'ar': "رقم الموعد"}, 'appointmentNumber': {'en': "Appointment Number", 'ar': "رقم الموعد"},
'referralStatusHold': {'en': "Hold", 'ar': "معلق"}, 'referralStatusHold': {'en': "Hold", 'ar': "معلق"},
@ -1008,4 +1008,6 @@ const Map<String, Map<String, String>> localizedValues = {
"allLab": {"en": "All Lab", "ar": "جميع المختبرات"}, "allLab": {"en": "All Lab", "ar": "جميع المختبرات"},
"allPrescription": {"en": "All Prescription", "ar": "جميع الوصفات"}, "allPrescription": {"en": "All Prescription", "ar": "جميع الوصفات"},
"addPrescription": {"en": "Add 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) { AlternativeService.fromJson(Map<String, dynamic> json) {
serviceID = json['ServicID']; serviceID = json['ServicID'];
serviceName = json['ServiceName']; serviceName = json['ServiceName'];
isSelected = false;
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {

@ -64,65 +64,65 @@ class MyReferralPatientModel {
MyReferralPatientModel( MyReferralPatientModel(
{this.rowID, {this.rowID,
this.projectID, this.projectID,
this.lineItemNo, this.lineItemNo,
this.doctorID, this.doctorID,
this.patientID, this.patientID,
this.doctorName, this.doctorName,
this.doctorNameN, this.doctorNameN,
this.firstName, this.firstName,
this.middleName, this.middleName,
this.lastName, this.lastName,
this.firstNameN, this.firstNameN,
this.middleNameN, this.middleNameN,
this.lastNameN, this.lastNameN,
this.gender, this.gender,
this.dateofBirth, this.dateofBirth,
this.mobileNumber, this.mobileNumber,
this.emailAddress, this.emailAddress,
this.patientIdentificationNo, this.patientIdentificationNo,
this.patientType, this.patientType,
this.admissionNo, this.admissionNo,
this.admissionDate, this.admissionDate,
this.roomID, this.roomID,
this.bedID, this.bedID,
this.nursingStationID, this.nursingStationID,
this.description, this.description,
this.nationalityName, this.nationalityName,
this.nationalityNameN, this.nationalityNameN,
this.clinicDescription, this.clinicDescription,
this.clinicDescriptionN, this.clinicDescriptionN,
this.referralDoctor, this.referralDoctor,
this.referringDoctor, this.referringDoctor,
this.referralClinic, this.referralClinic,
this.referringClinic, this.referringClinic,
this.referralStatus, this.referralStatus,
this.referralDate, this.referralDate,
this.referringDoctorRemarks, this.referringDoctorRemarks,
this.referredDoctorRemarks, this.referredDoctorRemarks,
this.referralResponseOn, this.referralResponseOn,
this.priority, this.priority,
this.frequency, this.frequency,
this.mAXResponseTime, this.mAXResponseTime,
this.episodeID, this.episodeID,
this.appointmentNo, this.appointmentNo,
this.appointmentDate, this.appointmentDate,
this.appointmentType, this.appointmentType,
this.patientMRN, this.patientMRN,
this.createdOn, this.createdOn,
this.clinicID, this.clinicID,
this.nationalityID, this.nationalityID,
this.age, this.age,
this.doctorImageURL, this.doctorImageURL,
this.frequencyDescription, this.frequencyDescription,
this.genderDescription, this.genderDescription,
this.isDoctorLate, this.isDoctorLate,
this.isDoctorResponse, this.isDoctorResponse,
this.nationalityFlagURL, this.nationalityFlagURL,
this.nursingStationName, this.nursingStationName,
this.priorityDescription, this.priorityDescription,
this.referringClinicDescription, this.referringClinicDescription,
this.referringDoctorName}); this.referringDoctorName});
MyReferralPatientModel.fromJson(Map<String, dynamic> json) { MyReferralPatientModel.fromJson(Map<String, dynamic> json) {
rowID = json['RowID']; rowID = json['RowID'];
@ -158,8 +158,21 @@ class MyReferralPatientModel {
referringDoctor = json['ReferringDoctor']; referringDoctor = json['ReferringDoctor'];
referralClinic = json['ReferralClinic']; referralClinic = json['ReferralClinic'];
referringClinic = json['ReferringClinic']; referringClinic = json['ReferringClinic'];
referralStatus = json['ReferralStatus']; referralStatus = json["ReferralStatus"] is String
referralDate = AppDateUtils.convertStringToDate(json['ReferralDate']); ? 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']; referringDoctorRemarks = json['ReferringDoctorRemarks'];
referredDoctorRemarks = json['ReferredDoctorRemarks']; referredDoctorRemarks = json['ReferredDoctorRemarks'];
referralResponseOn = json['ReferralResponseOn']; referralResponseOn = json['ReferralResponseOn'];
@ -253,6 +266,6 @@ class MyReferralPatientModel {
} }
get patientName { 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,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/config/config.dart';
import 'package:doctor_app_flutter/core/model/live_care/AlternativeServicesList.dart'; import 'package:doctor_app_flutter/core/model/live_care/AlternativeServicesList.dart';
@ -19,7 +18,7 @@ class LiveCarePatientServices extends BaseService {
bool _isFinished = false; bool _isFinished = false;
bool _isLive = false; bool _isLive = true;
bool get isFinished => _isFinished; bool get isFinished => _isFinished;
@ -75,7 +74,7 @@ class LiveCarePatientServices extends BaseService {
}, body: startCallReq.toJson(), isLiveCare: _isLive); }, body: startCallReq.toJson(), isLiveCare: _isLive);
} }
Future endCallWithCharge(int vcID, String altServiceList) async { Future endCallWithCharge(int vcID, List<int> altServiceList) async {
hasError = false; hasError = false;
await baseAppClient.post(END_CALL_WITH_CHARGE, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(END_CALL_WITH_CHARGE, onSuccess: (dynamic response, int statusCode) {
endCallResponse = response; endCallResponse = response;
@ -85,6 +84,7 @@ class LiveCarePatientServices extends BaseService {
}, body: { }, body: {
"VC_ID": vcID, "VC_ID": vcID,
"AltServiceList": altServiceList, "AltServiceList": altServiceList,
"generalid":GENERAL_ID
}, isLiveCare: _isLive); }, isLiveCare: _isLive);
} }
@ -102,8 +102,23 @@ class LiveCarePatientServices extends BaseService {
}, isLiveCare: _isLive); }, 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 { Future isLogin({LiveCareUserLoginRequestModel isLoginRequestModel, int loginStatus}) async {
hasError = false; hasError = false;
await getDoctorProfile( );
isLoginRequestModel.doctorId = super.doctorProfile.doctorID;
await baseAppClient.post(LIVE_CARE_IS_LOGIN, onSuccess: (response, statusCode) async { await baseAppClient.post(LIVE_CARE_IS_LOGIN, onSuccess: (response, statusCode) async {
isLoginResponse = response; isLoginResponse = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -126,6 +141,7 @@ class LiveCarePatientServices extends BaseService {
super.error = error; super.error = error;
}, body: { }, body: {
"VC_ID": vcID, "VC_ID": vcID,
}, isLiveCare: _isLive); "generalid": GENERAL_ID
}, isLiveCare: _isLive);
} }
} }

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/config.dart'; 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/MyReferralPatientModel.dart';
import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientRequestModel.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.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'; import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart';
@ -8,22 +9,22 @@ class MyReferralInPatientService extends BaseService {
Future getMyReferralPatientService() async { Future getMyReferralPatientService() async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map();
await getDoctorProfile(); await getDoctorProfile();
body['DoctorID'] = doctorProfile.doctorID;
body['FirstName'] = "0"; MyReferralPatientRequestModel myReferralPatientRequestModel =
body['MiddleName'] = "0"; MyReferralPatientRequestModel(
body['LastName'] = "0"; doctorID: doctorProfile.doctorID,
body['PatientMobileNumber'] = "0"; firstName: "0",
body['PatientIdentificationID'] = "0"; middleName: "0",
body['PatientID'] = 0; lastName: "0",
body['From'] = "0"; patientMobileNumber: "0",
body['To'] = "0"; patientIdentificationID: "0",
body['stamp'] = DateTime.now().toIso8601String(); patientID: 0,
body['IsLoginForDoctorApp'] = true; from: "0",
body['IPAdress'] = "11.11.11.11"; to: "0",
body['PatientOutSA'] = false; stamp: DateTime.now().toIso8601String(),
body['PatientTypeID'] = 1; isLoginForDoctorApp: true,
patientTypeID: 1);
myReferralPatients.clear(); myReferralPatients.clear();
await baseAppClient.post( await baseAppClient.post(
GET_MY_REFERRAL_INPATIENT, GET_MY_REFERRAL_INPATIENT,
@ -38,7 +39,43 @@ class MyReferralInPatientService extends BaseService {
hasError = true; hasError = true;
super.error = error; 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(),
); );
} }

@ -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 { Future getPendingReferralList() async {
hasError = false; hasError = false;
DoctorProfileModel doctorProfile = await getDoctorProfile(); 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 { Future endCallWithCharge(int vcID, bool isConfirmed) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
String selectedServicesString = ""; List<int> selectedServices = [];
if (isConfirmed) { if (isConfirmed) {
selectedServicesString = getSelectedAlternativeServices(); selectedServices = getSelectedAlternativeServices();
} }
await _liveCarePatientServices.endCallWithCharge( await _liveCarePatientServices.endCallWithCharge(
vcID, selectedServicesString); vcID, selectedServices);
if (_liveCarePatientServices.hasError) { if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error; error = _liveCarePatientServices.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -117,14 +117,14 @@ class LiveCarePatientViewModel extends BaseViewModel {
} }
} }
String getSelectedAlternativeServices() { List<int> getSelectedAlternativeServices() {
List<int> selectedServices = List(); List<int> selectedServices = List();
for (AlternativeService service in alternativeServicesList) { for (AlternativeService service in alternativeServicesList) {
if (service.isSelected) { if (service.isSelected) {
selectedServices.add(service.serviceID); selectedServices.add(service.serviceID);
} }
} }
return selectedServices.toString(); return selectedServices;
} }
Future getAlternativeServices(int vcID) async { 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) { searchData(String str) {
var strExist = str.length > 0 ? true : false; var strExist = str.length > 0 ? true : false;
if (strExist) { if (strExist) {

@ -28,6 +28,7 @@ class PatientReferralViewModel extends BaseViewModel {
DischargedPatientService _dischargedPatientService = DischargedPatientService _dischargedPatientService =
locator<DischargedPatientService>(); locator<DischargedPatientService>();
List<DischargeReferralPatient> get myDischargeReferralPatient => List<DischargeReferralPatient> get myDischargeReferralPatient =>
_dischargedPatientService.myDischargeReferralPatients; _dischargedPatientService.myDischargeReferralPatients;
@ -133,8 +134,11 @@ class PatientReferralViewModel extends BaseViewModel {
return null; return null;
} }
Future getMyReferredPatient() async { Future getMyReferredPatient({bool isFirstTime = true}) async {
setState(ViewState.Busy); if (isFirstTime)
setState(ViewState.Busy);
else
setState(ViewState.BusyLocal);
await _referralPatientService.getMyReferredPatient(); await _referralPatientService.getMyReferredPatient();
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
error = _referralPatientService.error; error = _referralPatientService.error;
@ -143,6 +147,19 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle); 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) { MyReferredPatientModel getReferredPatientItem(int index) {
return listMyReferredPatientModel[index]; return listMyReferredPatientModel[index];
} }
@ -157,12 +174,22 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getMyReferralPatientService() async { Future getMyReferralPatientService({bool localBusy = false}) async {
setState(ViewState.Busy); if(localBusy) setState(ViewState.BusyLocal); else setState(ViewState.Busy);
await _myReferralService.getMyReferralPatientService(); await _myReferralService.getMyReferralPatientService();
if (_myReferralService.hasError) { if (_myReferralService.hasError) {
error = _myReferralService.error; error = _myReferralService.error;
setState(ViewState.Error); if(localBusy) setState(ViewState.ErrorLocal); else setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
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 } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }

@ -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:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:get_it/get_it.dart'; import 'package:get_it/get_it.dart';
import 'core/service/NavigationService.dart';
import 'core/service/home/dasboard_service.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/DischargedPatientService.dart';
import 'core/service/patient/LiveCarePatientServices.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/MyReferralPatientService.dart';
import 'core/service/patient/PatientMuseService.dart'; import 'core/service/patient/PatientMuseService.dart';
import 'core/service/patient/ReferralService.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/PatientMedicalReportService.dart';
import 'core/service/patient_medical_file/medical_report/medical_file_service.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/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/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/sick_leave/sickleave_service.dart';
import 'core/service/patient_medical_file/soap/SOAP_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/ucaf/patient-ucaf-service.dart';
import 'core/service/patient_medical_file/vital_sign/patient-vital-signs-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/DischargedPatientViewModel.dart';
import 'core/viewModel/InsuranceViewModel.dart'; import 'core/viewModel/InsuranceViewModel.dart';
import 'core/viewModel/LiveCarePatientViewModel.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/prescriptions_view_model.dart';
import 'core/viewModel/radiology_view_model.dart'; import 'core/viewModel/radiology_view_model.dart';
import 'core/viewModel/referral_view_model.dart'; import 'core/viewModel/referral_view_model.dart';
import 'core/viewModel/referred_view_model.dart';
import 'core/viewModel/schedule_view_model.dart'; import 'core/viewModel/schedule_view_model.dart';
GetIt locator = GetIt.instance; GetIt locator = GetIt.instance;
@ -65,7 +64,6 @@ void setupLocator() {
locator.registerLazySingleton(() => DoctorReplyService()); locator.registerLazySingleton(() => DoctorReplyService());
locator.registerLazySingleton(() => ScheduleService()); locator.registerLazySingleton(() => ScheduleService());
locator.registerLazySingleton(() => ReferralPatientService()); locator.registerLazySingleton(() => ReferralPatientService());
locator.registerLazySingleton(() => ReferredPatientService());
locator.registerLazySingleton(() => MedicineService()); locator.registerLazySingleton(() => MedicineService());
locator.registerLazySingleton(() => PatientService()); locator.registerLazySingleton(() => PatientService());
locator.registerLazySingleton(() => DashboardService()); locator.registerLazySingleton(() => DashboardService());
@ -92,12 +90,12 @@ void setupLocator() {
locator.registerLazySingleton(() => HospitalsService()); locator.registerLazySingleton(() => HospitalsService());
locator.registerLazySingleton(() => PatientMedicalReportService()); locator.registerLazySingleton(() => PatientMedicalReportService());
locator.registerLazySingleton(() => LiveCarePatientServices()); locator.registerLazySingleton(() => LiveCarePatientServices());
locator.registerLazySingleton(() => NavigationService());
/// View Model /// View Model
locator.registerFactory(() => DoctorReplayViewModel()); locator.registerFactory(() => DoctorReplayViewModel());
locator.registerFactory(() => ScheduleViewModel()); locator.registerFactory(() => ScheduleViewModel());
locator.registerFactory(() => ReferralPatientViewModel()); locator.registerFactory(() => ReferralPatientViewModel());
locator.registerFactory(() => ReferredPatientViewModel());
locator.registerFactory(() => MedicineViewModel()); locator.registerFactory(() => MedicineViewModel());
locator.registerFactory(() => PatientViewModel()); locator.registerFactory(() => PatientViewModel());
locator.registerFactory(() => DashboardViewModel()); locator.registerFactory(() => DashboardViewModel());

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

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

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

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

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

@ -48,7 +48,9 @@ class _EndCallScreenState extends State<EndCallScreen> {
final List<PatientProfileCardModel> cardsList = [ final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel(TranslationBase.of(context).resume, PatientProfileCardModel(TranslationBase.of(context).resume,
TranslationBase.of(context).theCall, '', 'patient/vital_signs.png', TranslationBase.of(context).theCall, '', 'patient/vital_signs.png',
isInPatient: isInpatient, onTap: () async { isInPatient: isInpatient,
color: Colors.green[800],
onTap: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel await liveCareModel
.startCall(isReCall: false, vCID: widget.patient.vcId) .startCall(isReCall: false, vCID: widget.patient.vcId)
@ -105,7 +107,9 @@ class _EndCallScreenState extends State<EndCallScreen> {
TranslationBase.of(context).consultation, TranslationBase.of(context).consultation,
'', '',
'patient/vital_signs.png', 'patient/vital_signs.png',
isInPatient: isInpatient, onTap: () { isInPatient: isInpatient,
color: Colors.red[800],
onTap: () {
Helpers.showConfirmationDialog(context, Helpers.showConfirmationDialog(context,
"${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).endLC} ${TranslationBase.of(context).consultation} ?", "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).endLC} ${TranslationBase.of(context).consultation} ?",
() async { () async {
@ -136,10 +140,24 @@ class _EndCallScreenState extends State<EndCallScreen> {
TranslationBase.of(context).instruction, TranslationBase.of(context).instruction,
"", "",
'patient/health_summary.png', '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, isInPatient: isInpatient,
isDartIcon: true, isDartIcon: true,
isDisable: true, // isDisable: true,
dartIcon: DoctorApp.send_instruction), dartIcon: DoctorApp.send_instruction),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).transferTo, TranslationBase.of(context).transferTo,
@ -230,6 +248,7 @@ class _EndCallScreenState extends State<EndCallScreen> {
isLoading: cardsList[index].isLoading, isLoading: cardsList[index].isLoading,
isDartIcon: cardsList[index].isDartIcon, isDartIcon: cardsList[index].isDartIcon,
dartIcon: cardsList[index].dartIcon, dartIcon: cardsList[index].dartIcon,
color: cardsList[index].color,
), ),
), ),
], ],

@ -120,7 +120,7 @@ class _LivaCareTransferToAdminState extends State<LivaCareTransferToAdmin> {
() async { () async {
Navigator.of(context).pop(); Navigator.of(context).pop();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model.transferToAdmin(widget.patient.vcId, noteController.text); await model.transferToAdmin(widget.patient.vcId, noteController.text);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); 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/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.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_loader_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';

@ -1,10 +1,9 @@
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.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_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.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:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';

@ -1,10 +1,8 @@
import 'package:doctor_app_flutter/config/size_config.dart'; 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/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/patient_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/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.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/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
@ -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/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.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/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_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_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/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/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.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/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_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_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/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/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:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';

@ -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/core/viewModel/labs_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/GeneralLabResultHeader.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -32,37 +32,32 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<LabsViewModel>( 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( onModelReady: (model) => model.getPatientLabResult(
patientLabOrder: widget.patientLabOrders, patientLabOrder: widget.patientLabOrders,
patient: widget.patient, patient: widget.patient,
isInpatient: true), isInpatient: true),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBar: PatientProfileHeaderWhitAppointmentAppBar( appBar: GeneralLabResultHeader(
patient: widget.patient, patient: widget.patient,
patientType: widget.patientType ?? "0", patientType: widget.patientType ?? "0",
arrivalType: widget.arrivalType ?? "0", arrivalType: widget.arrivalType ?? "0",
orderNo: widget.patientLabOrders.orderNo, orderNo: widget.patientLabOrders.orderNo,
appointmentDate: widget.patientLabOrders.orderDate, appointmentDate: widget.patientLabOrders.orderDate,
doctorName: widget.patientLabOrders.doctorName, doctorName: widget.patientLabOrders.doctorName,
branch: widget.patientLabOrders.projectName, branch: widget.patientLabOrders.projectName,
clinic: widget.patientLabOrders.clinicDescription, clinic: widget.patientLabOrders.clinicDescription,
profileUrl: widget.patientLabOrders.doctorImageURL, profileUrl: widget.patientLabOrders.doctorImageURL,
invoiceNO: widget.patientLabOrders.invoiceNo, invoiceNO: widget.patientLabOrders.invoiceNo,
), ),
baseViewModel: model, baseViewModel: model,
body: AppScaffold( body: AppScaffold(
isShowAppBar: false, isShowAppBar: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
LaboratoryResultWidget( LaboratoryResultWidget(
onTap: () async {}, onTap: () async {},
billNo: widget.patientLabOrders.invoiceNo, billNo: widget.patientLabOrders.invoiceNo,

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

@ -156,51 +156,57 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * 0.05, height: MediaQuery.of(context).size.height * 0.05,
) )
],
),
),
], ],
), ),
if (patient.patientStatusType != null && ),
patient.patientStatusType == 43) ],
BaseView<SOAPViewModel>( ),
onModelReady: (model) async {}, if (isFromLiveCare
builder: (_, model, w) => Positioned( ? patient.episodeNo != null
top: 180, : patient.patientStatusType != null &&
left: 20, patient.patientStatusType == 43)
right: 20, BaseView<SOAPViewModel>(
child: Row( onModelReady: (model) async {},
children: [ builder: (_, model, w) => Positioned(
Expanded(child: Container()), top: 180,
if (patient.episodeNo == 0) left: 20,
AppButton( right: 20,
title: child: Row(
"${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", children: [
color: patient.patientStatusType == 43 Expanded(child: Container()),
? Colors.red.shade700 if (patient.episodeNo == 0)
: Colors.grey.shade700, AppButton(
fontColor: Colors.white, title:
vPadding: 8, "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}",
radius: 30, color: isFromLiveCare
hPadding: 20, ? Colors.red.shade700
fontWeight: FontWeight.normal, : patient.patientStatusType == 43
fontSize: 1.6, ? Colors.red.shade700
icon: Image.asset( : Colors.grey.shade700,
"assets/images/create-episod.png", fontColor: Colors.white,
color: 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, height: 30,
), ),
onPressed: () async { onPressed: () async {
if (patient.patientStatusType == if ((isFromLiveCare &&
43) { patient.appointmentNo != null &&
patient.appointmentNo != 0) ||
patient.patientStatusType ==
43) {
PostEpisodeReqModel PostEpisodeReqModel
postEpisodeReqModel = postEpisodeReqModel =
PostEpisodeReqModel( PostEpisodeReqModel(
appointmentNo: appointmentNo:
patient.appointmentNo, patient.appointmentNo,
patientMRN: patientMRN:
patient.patientMRN); patient.patientMRN);
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(
context); context);
await model.postEpisode( await model.postEpisode(
@ -220,11 +226,18 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
if (patient.episodeNo != 0) if (patient.episodeNo != 0)
AppButton( AppButton(
title: title:
"${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", "${TranslationBase
.of(context)
.update}\n${TranslationBase
.of(context)
.episode}",
color: color:
patient.patientStatusType == 43 isFromLiveCare
? Colors.red.shade700 ? Colors.red.shade700
: Colors.grey.shade700, : patient.patientStatusType ==
43
? Colors.red.shade700
: Colors.grey.shade700,
fontColor: Colors.white, fontColor: Colors.white,
vPadding: 8, vPadding: 8,
radius: 30, radius: 30,
@ -237,8 +250,12 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
height: 30, height: 30,
), ),
onPressed: () { onPressed: () {
if (patient.patientStatusType == if ((isFromLiveCare &&
43) { patient.appointmentNo !=
null &&
patient.appointmentNo != 0) ||
patient.patientStatusType ==
43) {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
UPDATE_EPISODE, UPDATE_EPISODE,
arguments: { arguments: {
@ -283,6 +300,11 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
TranslationBase.of(context).initiateCall, TranslationBase.of(context).initiateCall,
disabled: model.state == ViewState.BusyLocal, disabled: model.state == ViewState.BusyLocal,
onPressed: () async { onPressed: () async {
// Navigator.push(context, MaterialPageRoute(
// builder: (BuildContext context) =>
// EndCallScreen(patient:patient)));
if(isCallFinished) { if(isCallFinished) {
Navigator.push(context, MaterialPageRoute( Navigator.push(context, MaterialPageRoute(
builder: (BuildContext context) => builder: (BuildContext context) =>

@ -14,17 +14,24 @@ import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dar
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt; import 'package:speech_to_text/speech_to_text.dart' as stt;
import 'ReplySummeryOnReferralPatient.dart';
class AddReplayOnReferralPatient extends StatefulWidget { class AddReplayOnReferralPatient extends StatefulWidget {
final PatientReferralViewModel patientReferralViewModel; final PatientReferralViewModel patientReferralViewModel;
final MyReferralPatientModel myReferralInPatientModel; final MyReferralPatientModel myReferralInPatientModel;
final bool isEdited;
const AddReplayOnReferralPatient( const AddReplayOnReferralPatient(
{Key key, this.patientReferralViewModel, this.myReferralInPatientModel}) {Key key,
this.patientReferralViewModel,
this.myReferralInPatientModel,
this.isEdited})
: super(key: key); : super(key: key);
@override @override
@ -39,10 +46,13 @@ class _AddReplayOnReferralPatientState
var reconizedWord; var reconizedWord;
var event = RobotProvider(); var event = RobotProvider();
TextEditingController replayOnReferralController = TextEditingController(); TextEditingController replayOnReferralController = TextEditingController();
@override @override
void initState() { void initState() {
requestPermissions(); requestPermissions();
super.initState(); super.initState();
replayOnReferralController.text =
widget.myReferralInPatientModel.referredDoctorRemarks ?? "";
} }
@override @override
@ -50,116 +60,189 @@ class _AddReplayOnReferralPatientState
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView( body: Column(
child: Container( children: [
height: MediaQuery.of(context).size.height * 1.0, Expanded(
child: Padding( child: SingleChildScrollView(
padding: EdgeInsets.all(0.0), child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ BottomSheetTitle(title: 'Reply'),
BottomSheetTitle(title: 'Replay'), SizedBox(
SizedBox( height: 10.0,
height: 10.0, ),
), Center(
Center( child: FractionallySizedBox(
child: FractionallySizedBox( widthFactor: 0.9,
widthFactor: 0.9, child: Column(
child: Column( children: [
children: [ Stack(
Stack( children: [
children: [ AppTextFieldCustom(
AppTextFieldCustom( hintText: 'Reply your responses here',
hintText: 'Replay your responses here', controller: replayOnReferralController,
controller: replayOnReferralController, maxLines: 35,
maxLines: 35, minLines: 25,
minLines: 25, hasBorder: true,
hasBorder: true, validationError: replayOnReferralController
validationError: .text.isEmpty &&
replayOnReferralController.text.isEmpty && isSubmitted
isSubmitted ? TranslationBase.of(context).emptyMessage
? TranslationBase.of(context).emptyMessage : null,
: 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();
},
), ),
) Positioned(
], top: 0,
), //MediaQuery.of(context).size.height * 0,
], right: 15,
child: IconButton(
icon: Icon(
DoctorApp.speechtotext,
color: Colors.black,
size: 35,
),
onPressed: () {
onVoiceText();
},
),
)
],
),
],
),
), ),
), ),
), ],
], ),
), ),
), ),
), Container(
), // height: replayOnReferralController.text.isNotEmpty ? 130 : 70,
bottomSheet: Container( // margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
height: replayOnReferralController.text.isNotEmpty ? 130 : 70, child: Column(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), children: <Widget>[
child: Column( replayOnReferralController.text.isEmpty
children: <Widget>[ ? SizedBox()
replayOnReferralController.text.isEmpty : Container(
? SizedBox() margin: EdgeInsets.all(16),
: Container( child: AppButton(
margin: EdgeInsets.all(5), title: TranslationBase.of(context).clearText,
child: Expanded( onPressed: () {
setState(() {
replayOnReferralController.text = '';
});
},
),
),
Container(
margin: EdgeInsets.fromLTRB(16, 0, 16, 16),
child: Row(
children: [
Expanded(
child: AppButton( child: AppButton(
title: TranslationBase.of(context).clearText, onPressed: () {
onPressed: () { Navigator.of(context).pop();
setState(() { },
replayOnReferralController.text = ''; 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.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;
});
}
},
title: TranslationBase.of(context).noteConfirm,
fontColor: Colors.white,
color: Colors.green[600],
),
),
],
), ),
Container( ),
margin: EdgeInsets.all(5), // Container(
child: AppButton( // margin: EdgeInsets.all(5),
title: 'Submit Replay', // child: AppButton(
color: Color(0xff359846), // title: 'Submit Reply',
fontWeight: FontWeight.w700, // color: Color(0xff359846),
onPressed: () async { // fontWeight: FontWeight.w700,
setState(() { // onPressed: () async {
isSubmitted = true; // setState(() {
}); // isSubmitted = true;
if (replayOnReferralController.text.isNotEmpty) { // });
GifLoaderDialogUtils.showMyDialog(context); // if (replayOnReferralController.text.isNotEmpty) {
await widget.patientReferralViewModel.replay( // GifLoaderDialogUtils.showMyDialog(context);
replayOnReferralController.text.trim(), // await widget.patientReferralViewModel.replay(
widget.myReferralInPatientModel); // replayOnReferralController.text.trim(),
if (widget.patientReferralViewModel.state == // widget.myReferralInPatientModel);
ViewState.ErrorLocal) { // if (widget.patientReferralViewModel.state ==
Helpers.showErrorToast( // ViewState.ErrorLocal) {
widget.patientReferralViewModel.error); // Helpers.showErrorToast(
} else { // widget.patientReferralViewModel.error);
GifLoaderDialogUtils.hideDialog(context); // } else {
DrAppToastMsg.showSuccesToast( // GifLoaderDialogUtils.hideDialog(context);
"Your Replay Added Successfully"); // DrAppToastMsg.showSuccesToast(
Navigator.of(context).pop(); // "Your Reply Added Successfully");
Navigator.of(context).pop(); // Navigator.of(context).pop();
} // Navigator.of(context).pop();
} else { //
Helpers.showErrorToast("You can't add empty replay"); // Navigator.push(
setState(() { // context,
isSubmitted = false; // FadePage(
}); // page: ReplySummeryOnReferralPatient(
} // widget.myReferralInPatientModel,
})), // replayOnReferralController.text.trim()),
], // ),
), // );
// }
// } else {
// Helpers.showErrorToast("You can't add empty reply");
// setState(() {
// isSubmitted = false;
// });
// }
// })),
],
),
),
],
), ),
); );
} }

@ -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,21 @@
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/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/referral_patient_detail_in-paint.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/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.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_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_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:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class MyReferralInPatientScreen extends StatelessWidget { class MyReferralInPatientScreen extends StatelessWidget {
PatientType patientType = PatientType.IN_PATIENT;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -20,72 +25,89 @@ class MyReferralInPatientScreen extends StatelessWidget {
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
appBarTitle: TranslationBase.of(context).referPatient, appBarTitle: TranslationBase.of(context).referPatient,
body: model.myReferralPatients.isEmpty body: Column(
? Center( children: [
child: Column( Container(
crossAxisAlignment: CrossAxisAlignment.center, margin: EdgeInsets.only(top: 70),
children: [ child: PatientTypeRadioWidget(
SizedBox( (patientType) async {
height: 100, 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( : Expanded(
padding: const EdgeInsets.all(8.0), child: SingleChildScrollView(
child: AppText( child: Container(
TranslationBase.of(context).referralEmptyMsg, child: Column(
color: Theme.of(context).errorColor, crossAxisAlignment: CrossAxisAlignment.start,
), children: [
) ...List.generate(
], model.myReferralPatients.length,
), (index) => InkWell(
) onTap: () {
: SingleChildScrollView( Navigator.push(
child: Container( context,
margin: EdgeInsets.only(top: 70), FadePage(
// color: Colors.white, page: ReferralPatientDetailScreen(model.myReferralPatients[index],model),
// height: MediaQuery.of(context).size.height, ),
child: Column( );
crossAxisAlignment: CrossAxisAlignment.start, },
children: [ child: PatientReferralItemWidget(
// SizedBox(height: 50), referralStatus: model.getReferralStatusNameByCode(model.myReferralPatients[index].referralStatus,context),
...List.generate( referralStatusCode: model.myReferralPatients[index].referralStatus,
model.myReferralPatients.length, patientName: model.myReferralPatients[index].patientName,
(index) => InkWell( patientGender: model.myReferralPatients[index].gender,
onTap: () { referredDate: AppDateUtils.getDayMonthYearDateFormatted(model.myReferralPatients[index].referralDate),
Navigator.push( referredTime: AppDateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate),
context, patientID: "${model.myReferralPatients[index].patientID}",
FadePage( isSameBranch: false,
page: ReferralPatientDetailScreen(model.myReferralPatients[index],model), 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),
),
), ),
), ),
], ),
),
), ),
), ],
),
), ),
); );
} }

@ -19,6 +19,7 @@ import 'AddReplayOnReferralPatient.dart';
class ReferralPatientDetailScreen extends StatelessWidget { class ReferralPatientDetailScreen extends StatelessWidget {
final MyReferralPatientModel referredPatient; final MyReferralPatientModel referredPatient;
final PatientReferralViewModel patientReferralViewModel; final PatientReferralViewModel patientReferralViewModel;
ReferralPatientDetailScreen( ReferralPatientDetailScreen(
this.referredPatient, this.patientReferralViewModel); this.referredPatient, this.patientReferralViewModel);
@ -153,7 +154,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: referredPatient.referralStatus == 1 color: referredPatient.referralStatus == 1
? Color(0xffc4aa54) ? Color(0xffc4aa54)
: referredPatient.referralStatus == 46 : referredPatient.referralStatus == 46 || referredPatient.referralStatus == 2
? Colors.green[700] ? Colors.green[700]
: Colors.red[700], : Colors.red[700],
), ),
@ -214,29 +215,6 @@ class ReferralPatientDetailScreen extends StatelessWidget {
Expanded( Expanded(
child: Column( child: Column(
children: [ children: [
Row(
mainAxisAlignment:
MainAxisAlignment.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( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
@ -244,9 +222,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) "${TranslationBase.of(context).refClinic}: ",
.frequency +
": ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * fontSize: 1.7 *
@ -256,7 +232,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
Expanded( Expanded(
child: AppText( child: AppText(
referredPatient referredPatient
.frequencyDescription, .referringClinicDescription,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * fontSize: 1.8 *
@ -266,6 +242,38 @@ class ReferralPatientDetailScreen extends StatelessWidget {
), ),
], ],
), ),
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),
),
),
],
),
], ],
), ),
), ),
@ -303,57 +311,69 @@ class ReferralPatientDetailScreen extends StatelessWidget {
) )
], ],
), ),
Row( if (referredPatient.priorityDescription != null)
mainAxisAlignment: MainAxisAlignment.start, Row(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ crossAxisAlignment:
AppText( CrossAxisAlignment.start,
TranslationBase.of(context).priority + children: [
": ", AppText(
fontFamily: 'Poppins', TranslationBase.of(context).priority +
fontWeight: FontWeight.w600, ": ",
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient.priorityDescription,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w600,
fontSize: fontSize:
1.8 * SizeConfig.textMultiplier, 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF575757),
), ),
), Expanded(
], child: AppText(
), referredPatient.priorityDescription ??
Row( '',
mainAxisAlignment: MainAxisAlignment.start, fontFamily: 'Poppins',
crossAxisAlignment: CrossAxisAlignment.start, fontWeight: FontWeight.w700,
children: [ fontSize:
AppText( 1.8 * SizeConfig.textMultiplier,
TranslationBase.of(context) color: Color(0XFF2E303A),
.maxResponseTime + ),
": ", ),
fontFamily: 'Poppins', ],
fontWeight: FontWeight.w600, ),
fontSize: 1.7 * SizeConfig.textMultiplier, if (referredPatient.mAXResponseTime != null)
color: Color(0XFF575757), Row(
), mainAxisAlignment: MainAxisAlignment.start,
Expanded( crossAxisAlignment:
child: AppText( CrossAxisAlignment.start,
AppDateUtils.convertDateFromServerFormat( children: [
referredPatient.mAXResponseTime, AppText(
"dd MMM,yyyy"), TranslationBase.of(context)
.maxResponseTime +
": ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w600,
fontSize: fontSize:
1.8 * SizeConfig.textMultiplier, 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A), 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( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -445,67 +465,115 @@ class ReferralPatientDetailScreen extends StatelessWidget {
), ),
Expanded( Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Column(
width: double.infinity, children: [
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), Container(
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), width: double.infinity,
decoration: BoxDecoration( margin:
color: Colors.white, EdgeInsets.symmetric(horizontal: 16, vertical: 16),
shape: BoxShape.rectangle, padding:
borderRadius: BorderRadius.all(Radius.circular(8)), EdgeInsets.symmetric(horizontal: 16, vertical: 16),
border: Border.fromBorderSide(BorderSide( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
width: 1.0, shape: BoxShape.rectangle,
)), borderRadius: BorderRadius.all(Radius.circular(8)),
), border: Border.fromBorderSide(BorderSide(
child: Column( color: Colors.white,
crossAxisAlignment: CrossAxisAlignment.start, width: 1.0,
children: [ )),
AppText(
TranslationBase.of(context).remarks,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 2.4 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
), ),
AppText( child: Column(
referredPatient.referringDoctorRemarks, crossAxisAlignment: CrossAxisAlignment.start,
fontFamily: 'Poppins', children: [
fontWeight: FontWeight.w600, AppText(
fontSize: 1.8 * SizeConfig.textMultiplier, TranslationBase.of(context).remarks,
color: Color(0XFF2E303A), 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( if (referredPatient.referralStatus == 1)
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), Container(
child: AppButton( margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
title: TranslationBase.of(context).replay, child: AppButton(
color: Colors.red[700], title: TranslationBase.of(context).replay,
fontColor: Colors.white, color: Colors.red[700],
fontWeight: FontWeight.w700, fontColor: Colors.white,
fontSize: 1.8, fontWeight: FontWeight.w700,
hPadding: 8, fontSize: 1.8,
vPadding: 12, hPadding: 8,
onPressed: () async { vPadding: 12,
Navigator.push( onPressed: () async {
context, Navigator.push(
SlideUpPageRoute( context,
widget: AddReplayOnReferralPatient( SlideUpPageRoute(
patientReferralViewModel: patientReferralViewModel, widget: AddReplayOnReferralPatient(
myReferralInPatientModel: referredPatient, 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/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/referred_patient_detail_in-paint.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/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_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_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:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class ReferredPatientScreen extends StatelessWidget { class ReferredPatientScreen extends StatelessWidget {
// previous design page is: MyReferredPatient
PatientType patientType = PatientType.IN_PATIENT;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<PatientReferralViewModel>( return BaseView<PatientReferralViewModel>(
@ -20,103 +24,172 @@ class ReferredPatientScreen extends StatelessWidget {
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
appBarTitle: TranslationBase.of(context).referredPatient, appBarTitle: TranslationBase.of(context).referredPatient,
body: model.listMyReferredPatientModel == null || body: Column(
model.listMyReferredPatientModel.length == 0 children: [
? Center( Container(
child: Column( margin: EdgeInsets.only(top: 70),
crossAxisAlignment: CrossAxisAlignment.center, child: PatientTypeRadioWidget(
children: [ (patientType) async {
Container( this.patientType = patientType;
height: 100, 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( : Expanded(
padding: const EdgeInsets.all(8.0), child: SingleChildScrollView(
child: AppText( // DoctorApplication.svc/REST/GtMyReferredPatient
TranslationBase.of(context).referralEmptyMsg, child: Container(
color: Theme.of(context).errorColor, child: Column(
), children: [
) ...List.generate(
], model.listMyReferredPatientModel.length,
), (index) => InkWell(
) onTap: () {
: SingleChildScrollView( Navigator.push(
// DoctorApplication.svc/REST/GtMyReferredPatient context,
child: Container( FadePage(
margin: EdgeInsets.only(top: 70), page: ReferredPatientDetailScreen(
child: Column( model.getReferredPatientItem(index)),
children: [ ),
// const Divider( );
// color: Color(0xffCCCCCC), },
// height: 1, child: PatientReferralItemWidget(
// thickness: 2, referralStatus: model
// indent: 0, .getReferredPatientItem(index)
// endIndent: 0, .referralStatusDesc,
// ), referralStatusCode: model
...List.generate( .getReferredPatientItem(index)
model.listMyReferredPatientModel.length, .referralStatus,
(index) => InkWell( patientName:
onTap: () { "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}",
Navigator.push( patientGender:
context, model.getReferredPatientItem(index).gender,
FadePage( referredDate:
page: ReferredPatientDetailScreen( AppDateUtils.convertDateFromServerFormat(
model.getReferredPatientItem(index)), 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( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
@ -301,6 +303,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
) )
], ],
), ),
if(referredPatient.priorityDescription != null)
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -322,6 +325,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
), ),
], ],
), ),
if(referredPatient.mAXResponseTime != null)
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -337,9 +341,9 @@ class ReferredPatientDetailScreen extends StatelessWidget {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
AppDateUtils.convertDateFromServerFormat( referredPatient.mAXResponseTime != null?AppDateUtils.convertDateFromServerFormat(
referredPatient.mAXResponseTime, referredPatient.mAXResponseTime,
"dd MMM,yyyy"), "dd MMM,yyyy"):'',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: fontSize:
@ -515,6 +519,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
), ),
AppText( AppText(
referredPatient referredPatient
.referredDoctorRemarks == null ?'':referredPatient
.referredDoctorRemarks.isNotEmpty .referredDoctorRemarks.isNotEmpty
? referredPatient.referredDoctorRemarks ? referredPatient.referredDoctorRemarks
: TranslationBase.of(context).notRepliedYet, : TranslationBase.of(context).notRepliedYet,
@ -543,7 +548,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
fontSize: 1.8, fontSize: 1.8,
hPadding: 8, hPadding: 8,
vPadding: 12, vPadding: 12,
disabled: referredPatient.referredDoctorRemarks.isNotEmpty disabled: referredPatient.referredDoctorRemarks == null? true: referredPatient.referredDoctorRemarks.isNotEmpty
? false ? false
: true, : true,
onPressed: () async { onPressed: () async {

@ -68,20 +68,26 @@ class AppDateUtils {
return "$days ${TranslationBase.of(context).days}, $months ${TranslationBase.of(context).months}, $years ${TranslationBase.of(context).years}"; 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 = DateTime.now();
// DateTime now = nows.add(Duration(days: 400, minutes: 25, hours: 0));
var difference = now.difference(firstDate); var difference = now.difference(firstDate);
int minutesInDays = difference.inMinutes; int minutesInDays = difference.inMinutes;
int secondInDays = difference.inSeconds;
int hoursInDays = minutesInDays ~/ 60; // ~/ : truncating division to make the result int int hoursInDays = minutesInDays ~/ 60; // ~/ : truncating division to make the result int
int second = secondInDays % 60;
int minutes = minutesInDays % 60; int minutes = minutesInDays % 60;
int days = hoursInDays ~/ 24; int days = hoursInDays ~/ 24;
int hours = hoursInDays % 24; int hours = hoursInDays % 24;
double hoursInOneDay = difference.inHours / difference.inDays; 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) { static String differenceBetweenServerDateAndCurrent(String str, BuildContext context) {
@ -365,4 +371,22 @@ class AppDateUtils {
else else
return ""; 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;
}
} }

@ -1363,6 +1363,8 @@ class TranslationBase {
String get allLab => localizedValues['allLab'][locale.languageCode]; String get allLab => localizedValues['allLab'][locale.languageCode];
String get allPrescription => localizedValues['allPrescription'][locale.languageCode]; String get allPrescription => localizedValues['allPrescription'][locale.languageCode];
String get addPrescription => localizedValues['addPrescription'][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> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -58,7 +58,7 @@ class PatientReferralItemWidget extends StatelessWidget {
child: CardWithBgWidget( child: CardWithBgWidget(
bgColor: referralStatusCode == 1 bgColor: referralStatusCode == 1
? Color(0xffc4aa54) ? Color(0xffc4aa54)
: referralStatusCode == 46 : referralStatusCode == 46 || referralStatusCode == 2
? Colors.green[700] ? Colors.green[700]
: Colors.red[700], : Colors.red[700],
hasBorder: false, hasBorder: false,
@ -78,7 +78,7 @@ class PatientReferralItemWidget extends StatelessWidget {
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: referralStatusCode == 1 color: referralStatusCode == 1
? Color(0xffc4aa54) ? Color(0xffc4aa54)
: referralStatusCode == 46 : referralStatusCode == 46 || referralStatusCode == 2
? Colors.green[700] ? Colors.green[700]
: Colors.red[700], : Colors.red[700],
), ),
@ -155,6 +155,7 @@ class PatientReferralItemWidget extends StatelessWidget {
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
isSameBranch ? TranslationBase.of(context).referredFrom :TranslationBase.of(context).refClinic, isSameBranch ? TranslationBase.of(context).referredFrom :TranslationBase.of(context).refClinic,
@ -163,13 +164,14 @@ class PatientReferralItemWidget extends StatelessWidget {
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
Expanded(
AppText( child: AppText(
!isReferralClinic? isSameBranch ? TranslationBase.of(context).sameBranch : TranslationBase.of(context).otherBranch: " "+referralClinic, !isReferralClinic? isSameBranch ? TranslationBase.of(context).sameBranch : TranslationBase.of(context).otherBranch: " "+referralClinic,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
),
), ),
], ],
), ),
@ -215,7 +217,7 @@ class PatientReferralItemWidget extends StatelessWidget {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
remark, remark??"",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier, 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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'ShowTimer.dart';
class PatientCard extends StatelessWidget { class PatientCard extends StatelessWidget {
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
final Function onTap; final Function onTap;
@ -19,7 +21,7 @@ class PatientCard extends StatelessWidget {
final bool isFromSearch; final bool isFromSearch;
final bool isFromLiveCare; final bool isFromLiveCare;
const PatientCard( PatientCard(
{Key key, {Key key,
this.patientInfo, this.patientInfo,
this.onTap, this.onTap,
@ -33,6 +35,7 @@ class PatientCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
width: SizeConfig.screenWidth * 0.9, width: SizeConfig.screenWidth * 0.9,
margin: EdgeInsets.all(6), margin: EdgeInsets.all(6),
@ -257,9 +260,9 @@ class PatientCard extends StatelessWidget {
patientInfo.fullName) patientInfo.fullName)
: (Helpers.capitalize( : (Helpers.capitalize(
patientInfo.firstName) + patientInfo.firstName) +
" " + " " +
Helpers.capitalize( Helpers.capitalize(
patientInfo.lastName)), patientInfo.lastName)),
fontSize: 16, fontSize: 16,
color: Color(0xff2e303a), color: Color(0xff2e303a),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -267,6 +270,7 @@ class PatientCard extends StatelessWidget {
textOverflow: TextOverflow.ellipsis, textOverflow: TextOverflow.ellipsis,
), ),
), ),
if (patientInfo.gender == 1) if (patientInfo.gender == 1)
Icon( Icon(
DoctorApp.male_2, DoctorApp.male_2,
@ -277,6 +281,9 @@ class PatientCard extends StatelessWidget {
DoctorApp.female_1, DoctorApp.female_1,
color: Colors.pink, color: Colors.pink,
), ),
if(isFromLiveCare)
ShowTimer(patientInfo: patientInfo,),
]), ]),
), ),
Row( Row(
@ -515,12 +522,14 @@ class PatientCard extends StatelessWidget {
height: 25, height: 25,
width: 35, width: 35,
)), )),
]) ])
: SizedBox() : SizedBox()
], ],
), ),
onTap: onTap, 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;
}
}

@ -0,0 +1,349 @@
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:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
class GeneralLabResultHeader 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;
GeneralLabResultHeader(
{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: MediaQuery.of(context).size.height * 0.23,
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,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).fileNumber,
style: TextStyle(
fontSize: 14, 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)),
],
),
),
),
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: 14)),
new TextSpan(
text:
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',
style: TextStyle(
fontWeight: FontWeight.w700, 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);
}

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

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save