Merge branch 'development' into 'master'

Development

See merge request Cloud_Solution/doctor_app_flutter!776
release_6.3
Mohammad Aljammal 5 years ago
commit 604a6bbfa9

@ -108,6 +108,6 @@ dependencies {
implementation 'com.squareup.okhttp3:okhttp:4.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:4.9.1' implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1'
implementation 'com.google.firebase:firebase-analytics:17.4.1'
} }
apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.gms.google-services'

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

@ -13,6 +13,7 @@ public interface VideoCallContract {
void onCallChangeCallStatusSuccessful(SessionStatusModel sessionStatusModel); void onCallChangeCallStatusSuccessful(SessionStatusModel sessionStatusModel);
void onFailure(); void onFailure();
} }
interface VideoCallPresenter { interface VideoCallPresenter {

@ -59,7 +59,6 @@ public class VideoCallPresenterImpl implements VideoCallContract.VideoCallPresen
public void onResponse(@NotNull Call<SessionStatusModel> call, @NotNull Response<SessionStatusModel> response) { public void onResponse(@NotNull Call<SessionStatusModel> call, @NotNull Response<SessionStatusModel> response) {
if (!response.isSuccessful()) if (!response.isSuccessful())
view.onFailure(); view.onFailure();
} }
@Override @Override

@ -416,6 +416,20 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
mSession = Session.Builder(context, apiKey, sessionId).build() mSession = Session.Builder(context, apiKey, sessionId).build()
mSession!!.setSessionListener(this) mSession!!.setSessionListener(this)
mSession!!.connect(token) mSession!!.connect(token)
mSession!!.setReconnectionListener(object :Session.ReconnectionListener{
override fun onReconnecting(p0: Session?) {
}
override fun onReconnected(session: Session?) {
session?.connect(token)
}
})
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
} }
@ -453,10 +467,10 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
override fun onDisconnected(session: Session) { override fun onDisconnected(session: Session) {
Log.d(TAG, "onDisconnected: disconnected from session " + session.sessionId) Log.d(TAG, "onDisconnected: disconnected from session " + session.sessionId)
mSession = null // mSession = null
cmTimer.stop() // cmTimer.stop()
disconnectSession() // disconnectSession()
videoCallResponseListener?.minimizeVideoEvent(false) // videoCallResponseListener?.minimizeVideoEvent(false)
} }
override fun onError(session: Session, opentokError: OpentokError) { override fun onError(session: Session, opentokError: OpentokError) {
@ -503,7 +517,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
mSubscriber!!.destroy() mSubscriber!!.destroy()
mSubscriber = null mSubscriber = null
} }
disconnectSession() //disconnectSession()
} }
override fun onStreamCreated(publisherKit: PublisherKit?, stream: Stream) { override fun onStreamCreated(publisherKit: PublisherKit?, stream: Stream) {
@ -628,6 +642,16 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
sessionStatusModel!!.vcid sessionStatusModel!!.vcid
) )
) )
// if(isDismiss)
// dialog?.dismiss()
// else
onCallChangeCallStatusSuccessful()
}
fun onCallChangeCallStatusSuccessful(){
val returnIntent = Intent()
returnIntent.putExtra("CallEnd", sessionStatusModel)
videoCallResponseListener?.onCallFinished(Activity.RESULT_CANCELED, returnIntent)
dialog?.dismiss() dialog?.dismiss()
} }

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

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

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

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

@ -231,6 +231,9 @@ const GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST = "Services/DoctorApplication.svc/R
const INSERT_MEDICAL_REPORT = "Services/Patients.svc/REST/DAPP_InsertMedicalReport_New"; const INSERT_MEDICAL_REPORT = "Services/Patients.svc/REST/DAPP_InsertMedicalReport_New";
const UPDATE_MEDICAL_REPORT = "Services/Patients.svc/REST/DAPP_UpdateMedicalReport"; const UPDATE_MEDICAL_REPORT = "Services/Patients.svc/REST/DAPP_UpdateMedicalReport";
const GET_SICK_LEAVE_DOCTOR_APP = "Services/DoctorApplication.svc/REST/GetAllSickLeaves";
const ADD_PATIENT_TO_DOCTOR = "LiveCareApi/DoctorApp/AssignPatientToDoctor";
const REMOVE_PATIENT_FROM_DOCTOR = "LiveCareApi/DoctorApp/BackPatientToQueue";
var selectedPatientType = 1; var selectedPatientType = 1;
@ -283,7 +286,7 @@ const TRANSACTION_NO = 0;
const LANGUAGE_ID = 2; const LANGUAGE_ID = 2;
const STAMP = '2020-04-27T12:17:17.721Z'; const STAMP = '2020-04-27T12:17:17.721Z';
const IP_ADDRESS = '9.9.9.9'; const IP_ADDRESS = '9.9.9.9';
const VERSION_ID = 6.1; const VERSION_ID = 6.2;
const CHANNEL = 9; const CHANNEL = 9;
const SESSION_ID = 'BlUSkYymTt'; const SESSION_ID = 'BlUSkYymTt';
const IS_LOGIN_FOR_DOCTOR_APP = true; const IS_LOGIN_FOR_DOCTOR_APP = true;

@ -703,4 +703,5 @@ const Map<String, Map<String, String>> localizedValues = {
"addPrescription": {"en": "Add prescription", "ar": "إضافة الوصفات"}, "addPrescription": {"en": "Add prescription", "ar": "إضافة الوصفات"},
"edit": {"en": "Edit", "ar": "تعديل"}, "edit": {"en": "Edit", "ar": "تعديل"},
"summeryReply": {"en": "Summary Reply", "ar": "موجز الرد"}, "summeryReply": {"en": "Summary Reply", "ar": "موجز الرد"},
"finish": {"en": "Finish", "ar": "انهاء"},
}; };

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

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

@ -36,6 +36,11 @@ class SickLeavePatientModel {
String strRequestDate; String strRequestDate;
String startDate; String startDate;
String endDate; String endDate;
dynamic isExtendedLeave;
dynamic noOfDays;
dynamic patientMRN;
dynamic remarks;
dynamic status;
SickLeavePatientModel( SickLeavePatientModel(
{this.setupID, {this.setupID,
@ -72,10 +77,19 @@ class SickLeavePatientModel {
// this.speciality, // this.speciality,
this.strRequestDate, this.strRequestDate,
this.startDate, this.startDate,
this.endDate}); this.endDate,
this.isExtendedLeave,
this.noOfDays,
this.patientMRN,
this.remarks,
this.status});
SickLeavePatientModel.fromJson(Map<String, dynamic> json) { SickLeavePatientModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID']; setupID = json['SetupID'];
isExtendedLeave = json['isExtendedLeave'];
noOfDays = json['noOfDays'];
patientMRN = json['patientMRN'];
status = json['status'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
patientID = json['PatientID']; patientID = json['PatientID'];
@ -109,13 +123,17 @@ class SickLeavePatientModel {
qR = json['QR']; qR = json['QR'];
// speciality = json['Speciality'].cast<String>(); // speciality = json['Speciality'].cast<String>();
strRequestDate = json['StrRequestDate']; strRequestDate = json['StrRequestDate'];
startDate = json['StartDate']; startDate = json['StartDate'] ?? json['startDate'];
endDate = json['EndDate']; endDate = json['EndDate'];
} }
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['SetupID'] = this.setupID; data['SetupID'] = this.setupID;
data['status'] = this.status;
data['isExtendedLeave'] = this.isExtendedLeave;
data['noOfDays'] = this.noOfDays;
data['patientMRN'] = this.patientMRN;
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;
data['PatientID'] = this.patientID; data['PatientID'] = this.patientID;

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

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

@ -32,8 +32,8 @@ class VideoCallService extends BaseService {
kToken: startCallRes.openTokenID, kToken: startCallRes.openTokenID,
kSessionId: startCallRes.openSessionID, kSessionId: startCallRes.openSessionID,
kApiKey:'46209962', kApiKey:'46209962',
// kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==", // kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGUyZjgxMjFlYTFkNzU5NjcxNDY2ZTM2ZjM3YTVhNTI2NGY0NTI2NzpzZXNzaW9uX2lkPTJfTVg0ME56STBOemsxTkg1LU1UWXlOVGN5TmpnMk5qZzNOMzQ1YUhCcGRtcDFXbVpDTDFkNE1qbDRkWFY2TTA4cmIySi1mZyZjcmVhdGVfdGltZT0xNjI1NzI2ODg5Jm5vbmNlPTAuNjc2Nzc4OTQxNjA1MTMxNSZyb2xlPXB1Ymxpc2hlciZleHBpcmVfdGltZT0xNjI4MzE4ODg4JmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9",
// kSessionId: "1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg", // kSessionId: "2_MX40NzI0Nzk1NH5-MTYyNTcyNjg2Njg3N345aHBpdmp1WmZCL1d4Mjl4dXV6M08rb2J-fg",
// kApiKey:'47247954', // kApiKey:'47247954',
vcId: patient.vcId, vcId: patient.vcId,
isRecording: isRecording, isRecording: isRecording,

@ -1,7 +1,7 @@
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';
import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart'; import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart';
import 'package:doctor_app_flutter/core/model/live_care/add_patient_to_doctor_list_request_model.dart';
import 'package:doctor_app_flutter/core/model/live_care/live_care_login_reguest_model.dart'; import 'package:doctor_app_flutter/core/model/live_care/live_care_login_reguest_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/livecare/end_call_req.dart'; import 'package:doctor_app_flutter/models/livecare/end_call_req.dart';
@ -35,14 +35,12 @@ class LiveCarePatientServices extends BaseService {
StartCallRes get startCallRes => _startCallRes; StartCallRes get startCallRes => _startCallRes;
Future getPendingPatientERForDoctorApp( Future getPendingPatientERForDoctorApp(
PendingPatientERForDoctorAppRequestModel PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async {
pendingPatientERForDoctorAppRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP, GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
List<PatiantInformtion> localPatientList = [];
List<PatiantInformtion> localPatientList= [];
response['List_PendingPatientList'].forEach((v) { response['List_PendingPatientList'].forEach((v) {
localPatientList.add(PatiantInformtion.fromJson(v)); localPatientList.add(PatiantInformtion.fromJson(v));
@ -50,22 +48,19 @@ class LiveCarePatientServices extends BaseService {
/// add new items. /// add new items.
localPatientList.forEach((element) { localPatientList.forEach((element) {
if ((_patientList.singleWhere((it) => it.patientId == element.patientId, if ((_patientList.singleWhere((it) => it.patientId == element.patientId, orElse: () => null)) == null) {
orElse: () => null)) == null) {
_patientList.add(element); _patientList.add(element);
} }
}); });
/// remove items. /// remove items.
List<PatiantInformtion> removedPatientList= []; List<PatiantInformtion> removedPatientList = [];
_patientList.forEach((element) { _patientList.forEach((element) {
if ((localPatientList.singleWhere((it) => it.patientId == element.patientId, if ((localPatientList.singleWhere((it) => it.patientId == element.patientId, orElse: () => null)) == null) {
orElse: () => null)) == null) {
removedPatientList.add(element); removedPatientList.add(element);
} }
}); });
removedPatientList.forEach((element) { removedPatientList.forEach((element) {
_patientList.remove(element); _patientList.remove(element);
}); });
@ -105,11 +100,7 @@ class LiveCarePatientServices extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: { }, body: {"VC_ID": vcID, "AltServiceList": altServiceList, "generalid": GENERAL_ID}, isLiveCare: _isLive);
"VC_ID": vcID,
"AltServiceList": altServiceList,
"generalid":GENERAL_ID
}, isLiveCare: _isLive);
} }
Future transferToAdmin(int vcID, String notes) async { Future transferToAdmin(int vcID, String notes) async {
@ -128,20 +119,17 @@ class LiveCarePatientServices extends BaseService {
Future sendSMSInstruction(int vcID) async { Future sendSMSInstruction(int vcID) async {
hasError = false; hasError = false;
await baseAppClient.post(SEND_SMS_INSTRUCTIONS, await baseAppClient.post(SEND_SMS_INSTRUCTIONS, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
transferToAdminResponse = response; transferToAdminResponse = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: { }, body: {"VC_ID": vcID, "generalid": GENERAL_ID}, isLiveCare: _isLive);
"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( ); await getDoctorProfile();
isLoginRequestModel.doctorId = super.doctorProfile.doctorID; 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;
@ -155,17 +143,48 @@ class LiveCarePatientServices extends BaseService {
hasError = false; hasError = false;
alternativeServicesList.clear(); alternativeServicesList.clear();
await baseAppClient.post(GET_ALTERNATIVE_SERVICE, await baseAppClient.post(GET_ALTERNATIVE_SERVICE, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
response['AlternativeServicesList'].forEach((v) { response['AlternativeServicesList'].forEach((v) {
alternativeServicesList.add(AlternativeService.fromJson(v)); alternativeServicesList.add(AlternativeService.fromJson(v));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: { }, body: {"VC_ID": vcID, "generalid": GENERAL_ID}, isLiveCare: _isLive);
"VC_ID": vcID, }
"generalid": GENERAL_ID
}, isLiveCare: _isLive); Future addPatientToDoctorList({int vcID}) async {
hasError = false;
await getDoctorProfile();
AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel();
addPatientToDoctorListRequestModel.doctorId = super.doctorProfile.doctorID;
addPatientToDoctorListRequestModel.vCID = vcID;
addPatientToDoctorListRequestModel.isOutKsa = false;
addPatientToDoctorListRequestModel.generalid = GENERAL_ID;
await baseAppClient.post(ADD_PATIENT_TO_DOCTOR, onSuccess: (response, statusCode) async {
isLoginResponse = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: addPatientToDoctorListRequestModel.toJson(), isLiveCare: _isLive);
}
Future removePatientFromDoctorList({int vcID}) async {
hasError = false;
AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel();
await getDoctorProfile();
addPatientToDoctorListRequestModel.doctorId = super.doctorProfile.doctorID;
addPatientToDoctorListRequestModel.vCID = vcID;
addPatientToDoctorListRequestModel.isOutKsa = false;
addPatientToDoctorListRequestModel.generalid = GENERAL_ID;
await baseAppClient.post(REMOVE_PATIENT_FROM_DOCTOR, onSuccess: (response, statusCode) async {
isLoginResponse = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: addPatientToDoctorListRequestModel.toJson(), isLiveCare: _isLive);
} }
} }

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_doctor_request_model.dart';
import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_model.dart'; import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_model.dart';
import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_request_model.dart'; import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_request_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
@ -21,8 +22,7 @@ class SickLeaveService extends BaseService {
List get coveringDoctorsList => _coveringDoctors; List get coveringDoctorsList => _coveringDoctors;
List _coveringDoctors = []; List _coveringDoctors = [];
List<GetRescheduleLeavesResponse> get getAllRescheduleLeave => List<GetRescheduleLeavesResponse> get getAllRescheduleLeave => _getReScheduleLeave;
_getReScheduleLeave;
List<GetRescheduleLeavesResponse> _getReScheduleLeave = []; List<GetRescheduleLeavesResponse> _getReScheduleLeave = [];
dynamic get postReschedule => _postReschedule; dynamic get postReschedule => _postReschedule;
dynamic _postReschedule; dynamic _postReschedule;
@ -31,9 +31,11 @@ class SickLeaveService extends BaseService {
dynamic _sickLeaveResponse; dynamic _sickLeaveResponse;
List<SickLeavePatientModel> getAllSickLeavePatient = List(); List<SickLeavePatientModel> getAllSickLeavePatient = List();
List<SickLeavePatientModel> getAllSickLeaveDoctor = List();
//getAllSickLeavePatient.addAll(getAllSickLeaveDoctor);
SickLeavePatientRequestModel _sickLeavePatientRequestModel = SickLeavePatientRequestModel _sickLeavePatientRequestModel = SickLeavePatientRequestModel();
SickLeavePatientRequestModel(); GetSickLeaveDoctorRequestModel _sickLeaveDoctorRequestModel = GetSickLeaveDoctorRequestModel();
Future getStatistics(appoNo, patientMRN) async { Future getStatistics(appoNo, patientMRN) async {
hasError = false; hasError = false;
@ -56,6 +58,7 @@ class SickLeaveService extends BaseService {
// addSickLeaveRequest.appointmentNo = '2016054661'; // addSickLeaveRequest.appointmentNo = '2016054661';
// addSickLeaveRequest.patientMRN = '3120746'; // addSickLeaveRequest.patientMRN = '3120746';
hasError = false; hasError = false;
_sickLeaveResponse.clear();
await baseAppClient.post( await baseAppClient.post(
ADD_SICK_LEAVE, ADD_SICK_LEAVE,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
@ -73,8 +76,7 @@ class SickLeaveService extends BaseService {
Future extendSickLeave(GetAllSickLeaveResponse request) async { Future extendSickLeave(GetAllSickLeaveResponse request) async {
var extendSickLeaveRequest = ExtendSickLeaveRequest(); var extendSickLeaveRequest = ExtendSickLeaveRequest();
extendSickLeaveRequest.patientMRN = extendSickLeaveRequest.patientMRN = request.patientMRN.toString(); //'3120746';
request.patientMRN.toString(); //'3120746';
extendSickLeaveRequest.previousRequestNo = request.requestNo.toString(); extendSickLeaveRequest.previousRequestNo = request.requestNo.toString();
extendSickLeaveRequest.noOfDays = request.noOfDays.toString(); extendSickLeaveRequest.noOfDays = request.noOfDays.toString();
extendSickLeaveRequest.remarks = request.remarks; extendSickLeaveRequest.remarks = request.remarks;
@ -114,8 +116,8 @@ class SickLeaveService extends BaseService {
} }
Future getSickLeavePatient(patientMRN) async { Future getSickLeavePatient(patientMRN) async {
_sickLeavePatientRequestModel = SickLeavePatientRequestModel( _sickLeavePatientRequestModel =
patientID: patientMRN, patientTypeID: 2, patientType: 1); SickLeavePatientRequestModel(patientID: patientMRN, patientTypeID: 2, patientType: 1);
hasError = false; hasError = false;
getAllSickLeavePatient = []; getAllSickLeavePatient = [];
getAllSickLeavePatient.clear(); getAllSickLeavePatient.clear();
@ -136,6 +138,28 @@ class SickLeaveService extends BaseService {
); );
} }
Future getSickLeaveDoctor(patientMRN) async {
_sickLeaveDoctorRequestModel = GetSickLeaveDoctorRequestModel(patientMRN: patientMRN);
hasError = false;
getAllSickLeaveDoctor = [];
getAllSickLeaveDoctor.clear();
await baseAppClient.post(
GET_SICK_LEAVE_DOCTOR_APP,
onSuccess: (dynamic response, int statusCode) {
Future.value(response);
getAllSickLeaveDoctor.clear();
response['SickLeavesList']['entityList'].forEach((v) {
getAllSickLeaveDoctor.add(SickLeavePatientModel.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _sickLeaveDoctorRequestModel.toJson(),
);
}
Future getRescheduleLeave() async { Future getRescheduleLeave() async {
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(

@ -20,8 +20,7 @@ class LiveCarePatientViewModel extends BaseViewModel {
StartCallRes get startCallRes => _liveCarePatientServices.startCallRes; StartCallRes get startCallRes => _liveCarePatientServices.startCallRes;
List<AlternativeService> get alternativeServicesList => List<AlternativeService> get alternativeServicesList => _liveCarePatientServices.alternativeServicesList;
_liveCarePatientServices.alternativeServicesList;
DashboardService _dashboardService = locator<DashboardService>(); DashboardService _dashboardService = locator<DashboardService>();
@ -106,8 +105,7 @@ class LiveCarePatientViewModel extends BaseViewModel {
selectedServices = getSelectedAlternativeServices(); selectedServices = getSelectedAlternativeServices();
} }
await _liveCarePatientServices.endCallWithCharge( await _liveCarePatientServices.endCallWithCharge(vcID, selectedServices);
vcID, selectedServices);
if (_liveCarePatientServices.hasError) { if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error; error = _liveCarePatientServices.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -209,8 +207,7 @@ class LiveCarePatientViewModel extends BaseViewModel {
AlternativeService(serviceID: 2, serviceName: "LABORATORY"), AlternativeService(serviceID: 2, serviceName: "LABORATORY"),
); );
alternativeServicesList.add( alternativeServicesList.add(
AlternativeService( AlternativeService(serviceID: 3, serviceName: "RADIOLOGY(ULTRASOUND) For pregnant only"),
serviceID: 3, serviceName: "RADIOLOGY(ULTRASOUND) For pregnant only"),
); );
alternativeServicesList.add( alternativeServicesList.add(
AlternativeService(serviceID: 4, serviceName: "VACCINATIONS"), AlternativeService(serviceID: 4, serviceName: "VACCINATIONS"),
@ -231,25 +228,46 @@ class LiveCarePatientViewModel extends BaseViewModel {
AlternativeService(serviceID: 9, serviceName: "FAMILY MEDICIN DR"), AlternativeService(serviceID: 9, serviceName: "FAMILY MEDICIN DR"),
); );
alternativeServicesList.add( alternativeServicesList.add(
AlternativeService( AlternativeService(serviceID: 10, serviceName: "FOLYS CATHETER INSERTION"),
serviceID: 10, serviceName: "FOLYS CATHETER INSERTION"),
); );
alternativeServicesList.add( alternativeServicesList.add(
AlternativeService(serviceID: 11, serviceName: "GASTRIC TUBE CHANGE"), AlternativeService(serviceID: 11, serviceName: "GASTRIC TUBE CHANGE"),
); );
} }
updateInCallPatient({PatiantInformtion patient, appointmentNo}){ updateInCallPatient({PatiantInformtion patient, appointmentNo}) {
_liveCarePatientServices.patientList.forEach((e) {
_liveCarePatientServices.patientList.forEach((e) { if (e.patientId == patient.patientId) {
if(e.patientId == patient.patientId) { e.episodeNo = 0;
e.episodeNo = 0 ;
e.appointmentNo = appointmentNo; e.appointmentNo = appointmentNo;
return; return;
} }
}); });
setState(ViewState.Idle); setState(ViewState.Idle);
}
Future addPatientToDoctorList(int vcID) async {
await getDoctorProfile(isGetProfile: true);
setState(ViewState.BusyLocal);
await _liveCarePatientServices.addPatientToDoctorList(vcID: vcID);
if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
Future removePatientFromDoctorList(int vcID) async {
await getDoctorProfile(isGetProfile: true);
setState(ViewState.BusyLocal);
await _liveCarePatientServices.removePatientFromDoctorList(vcID: vcID);
if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
} }
} }

@ -10,13 +10,17 @@ class SickLeaveViewModel extends BaseViewModel {
SickLeaveService _sickLeaveService = locator<SickLeaveService>(); SickLeaveService _sickLeaveService = locator<SickLeaveService>();
get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics; get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics;
get getAllSIckLeave => _sickLeaveService.getAllSickLeave; get getAllSIckLeave => _sickLeaveService.getAllSickLeave;
get getAllSIckLeavePatient => _sickLeaveService.getAllSickLeavePatient; //get getAllSIckLeavePatient => _sickLeaveService.getAllSickLeavePatient;
get sickleaveResponse => _sickLeaveService.sickLeaveResponse;
List get allOffTime => _sickLeaveService.getOffTimeList; List get allOffTime => _sickLeaveService.getOffTimeList;
List get allReasons => _sickLeaveService.getReasons; List get allReasons => _sickLeaveService.getReasons;
List get coveringDoctors => _sickLeaveService.coveringDoctorsList; List get coveringDoctors => _sickLeaveService.coveringDoctorsList;
List get sickLeaveDoctor => _sickLeaveService.getAllSickLeaveDoctor;
get getReschduleLeave => _sickLeaveService.getAllRescheduleLeave; get getReschduleLeave => _sickLeaveService.getAllRescheduleLeave;
get postSechedule => _sickLeaveService.postReschedule; get postSechedule => _sickLeaveService.postReschedule;
get sickleaveResponse => _sickLeaveService.sickLeaveResponse; get getAllSIckLeavePatient =>
[..._sickLeaveService.getAllSickLeavePatient, ..._sickLeaveService.getAllSickLeaveDoctor];
Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _sickLeaveService.addSickLeave(addSickLeaveRequest); await _sickLeaveService.addSickLeave(addSickLeaveRequest);
@ -67,6 +71,16 @@ class SickLeaveViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getSickLeaveDoctor(patientMRN) async {
setState(ViewState.Busy);
await _sickLeaveService.getSickLeaveDoctor(patientMRN);
if (_sickLeaveService.hasError) {
error = _sickLeaveService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future getRescheduleLeave() async { Future getRescheduleLeave() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _sickLeaveService.getRescheduleLeave(); await _sickLeaveService.getRescheduleLeave();

@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/core/viewModel/scan_qr_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/AnalyticsService.dart';
import 'core/service/NavigationService.dart'; import 'core/service/NavigationService.dart';
import 'core/service/VideoCallService.dart'; import 'core/service/VideoCallService.dart';
import 'core/service/home/dasboard_service.dart'; import 'core/service/home/dasboard_service.dart';
@ -98,6 +99,7 @@ void setupLocator() {
locator.registerLazySingleton(() => ScanQrService()); locator.registerLazySingleton(() => ScanQrService());
locator.registerLazySingleton(() => SpecialClinicsService()); locator.registerLazySingleton(() => SpecialClinicsService());
locator.registerLazySingleton(() => VideoCallService()); locator.registerLazySingleton(() => VideoCallService());
locator.registerLazySingleton(() => AnalyticsService());
/// View Model /// View Model
locator.registerFactory(() => DoctorReplayViewModel()); locator.registerFactory(() => DoctorReplayViewModel());

@ -2,6 +2,8 @@ import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:firebase_analytics/observer.dart';
import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart';
@ -11,6 +13,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/AnalyticsService.dart';
import 'core/service/NavigationService.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';
@ -67,7 +70,10 @@ 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, navigatorKey: locator<NavigationService>().navigatorKey,
navigatorObservers:[
locator<AnalyticsService>().getAnalyticsObserver(),
],
initialRoute: INIT_ROUTE, initialRoute: INIT_ROUTE,
routes: routes, routes: routes,
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,

@ -6,15 +6,19 @@ class MySelectedAllergy {
String remark; String remark;
bool isChecked; bool isChecked;
bool isExpanded; bool isExpanded;
bool isLocal;
int createdBy; int createdBy;
bool hasValidationError;
MySelectedAllergy( MySelectedAllergy(
{this.selectedAllergySeverity, {this.selectedAllergySeverity,
this.selectedAllergy, this.selectedAllergy,
this.remark, this.remark,
this.isChecked, this.isChecked,
this.isExpanded = true, this.isExpanded = true,
this.createdBy}); this.isLocal = true,
this.createdBy,
this.hasValidationError = false});
MySelectedAllergy.fromJson(Map<String, dynamic> json) { MySelectedAllergy.fromJson(Map<String, dynamic> json) {
selectedAllergySeverity = json['selectedAllergySeverity'] != null selectedAllergySeverity = json['selectedAllergySeverity'] != null
@ -26,7 +30,9 @@ class MySelectedAllergy {
remark = json['remark']; remark = json['remark'];
isChecked = json['isChecked']; isChecked = json['isChecked'];
isExpanded = json['isExpanded']; isExpanded = json['isExpanded'];
isLocal = json['isLocal'];
createdBy = json['createdBy']; createdBy = json['createdBy'];
hasValidationError = json['hasValidationError'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -41,6 +47,8 @@ class MySelectedAllergy {
data['isChecked'] = this.isChecked; data['isChecked'] = this.isChecked;
data['isExpanded'] = this.isExpanded; data['isExpanded'] = this.isExpanded;
data['createdBy'] = this.createdBy; data['createdBy'] = this.createdBy;
data['isLocal'] = this.isLocal;
data['hasValidationError'] = this.hasValidationError;
return data; return data;
} }
} }

@ -1,22 +1,29 @@
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class MySelectedExamination { class MySelectedExamination {
MasterKeyModel selectedExamination; MasterKeyModel selectedExamination;
String remark; String remark;
bool isNormal; bool isNormal;
bool isAbnormal; bool isAbnormal;
bool notExamined; bool notExamined;
bool isNew; bool isNew;
bool isLocal;
int createdBy; int createdBy;
String createdOn;
String editedOn;
MySelectedExamination( MySelectedExamination({
{this.selectedExamination, this.selectedExamination,
this.remark, this.remark,
this.isNormal = false, this.isNormal = false,
this.isAbnormal = false, this.isAbnormal = false,
this.notExamined = true, this.notExamined = true,
this.isNew = true, this.isNew = true,
this.createdBy}); this.isLocal = true,
this.createdBy,
this.createdOn,
this.editedOn,
});
MySelectedExamination.fromJson(Map<String, dynamic> json) { MySelectedExamination.fromJson(Map<String, dynamic> json) {
selectedExamination = json['selectedExamination'] != null selectedExamination = json['selectedExamination'] != null
@ -28,6 +35,9 @@ class MySelectedExamination {
notExamined = json['notExamined']; notExamined = json['notExamined'];
isNew = json['isNew']; isNew = json['isNew'];
createdBy = json['createdBy']; createdBy = json['createdBy'];
createdOn = json['createdOn'];
editedOn = json['editedOn'];
isLocal = json['isLocal'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -42,6 +52,10 @@ class MySelectedExamination {
data['notExamined'] = this.notExamined; data['notExamined'] = this.notExamined;
data['isNew'] = this.isNew; data['isNew'] = this.isNew;
data['createdBy'] = this.createdBy; data['createdBy'] = this.createdBy;
data['createdOn'] = this.createdOn;
data['editedOn'] = this.editedOn;
data['isLocal'] = this.isLocal;
return data; return data;
} }
} }

@ -4,9 +4,10 @@ class MySelectedHistory {
MasterKeyModel selectedHistory; MasterKeyModel selectedHistory;
String remark; String remark;
bool isChecked; bool isChecked;
bool isLocal;
MySelectedHistory( MySelectedHistory(
{ this.selectedHistory, this.remark, this.isChecked}); { this.selectedHistory, this.remark, this.isChecked, this.isLocal = true});
MySelectedHistory.fromJson(Map<String, dynamic> json) { MySelectedHistory.fromJson(Map<String, dynamic> json) {
@ -15,6 +16,7 @@ class MySelectedHistory {
: null; : null;
remark = json['remark']; remark = json['remark'];
remark = json['isChecked']; remark = json['isChecked'];
isLocal = json['isLocal'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -25,6 +27,7 @@ class MySelectedHistory {
} }
data['remark'] = this.remark; data['remark'] = this.remark;
data['isChecked'] = this.remark; data['isChecked'] = this.remark;
data['isLocal'] = this.isLocal;
return data; return data;
} }
} }

@ -45,7 +45,7 @@ class VerificationMethodsScreen extends StatefulWidget {
} }
class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> { class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
ProjectViewModel projectsProvider; ProjectViewModel projectsProvider;
bool isMoreOption = false; bool isMoreOption = false;
bool onlySMSBox = false; bool onlySMSBox = false;
@ -409,13 +409,6 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
onTap: () { onTap: () {
authenticationViewModel.deleteUser(); authenticationViewModel.deleteUser();
authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED);
// Navigator.pushAndRemoveUntil(
// AppGlobal.CONTEX,
// FadePage(
// page: RootPage(),
// ),
// (r) => false);
// Navigator.of(context).pushNamed(LOGIN);
}, },
), ),
@ -548,13 +541,14 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
} }
} }
checkActivationCode({value}) async { checkActivationCode({String value}) async {
await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value); await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value);
if (authenticationViewModel.state == ViewState.ErrorLocal) { if (authenticationViewModel.state == ViewState.ErrorLocal) {
Navigator.pop(context); Navigator.pop(context);
Helpers.showErrorToast(authenticationViewModel.error); Helpers.showErrorToast(authenticationViewModel.error);
} else { } else {
await authenticationViewModel.onCheckActivationCodeSuccess(); await authenticationViewModel.onCheckActivationCodeSuccess();
if(value !=null)
Navigator.pop(context); Navigator.pop(context);
Navigator.pop(context); Navigator.pop(context);
navigateToLandingPage(); navigateToLandingPage();
@ -569,6 +563,4 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
} }
} }
} }

@ -56,7 +56,7 @@ class DoctorReplyScreen extends StatelessWidget {
DoctorReplayChat( DoctorReplayChat(
reply: reply, reply: reply,
previousModel: model, previousModel: model,
))); ), settings: RouteSettings(name: 'DoctorReplayChat'),));
}, },
child: DoctorReplyWidget(reply: reply), child: DoctorReplyWidget(reply: reply),
); );

@ -405,7 +405,8 @@ class _HomeScreenState extends State<HomeScreen> {
from: date, from: date,
to: date, to: date,
doctorID: doctorID:
authenticationViewModel.doctorProfile.doctorID)), authenticationViewModel.doctorProfile.doctorID),),
settings: RouteSettings(name: 'OutPatientsScreen'),
)); ));
}, },
)); ));
@ -422,6 +423,7 @@ class _HomeScreenState extends State<HomeScreen> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => PatientReferralScreen(), builder: (context) => PatientReferralScreen(),
settings: RouteSettings(name: 'PatientReferralScreen'),
), ),
); );
}, },
@ -439,6 +441,7 @@ class _HomeScreenState extends State<HomeScreen> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => PatientSearchScreen(), builder: (context) => PatientSearchScreen(),
settings: RouteSettings(name: 'PatientSearchScreen'),
)); ));
}, },
)); ));
@ -455,6 +458,7 @@ class _HomeScreenState extends State<HomeScreen> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => MedicineSearchScreen(), builder: (context) => MedicineSearchScreen(),
settings: RouteSettings(name: 'MedicineSearchScreen'),
)); ));
}, },
)); ));

@ -184,7 +184,8 @@ class _EndCallScreenState extends State<EndCallScreen> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (BuildContext context) => builder: (BuildContext context) =>
LivaCareTransferToAdmin(patient: patient))); LivaCareTransferToAdmin(patient: patient),
settings: RouteSettings(name: 'LivaCareTransferToAdmin'),),);
}, },
isInPatient: isInpatient, isInPatient: isInpatient,
isDartIcon: true, isDartIcon: true,

@ -194,10 +194,7 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
); );
} }
callConnected(){ callConnected() {}
} callDisconnected() {}
callDisconnected(){
}
} }

@ -149,7 +149,8 @@ class _HealthSummaryPageState extends State<HealthSummaryPage> {
episode: model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations.isNotEmpty episode: model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations.isNotEmpty
? model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations[0].episodeID.toString() ? model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations[0].episodeID.toString()
: "", : "",
vistDate: model.medicalFileList[0].entityList[0].timelines[index].date.toString())), vistDate: model.medicalFileList[0].entityList[0].timelines[index].date.toString()),
settings: RouteSettings(name: 'MedicalFileDetails'),),
); );
}, },
child: DoctorCard( child: DoctorCard(

@ -226,7 +226,7 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
["ItemID"], ["ItemID"],
url: model.pharmacyItemsList[index] url: model.pharmacyItemsList[index]
["ImageSRCUrl"]), ["ImageSRCUrl"]),
), settings: RouteSettings(name: 'PharmaciesListScreen'),),
); );
}, },
); );

@ -96,7 +96,7 @@ class _InsuranceApprovalScreenNewState extends State<InsuranceApprovalScreenNew>
patient: patient, patient: patient,
indexInsurance: index, indexInsurance: index,
patientType: patientType, patientType: patientType,
)), ),settings: RouteSettings(name: 'InsuranceApprovalsDetails'),),
); );
}, },
child: DoctorCardInsurance( child: DoctorCardInsurance(
@ -183,7 +183,7 @@ class _InsuranceApprovalScreenNewState extends State<InsuranceApprovalScreenNew>
patient: patient, patient: patient,
indexInsurance: index, indexInsurance: index,
patientType: patientType, patientType: patientType,
)), ),settings: RouteSettings(name: 'InsuranceApprovalsDetails'),),
); );
}, },
child: DoctorCardInsurance( child: DoctorCardInsurance(

@ -223,7 +223,7 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
builder: (BuildContext context) => FilterDatePage( builder: (BuildContext context) => FilterDatePage(
outPatientFilterType: outPatientFilterType, outPatientFilterType: outPatientFilterType,
patientSearchViewModel: model, patientSearchViewModel: model,
))); ),settings: RouteSettings(name: 'FilterOutPatentDateScreen'),));
}, },
), ),
onChanged: (String str) { onChanged: (String str) {

@ -208,6 +208,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
searchKey: patientFileInfoController.text, searchKey: patientFileInfoController.text,
isInpatient: false, isInpatient: false,
), ),
settings: RouteSettings(name: 'PatientsSearchResultScreen'),
), ),
); );
} }

@ -121,6 +121,7 @@ class _LabsHomePageState extends State<LabsHomePage> {
model: model, model: model,
procedureType: ProcedureType.LAB_RESULT, procedureType: ProcedureType.LAB_RESULT,
), ),
settings: RouteSettings(name: 'AddProcedureTabPage'),
), ),
); );
}, },

@ -43,7 +43,9 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
String txtOfMedicalReport; String txtOfMedicalReport;
return BaseView<PatientMedicalReportViewModel>( return BaseView<PatientMedicalReportViewModel>(
onModelReady: (model) async {}, onModelReady: (model) async {
model.getMedicalReportTemplate();
},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,

@ -89,7 +89,9 @@ class _MedicalReportPageState extends State<MedicalReportPage> {
arrivalType: arrivalType, arrivalType: arrivalType,
model: model, model: model,
status: MedicalReportStatus.ADD, status: MedicalReportStatus.ADD,
)), ),
settings: RouteSettings(name: 'AddVerifyMedicalReport'),
),
); );
}, },
@ -111,7 +113,8 @@ class _MedicalReportPageState extends State<MedicalReportPage> {
medicalReport: model.medicalReportList[index], medicalReport: model.medicalReportList[index],
model: model, model: model,
medicalNote: model.medicalReportList[index].reportDataHtml, medicalNote: model.medicalReportList[index].reportDataHtml,
)), ),
settings: RouteSettings(name: 'AddVerifyMedicalReport')),
); );
} else { } else {
Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_DETAIL, arguments: { Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_DETAIL, arguments: {

@ -114,7 +114,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
patient: patient, patient: patient,
visitType: widget.visitType, visitType: widget.visitType,
isUpdate: false, isUpdate: false,
)), ),settings: RouteSettings(name: 'UpdateNoteOrder'),),
); );
}, },
label: widget.visitType == 3 label: widget.visitType == 3
@ -236,7 +236,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
visitType: widget visitType: widget
.visitType, .visitType,
isUpdate: true, isUpdate: true,
)), ),settings: RouteSettings(name: 'UpdateNoteOrder'),),
); );
}, },
child: Container( child: Container(

@ -32,6 +32,7 @@ class PatientProfileScreen extends StatefulWidget {
class _PatientProfileScreenState extends State<PatientProfileScreen> with SingleTickerProviderStateMixin { class _PatientProfileScreenState extends State<PatientProfileScreen> with SingleTickerProviderStateMixin {
PatiantInformtion patient; PatiantInformtion patient;
LiveCarePatientViewModel _liveCareViewModel = LiveCarePatientViewModel();
bool isFromSearch = false; bool isFromSearch = false;
bool isFromLiveCare = false; bool isFromLiveCare = false;
@ -63,6 +64,9 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
void dispose() { void dispose() {
_tabController.dispose(); _tabController.dispose();
super.dispose(); super.dispose();
if (isFromLiveCare) {
_liveCareViewModel.removePatientFromDoctorList(patient.vcId);
}
} }
@override @override
@ -123,6 +127,9 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
return BaseView<LiveCarePatientViewModel>( return BaseView<LiveCarePatientViewModel>(
onModelReady: (model) async {
if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient.vcId);
},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).patientProfile, appBarTitle: TranslationBase.of(context).patientProfile,
@ -316,43 +323,35 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (BuildContext context) => builder: (BuildContext context) => EndCallScreen(patient: patient),settings: RouteSettings(name: 'EndCallScreen'),),);
EndCallScreen(patient: patient)));
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.startCall( await model.startCall(isReCall: false, vCID: patient.vcId);
isReCall: false, vCID: patient.vcId);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} else { } else {
await model.getDoctorProfile(); await model.getDoctorProfile();
patient.appointmentNo = int.parse(model patient.appointmentNo = int.parse(model.startCallRes.appointmentNo.toString());
.startCallRes.appointmentNo
.toString());
patient.episodeNo = 0; patient.episodeNo = 0;
model.updateInCallPatient( model.updateInCallPatient(
patient: patient, patient: patient,
appointmentNo: int.parse(model appointmentNo: int.parse(model.startCallRes.appointmentNo.toString()));
.startCallRes.appointmentNo
.toString()));
setState(() { setState(() {
isCallStarted = true; isCallStarted = true;
}); });
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppPermissionsUtils AppPermissionsUtils.requestVideoCallPermission(
.requestVideoCallPermission( context: context,
context: context, onTapGrant: () {
onTapGrant: () { locator<VideoCallService>().openVideo(
locator<VideoCallService>() model.startCallRes,
.openVideo( patient,
model.startCallRes, model.startCallRes != null ? model.startCallRes.isRecording : true,
patient, callConnected,
model.startCallRes != null ? model.startCallRes.isRecording : true callDisconnected);
, callConnected, });
callDisconnected);
});
} }
} }
}, },

@ -117,7 +117,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
patient: patient, patient: patient,
model: model, model: model,
procedureType: ProcedureType.RADIOLOGY, procedureType: ProcedureType.RADIOLOGY,
), ), settings: RouteSettings(name: 'AddProcedureTabPage')
), ),
); );
}, },

@ -18,6 +18,7 @@ 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/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.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:doctor_app_flutter/widgets/shared/text_fields/auto_complete_text_field.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/auto_complete_text_field.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
@ -32,6 +33,7 @@ class AddAssessmentDetails extends StatefulWidget {
addSelectedAssessment; addSelectedAssessment;
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
final bool isUpdate; final bool isUpdate;
AddAssessmentDetails( AddAssessmentDetails(
{Key key, {Key key,
this.mySelectedAssessment, this.mySelectedAssessment,
@ -129,14 +131,14 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: true,
appBar: BottomSheetTitle(
title: TranslationBase.of(context).addAssessmentDetails),
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Center( child: Center(
child: Column( child: Column(
children: [ children: [
BottomSheetTitle(
title: TranslationBase.of(context).addAssessmentDetails),
FractionallySizedBox( FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: Container( child: Container(
@ -253,6 +255,8 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
MasterKeyDailog dialog = MasterKeyDailog( MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisCondition, list: model.listOfDiagnosisCondition,
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition,
okFunction: okFunction:
(MasterKeyModel selectedValue) { (MasterKeyModel selectedValue) {
setState(() { setState(() {
@ -305,6 +309,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
MasterKeyDailog dialog = MasterKeyDailog( MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisType, list: model.listOfDiagnosisType,
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment.selectedDiagnosisType,
okFunction: okFunction:
(MasterKeyModel selectedValue) { (MasterKeyModel selectedValue) {
setState(() { setState(() {
@ -367,7 +372,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
), ),
), ),
), ),
bottomSheet: Container( bottomSheet: model.state == ViewState.Busy?Container(height: 0,):Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
@ -434,6 +439,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
{SOAPViewModel model, {SOAPViewModel model,
MySelectedAssessment mySelectedAssessment, MySelectedAssessment mySelectedAssessment,
bool isUpdate = false}) async { bool isUpdate = false}) async {
GifLoaderDialogUtils.showMyDialog(context);
if (isUpdate) { if (isUpdate) {
PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel( PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
@ -464,8 +470,9 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
await model.postAssessment(postAssessmentRequestModel); await model.postAssessment(postAssessmentRequestModel);
} }
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} else { } else {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
@ -473,10 +480,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code;
mySelectedAssessment.doctorName = doctorProfile.doctorName; mySelectedAssessment.doctorName = doctorProfile.doctorName;
widget.addSelectedAssessment(mySelectedAssessment, isUpdate);
if (!isUpdate) {
widget.addSelectedAssessment(mySelectedAssessment, isUpdate);
}
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
} }

@ -26,14 +26,12 @@ import 'add_assessment_details.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class UpdateAssessmentPage extends StatefulWidget { class UpdateAssessmentPage extends StatefulWidget {
final Function changePageViewIndex; final Function changePageViewIndex;
List<MySelectedAssessment> mySelectedAssessmentList;
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
final Function changeLoadingState; final Function changeLoadingState;
final int currentIndex; final int currentIndex;
UpdateAssessmentPage( UpdateAssessmentPage(
{Key key, {Key key,
this.changePageViewIndex, this.changePageViewIndex,
this.mySelectedAssessmentList,
this.patientInfo, this.patientInfo,
this.changeLoadingState, this.currentIndex}); this.changeLoadingState, this.currentIndex});
@ -43,19 +41,20 @@ class UpdateAssessmentPage extends StatefulWidget {
class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> { class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
bool isAssessmentExpand = false; bool isAssessmentExpand = false;
List<MySelectedAssessment> mySelectedAssessmentList = List();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
widget.mySelectedAssessmentList.clear(); mySelectedAssessmentList.clear();
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(), episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '', editedBy: '',
doctorID: '', doctorID: '',
appointmentNo: int.parse(widget.patientInfo.appointmentNo)); appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()));
await model.getPatientAssessment(getAssessmentReqModel); await model.getPatientAssessment(getAssessmentReqModel);
if (model.patientAssessmentList.isNotEmpty) { if (model.patientAssessmentList.isNotEmpty) {
if (model.listOfDiagnosisCondition.length == 0) { if (model.listOfDiagnosisCondition.length == 0) {
@ -96,7 +95,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
createdOn: element.createdOn, createdOn: element.createdOn,
icdCode10ID: element.icdCode10ID); icdCode10ID: element.icdCode10ID);
widget.mySelectedAssessmentList.add(temMySelectedAssessment); mySelectedAssessmentList.add(temMySelectedAssessment);
} }
}); });
} }
@ -147,7 +146,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
height: 20, height: 20,
), ),
Column( Column(
children: widget.mySelectedAssessmentList children: mySelectedAssessmentList
.map((assessment) { .map((assessment) {
return Container( return Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
@ -348,7 +347,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
height: 6, height: 6,
), ),
AppText( AppText(
(assessment.remark != null || (assessment.remark != null &&
assessment.remark != assessment.remark !=
'') '')
? TranslationBase.of( ? TranslationBase.of(
@ -501,14 +500,15 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
color: Colors.red[700], color: Colors.red[700],
disabled: model.state == ViewState.BusyLocal, disabled: model.state == ViewState.BusyLocal,
onPressed: () async { onPressed: () async {
if (widget.mySelectedAssessmentList.isEmpty) { if (mySelectedAssessmentList.isEmpty) {
Helpers.showErrorToast( Helpers.showErrorToast(
TranslationBase TranslationBase
.of(context) .of(context)
.assessmentErrorMsg); .assessmentErrorMsg);
} else { } else {
widget.changePageViewIndex(3);
widget.changeLoadingState(true); widget.changeLoadingState(true);
widget.changePageViewIndex(3);
} }
}, },
), ),
@ -542,11 +542,12 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
mySelectedAssessment: assessment, mySelectedAssessment: assessment,
patientInfo: widget.patientInfo, patientInfo: widget.patientInfo,
isUpdate: isUpdate, isUpdate: isUpdate,
mySelectedAssessmentList: widget.mySelectedAssessmentList, mySelectedAssessmentList: mySelectedAssessmentList,
addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, addSelectedAssessment: (MySelectedAssessment mySelectedAssessment,
bool isUpdate) async { bool isUpdate) async {
setState(() { setState(() {
widget.mySelectedAssessmentList.add(mySelectedAssessment); if(!isUpdate)
mySelectedAssessmentList.add(mySelectedAssessment);
}); });
}); });
}); });

@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.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/soap_update/shared_soap_widgets/bottom_sheet_title.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/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';
@ -31,79 +32,55 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (model.physicalExaminationList.length == 0) { if (model.physicalExaminationList.length == 0) {
await model.getMasterLookup(MasterKeysService.PhysicalExamination); await model.getMasterLookup(MasterKeysService.PhysicalExamination);
} }
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: true,
backgroundColor: Color.fromRGBO(248, 248, 248, 1), appBar: BottomSheetTitle(
body: Column( title: "${TranslationBase.of(context).addExamination}",
mainAxisAlignment: MainAxisAlignment.start, ),
children: [ backgroundColor: Color.fromRGBO(248, 248, 248, 1),
Container( body: Column(
padding: mainAxisAlignment: MainAxisAlignment.start,
EdgeInsets.only(left: 16, top: 70, right: 16, bottom: 16),
color: Colors.white,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
child: AppText( child: SingleChildScrollView(
"${TranslationBase.of(context).addExamination}",
fontSize: SizeConfig.textMultiplier * 3.3,
color: Colors.black,
fontWeight: FontWeight.w700,
),
),
InkWell(
onTap: () {
Navigator.of(context).pop();
},
child: Icon(
Icons.clear,
size: 40,
),
)
],
),
),
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
Container(
margin: EdgeInsets.all(16.0),
padding: EdgeInsets.all(0.0),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white,
borderRadius: BorderRadius.circular(12),
border: Border.fromBorderSide(BorderSide(
color: Colors.grey.shade400,
width: 0.4,
)),
),
child: Column( child: Column(
children: [ children: [
ExaminationsListSearchWidget( Container(
masterList: model.physicalExaminationList, margin: EdgeInsets.all(16.0),
isServiceSelected: (master) => padding: EdgeInsets.all(0.0),
isServiceSelected(master), decoration: BoxDecoration(
removeHistory: (history) { shape: BoxShape.rectangle,
setState(() { color: Colors.white,
widget.removeExamination(history); borderRadius: BorderRadius.circular(12),
}); border: Border.fromBorderSide(BorderSide(
}, color: Colors.grey.shade400,
addHistory: (selectedExamination) { width: 0.4,
setState(() { )),
widget.mySelectedExamination ),
.add(selectedExamination); child: Column(
children: [
ExaminationsListSearchWidget(
mySelectedExamination:
widget.mySelectedExamination,
masterList: model.physicalExaminationList,
isServiceSelected: (master) =>
isServiceSelected(master),
removeExamination: (history) {
setState(() {
widget.removeExamination(history);
}); });
}, },
addHistory: (selectedExamination) {
widget.mySelectedExamination
.add(selectedExamination);
// setState(() {});
},
), ),
], ],
), ),

@ -14,19 +14,21 @@ import 'package:provider/provider.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class AddExaminationWidget extends StatefulWidget { class AddExaminationWidget extends StatefulWidget {
MasterKeyModel item; MasterKeyModel item;
final Function(MasterKeyModel) removeHistory; final Function(MasterKeyModel) removeExamination;
final Function(MySelectedExamination) addHistory; final Function(MySelectedExamination) addExamination;
final bool Function(MasterKeyModel) isServiceSelected; final bool Function(MasterKeyModel) isServiceSelected;
bool isExpand; bool isExpand;
final Function expandClick; final Function expandClick;
final List<MySelectedExamination> mySelectedExamination;
AddExaminationWidget({ AddExaminationWidget({
this.item, this.item,
this.removeHistory, this.removeExamination,
this.addHistory, this.addExamination,
this.isServiceSelected, this.isServiceSelected,
this.isExpand, this.isExpand,
this.expandClick, this.expandClick,
this.mySelectedExamination,
}); });
@override @override
@ -40,7 +42,17 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
@override @override
void initState() { void initState() {
examination.selectedExamination = widget.item; if (getSelectedExam(widget.item) != null) {
examination = getSelectedExam(widget.item);
status = examination.isNormal
? 1
: examination.isAbnormal
? 2
: 3;
remarksController.text = examination.remark;
} else {
examination.selectedExamination = widget.item;
}
super.initState(); super.initState();
} }
@ -70,14 +82,15 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
onChanged: (newValue) { onChanged: (newValue) {
setState(() { setState(() {
if (widget.isServiceSelected(widget.item)) { if (widget.isServiceSelected(widget.item)) {
widget.removeHistory(widget.item); if (examination.isLocal)
widget.removeExamination(widget.item);
widget.expandClick(); widget.expandClick();
} else { } else {
examination.isNormal = status == 1; examination.isNormal = status == 1;
examination.isAbnormal = status == 2; examination.isAbnormal = status == 2;
examination.notExamined = status == 3; examination.notExamined = status == 3;
examination.remark = remarksController.text; examination.remark = remarksController.text;
widget.addHistory(examination); widget.addExamination(examination);
widget.expandClick(); widget.expandClick();
} }
}); });
@ -113,18 +126,18 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
Row( Row(
children: [ children: [
Expanded( Expanded(
child: Row( child: InkWell(
children: [ onTap: () {
InkWell( setState(() {
onTap: () { status = 1;
setState(() { });
status = 1; examination.isNormal = true;
}); examination.isAbnormal = false;
examination.isNormal = true; examination.notExamined = false;
examination.isAbnormal = false; },
examination.notExamined = false; child: Row(
}, children: [
child: Container( Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
margin: EdgeInsets.symmetric(horizontal: 6), margin: EdgeInsets.symmetric(horizontal: 6),
width: 20, width: 20,
@ -143,28 +156,28 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
), ),
), ),
), ),
), AppText(
AppText( TranslationBase.of(context).normal,
TranslationBase.of(context).normal, fontWeight: FontWeight.normal,
fontWeight: FontWeight.normal, fontFamily: 'Poppins',
fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier * 1.6, ),
), ],
], ),
)), )),
Expanded( Expanded(
child: Row( child: InkWell(
children: [ onTap: () {
InkWell( setState(() {
onTap: () { status = 2;
setState(() { });
status = 2; examination.isNormal = false;
}); examination.isAbnormal = true;
examination.isNormal = false; examination.notExamined = false;
examination.isAbnormal = true; },
examination.notExamined = false; child: Row(
}, children: [
child: Container( Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
margin: EdgeInsets.symmetric(horizontal: 6), margin: EdgeInsets.symmetric(horizontal: 6),
width: 20, width: 20,
@ -183,57 +196,58 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
), ),
), ),
), ),
), AppText(
AppText( TranslationBase.of(context).abnormal,
TranslationBase.of(context).abnormal, fontWeight: FontWeight.normal,
fontWeight: FontWeight.normal, fontFamily: 'Poppins',
fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6,
fontSize: SizeConfig.textMultiplier * 1.6, ),
), ],
], ),
)), )),
Expanded( if (!examination.isLocal)
Expanded(
child: InkWell(
onTap: () {
setState(() {
status = 3;
});
examination.isNormal = false;
examination.isAbnormal = false;
examination.notExamined = true;
},
child: Row( child: Row(
children: [ children: [
InkWell( Container(
onTap: () { padding: EdgeInsets.all(2.0),
setState(() { margin: EdgeInsets.symmetric(horizontal: 6),
status = 3; width: 20,
}); height: 20,
examination.isNormal = false;
examination.isAbnormal = false;
examination.notExamined = true;
},
child: Container(
padding: EdgeInsets.all(2.0),
margin: EdgeInsets.symmetric(horizontal: 6),
width: 20,
height: 20,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
border: Border.all(color: Colors.grey, width: 1),
),
child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: status == 3 color: Colors.white,
? HexColor("#D02127")
: Colors.white,
shape: BoxShape.circle, shape: BoxShape.circle,
border: Border.all(color: Colors.grey, width: 1),
),
child: Container(
decoration: BoxDecoration(
color: status == 3
? HexColor("#D02127")
: Colors.white,
shape: BoxShape.circle,
),
), ),
), ),
), Expanded(
), child: AppText(
Expanded( TranslationBase.of(context).notExamined,
child: AppText( fontWeight: FontWeight.normal,
TranslationBase.of(context).notExamined, fontFamily: 'Poppins',
fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 1.6,
fontFamily: 'Poppins', ),
fontSize: SizeConfig.textMultiplier * 1.6, ),
), ],
), ),
], )),
)),
], ],
), ),
Container( Container(
@ -256,4 +270,15 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
), ),
); );
} }
MySelectedExamination getSelectedExam(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = widget.mySelectedExamination.where(
(element) =>
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);
if (exam.length > 0) {
return exam.first;
}
return null;
}
} }

@ -40,25 +40,6 @@ class ExaminationItemCard extends StatelessWidget {
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
), ),
)), )),
Row(
children: [
AppText(
TranslationBase.of(context).remove,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
color: Colors.red.shade800,
fontSize: SizeConfig.textMultiplier * 1.8,
),
InkWell(
onTap: removeExamination,
child: Icon(
Icons.clear,
size: 20,
color: Colors.red.shade800,
),
)
],
),
], ],
), ),
AppText( AppText(
@ -79,6 +60,7 @@ class ExaminationItemCard extends StatelessWidget {
SizedBox( SizedBox(
height: 4, height: 4,
), ),
if(examination.remark.isNotEmpty)
AppText( AppText(
examination.remark, examination.remark,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,

@ -8,16 +8,17 @@ import 'package:flutter/material.dart';
import 'add_examination_widget.dart'; import 'add_examination_widget.dart';
class ExaminationsListSearchWidget extends StatefulWidget { class ExaminationsListSearchWidget extends StatefulWidget {
final Function(MasterKeyModel) removeHistory; final Function(MasterKeyModel) removeExamination;
final Function(MySelectedExamination) addHistory; final Function(MySelectedExamination) addHistory;
final bool Function(MasterKeyModel) isServiceSelected; final bool Function(MasterKeyModel) isServiceSelected;
final List<MasterKeyModel> masterList; final List<MasterKeyModel> masterList;
final List<MySelectedExamination> mySelectedExamination;
ExaminationsListSearchWidget( ExaminationsListSearchWidget(
{this.removeHistory, {this.removeExamination,
this.addHistory, this.addHistory,
this.isServiceSelected, this.isServiceSelected,
this.masterList}); this.masterList, this.mySelectedExamination});
@override @override
_ExaminationsListSearchWidgetState createState() => _ExaminationsListSearchWidgetState createState() =>
@ -61,8 +62,9 @@ class _ExaminationsListSearchWidgetState
...items.mapIndexed((index, item) { ...items.mapIndexed((index, item) {
return AddExaminationWidget( return AddExaminationWidget(
item: item, item: item,
addHistory: widget.addHistory, addExamination: widget.addHistory,
removeHistory: widget.removeHistory, removeExamination: widget.removeExamination,
mySelectedExamination: widget.mySelectedExamination,
isServiceSelected: widget.isServiceSelected, isServiceSelected: widget.isServiceSelected,
isExpand: index == expandedIndex, isExpand: index == expandedIndex,
expandClick: () { expandClick: () {

@ -28,13 +28,11 @@ class UpdateObjectivePage extends StatefulWidget {
final Function changePageViewIndex; final Function changePageViewIndex;
final Function changeLoadingState; final Function changeLoadingState;
final int currentIndex; final int currentIndex;
final List<MySelectedExamination> mySelectedExamination;
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
UpdateObjectivePage( UpdateObjectivePage(
{Key key, {Key key,
this.changePageViewIndex, this.changePageViewIndex,
this.mySelectedExamination,
this.patientInfo, this.patientInfo,
this.changeLoadingState, this.changeLoadingState,
this.currentIndex}); this.currentIndex});
@ -45,8 +43,10 @@ class UpdateObjectivePage extends StatefulWidget {
class _UpdateObjectivePageState extends State<UpdateObjectivePage> { class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
bool isSysExaminationExpand = false; bool isSysExaminationExpand = false;
List<MySelectedExamination> mySelectedExamination = List();
BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration( return BoxDecoration(
color: containerColor, color: containerColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
@ -62,11 +62,13 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
widget.mySelectedExamination.clear(); mySelectedExamination.clear();
GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel( GetPhysicalExamReqModel getPhysicalExamReqModel =
patientMRN: widget.patientInfo.patientMRN, GetPhysicalExamReqModel(
episodeID: widget.patientInfo.episodeNo.toString(), patientMRN: widget.patientInfo.patientMRN,
appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString())); episodeID: widget.patientInfo.episodeNo.toString(),
appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()));
await model.getPatientPhysicalExam(getPhysicalExamReqModel); await model.getPatientPhysicalExam(getPhysicalExamReqModel);
if (model.patientPhysicalExamList.isNotEmpty) { if (model.patientPhysicalExamList.isNotEmpty) {
@ -79,14 +81,18 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
id: element.examId, id: element.examId,
); );
MySelectedExamination tempEam = MySelectedExamination( MySelectedExamination tempEam = MySelectedExamination(
selectedExamination: examMaster, selectedExamination: examMaster,
remark: element.remarks, remark: element.remarks,
isNormal: element.isNormal, isNormal: element.isNormal,
createdBy: element.createdBy, createdBy: element.createdBy,
notExamined: element.notExamined, createdOn: element.createdOn,
isNew: element.isNew, editedOn: element.editedOn,
isAbnormal: element.isAbnormal); notExamined: element.notExamined,
widget.mySelectedExamination.add(tempEam); isNew: element.isNew,
isLocal: false,
isAbnormal: element.isAbnormal,
);
mySelectedExamination.add(tempEam);
}); });
} }
@ -102,9 +108,12 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex), SOAPStepHeader(
currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex),
ExpandableSOAPWidget( ExpandableSOAPWidget(
headerTitle: TranslationBase.of(context).physicalSystemExamination, headerTitle:
TranslationBase.of(context).physicalSystemExamination,
onTap: () { onTap: () {
setState(() { setState(() {
isSysExaminationExpand = !isSysExaminationExpand; isSysExaminationExpand = !isSysExaminationExpand;
@ -113,15 +122,17 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
child: Column( child: Column(
children: [ children: [
SOAPOpenItems( SOAPOpenItems(
label: "${TranslationBase.of(context).addExamination}", label:
"${TranslationBase.of(context).addExamination}",
onTap: () { onTap: () {
openExaminationList(context); openExaminationList(context);
}, },
), ),
Column( Column(
children: widget.mySelectedExamination.map((examination) { children: mySelectedExamination.map((examination) {
return ExaminationItemCard(examination, () { return ExaminationItemCard(examination, () {
removeExamination(examination.selectedExamination); removeExamination(
examination.selectedExamination);
}); });
}).toList(), }).toList(),
) )
@ -198,40 +209,45 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
} }
submitUpdateObjectivePage(SOAPViewModel model) async { submitUpdateObjectivePage(SOAPViewModel model) async {
if (widget.mySelectedExamination.isNotEmpty) { if (mySelectedExamination.isNotEmpty) {
widget.changeLoadingState(true);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); PostPhysicalExamRequestModel postPhysicalExamRequestModel =
widget.mySelectedExamination.forEach((exam) { new PostPhysicalExamRequestModel();
if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == null) mySelectedExamination.forEach((exam) {
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM ==
null)
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM =
[];
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add(ListHisProgNotePhysicalExaminationVM( postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM
patientMRN: widget.patientInfo.patientMRN, .add(ListHisProgNotePhysicalExaminationVM(
episodeId: widget.patientInfo.episodeNo, patientMRN: widget.patientInfo.patientMRN,
appointmentNo: widget.patientInfo.appointmentNo, episodeId: widget.patientInfo.episodeNo,
remarks: exam.remark ?? '', appointmentNo: widget.patientInfo.appointmentNo,
createdBy: exam.createdBy ?? doctorProfile.doctorID, remarks: exam.remark ?? '',
createdOn: DateTime.now().toIso8601String(), createdBy: exam.createdBy ?? doctorProfile.doctorID,
editedBy: doctorProfile.doctorID, createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
editedOn: DateTime.now().toIso8601String(), editedBy: doctorProfile.doctorID,
examId: exam.selectedExamination.id, editedOn: DateTime.now().toIso8601String(),
examType: exam.selectedExamination.typeId, examId: exam.selectedExamination.id,
isAbnormal: exam.isAbnormal, examType: exam.selectedExamination.typeId,
isNormal: exam.isNormal, isAbnormal: exam.isAbnormal,
notExamined: exam.notExamined, isNormal: exam.isNormal,
examinationType: exam.isNormal notExamined: exam.notExamined,
? 1 examinationType: exam.isNormal
: exam.isAbnormal ? 1
? 2 : exam.isAbnormal
: 3, ? 2
examinationTypeName: exam.isNormal : 3,
? "Normal" examinationTypeName: exam.isNormal
: exam.isAbnormal ? "Normal"
? 'AbNormal' : exam.isAbnormal
: "Not Examined", ? 'AbNormal'
isNew: exam.isNew)); : "Not Examined",
isNew: exam.isNew));
}); });
if (model.patientPhysicalExamList.isEmpty) { if (model.patientPhysicalExamList.isEmpty) {
@ -241,10 +257,10 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
} }
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
widget.changeLoadingState(false);
Helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} else { } else {
widget.changeLoadingState(true); widget.changeLoadingState(true);
widget.changePageViewIndex(2); widget.changePageViewIndex(2);
} }
} else { } else {
@ -253,12 +269,14 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
} }
removeExamination(MasterKeyModel masterKey) { removeExamination(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> history = widget.mySelectedExamination.where((element) => Iterable<MySelectedExamination> history = mySelectedExamination.where(
masterKey.id == element.selectedExamination.id && masterKey.typeId == element.selectedExamination.typeId); (element) =>
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);
if (history.length > 0) if (history.length > 0)
setState(() { setState(() {
widget.mySelectedExamination.remove(history.first); mySelectedExamination.remove(history.first);
}); });
} }
@ -267,7 +285,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
context, context,
FadePage( FadePage(
page: AddExaminationPage( page: AddExaminationPage(
mySelectedExamination: widget.mySelectedExamination, mySelectedExamination: mySelectedExamination,
addSelectedExamination: () { addSelectedExamination: () {
setState(() { setState(() {
Navigator.of(context).pop(); Navigator.of(context).pop();
@ -276,21 +294,6 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
removeExamination: (masterKey) => removeExamination(masterKey)), removeExamination: (masterKey) => removeExamination(masterKey)),
), ),
); );
/*showModalBottomSheet(
backgroundColor: Colors.white,
isScrollControlled: true,
context: context,
builder: (context) {
return AddExaminationDailog(
mySelectedExamination: widget.mySelectedExamination,
addSelectedExamination: () {
setState(() {
Navigator.of(context).pop();
});
},
removeExamination: (masterKey) => removeExamination(masterKey),
);
});*/
} }
} }
@ -299,7 +302,11 @@ class AddExaminationDailog extends StatefulWidget {
final Function addSelectedExamination; final Function addSelectedExamination;
final Function(MasterKeyModel) removeExamination; final Function(MasterKeyModel) removeExamination;
const AddExaminationDailog({Key key, this.mySelectedExamination, this.addSelectedExamination, this.removeExamination}) const AddExaminationDailog(
{Key key,
this.mySelectedExamination,
this.addSelectedExamination,
this.removeExamination})
: super(key: key); : super(key: key);
@override @override
@ -314,7 +321,8 @@ class _AddExaminationDailogState extends State<AddExaminationDailog> {
child: BaseView<SOAPViewModel>( child: BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (model.physicalExaminationList.length == 0) { if (model.physicalExaminationList.length == 0) {
await model.getMasterLookup(MasterKeysService.PhysicalExamination); await model
.getMasterLookup(MasterKeysService.PhysicalExamination);
} }
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -324,19 +332,21 @@ class _AddExaminationDailogState extends State<AddExaminationDailog> {
child: Container( child: Container(
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ child: Column(
SizedBox( crossAxisAlignment: CrossAxisAlignment.start,
height: 16, children: [
), SizedBox(
AppText( height: 16,
TranslationBase.of(context).physicalSystemExamination, ),
fontWeight: FontWeight.bold, AppText(
fontSize: 16, TranslationBase.of(context).physicalSystemExamination,
), fontWeight: FontWeight.bold,
SizedBox( fontSize: 16,
height: 16, ),
), SizedBox(
]), height: 16,
),
]),
))), ))),
)), )),
); );

@ -27,14 +27,12 @@ class UpdatePlanPage extends StatefulWidget {
final Function changeLoadingState; final Function changeLoadingState;
final int currentIndex; final int currentIndex;
GetPatientProgressNoteResModel patientProgressNote;
UpdatePlanPage( UpdatePlanPage(
{Key key, {Key key,
this.changePageViewIndex, this.changePageViewIndex,
this.patientInfo, this.patientInfo,
this.changeLoadingState, this.changeLoadingState,
this.patientProgressNote,
this.currentIndex}); this.currentIndex});
@override @override
@ -44,10 +42,14 @@ class UpdatePlanPage extends StatefulWidget {
class _UpdatePlanPageState extends State<UpdatePlanPage> { class _UpdatePlanPageState extends State<UpdatePlanPage> {
bool isAddProgress = true; bool isAddProgress = true;
bool isProgressExpanded = true; bool isProgressExpanded = true;
GetPatientProgressNoteResModel patientProgressNote =
GetPatientProgressNoteResModel();
TextEditingController progressNoteController = TextEditingController(text: null); TextEditingController progressNoteController =
TextEditingController(text: null);
BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration( return BoxDecoration(
color: containerColor, color: containerColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
@ -62,32 +64,74 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
if (widget.patientProgressNote.planNote != null) { if (patientProgressNote.planNote != null) {
setState(() { setState(() {
isAddProgress = false; isAddProgress = false;
}); });
} }
} }
getPatientProgressNote(model, {bool isAddProgress = false}) async {
GetGetProgressNoteReqModel getGetProgressNoteReqModel =
GetGetProgressNoteReqModel(
appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '');
await model.getPatientProgressNote(getGetProgressNoteReqModel);
if (model.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString(
model.patientProgressNoteList[0].planNote);
patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName =
model.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn =
model.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn =
model.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName =
model.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo =
model.patientProgressNoteList[0].appointmentNo;
setState(() {
isAddProgress = isAddProgress;
});
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
GetGetProgressNoteReqModel getGetProgressNoteReqModel = GetGetProgressNoteReqModel( GetGetProgressNoteReqModel getGetProgressNoteReqModel =
appointmentNo: int.parse(widget.patientInfo.appointmentNo), GetGetProgressNoteReqModel(
patientMRN: widget.patientInfo.patientMRN, appointmentNo:
episodeID: widget.patientInfo.episodeNo.toString(), int.parse(widget.patientInfo.appointmentNo.toString()),
editedBy: '', patientMRN: widget.patientInfo.patientMRN,
doctorID: ''); episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '');
await model.getPatientProgressNote(getGetProgressNoteReqModel); await model.getPatientProgressNote(getGetProgressNoteReqModel);
if (model.patientProgressNoteList.isNotEmpty) { if (model.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString(model.patientProgressNoteList[0].planNote); progressNoteController.text = Helpers.parseHtmlString(
widget.patientProgressNote.planNote = progressNoteController.text; model.patientProgressNoteList[0].planNote);
widget.patientProgressNote.createdByName = model.patientProgressNoteList[0].createdByName; patientProgressNote.planNote = progressNoteController.text;
widget.patientProgressNote.createdOn = model.patientProgressNoteList[0].createdOn; patientProgressNote.createdByName =
widget.patientProgressNote.editedOn = model.patientProgressNoteList[0].editedOn; model.patientProgressNoteList[0].createdByName;
widget.patientProgressNote.editedByName = model.patientProgressNoteList[0].editedByName; patientProgressNote.createdOn =
model.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn =
model.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName =
model.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo =
model.patientProgressNoteList[0].appointmentNo;
setState(() { setState(() {
isAddProgress = false; isAddProgress = false;
}); });
@ -104,7 +148,9 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
widthFactor: 0.90, widthFactor: 0.90,
child: Column( child: Column(
children: [ children: [
SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex), SOAPStepHeader(
currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -123,33 +169,41 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
children: [ children: [
if (isAddProgress) if (isAddProgress)
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), margin: EdgeInsets.only(
left: 10, right: 10, top: 15),
child: AppTextFieldCustom( child: AppTextFieldCustom(
hintText: TranslationBase.of(context).progressNote, hintText: TranslationBase.of(context)
.progressNote,
controller: progressNoteController, controller: progressNoteController,
minLines: 2, minLines: 2,
maxLines: 4, maxLines: 4,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
onChanged: (value) { onChanged: (value) {
widget.patientProgressNote.planNote = value; setState(() {
patientProgressNote.planNote = value;
});
}, },
), ),
), ),
SizedBox( SizedBox(
height: 9, height: 9,
), ),
if (widget.patientProgressNote.planNote != null && !isAddProgress) if (patientProgressNote.planNote != null &&
!isAddProgress)
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 5, left: 5,
right: 5, right: 5,
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.start, MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Row( Row(
children: [ children: [
@ -158,40 +212,61 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
fontSize: 12, fontSize: 12,
), ),
AppText( AppText(
widget.patientProgressNote.appointmentNo ?? '', patientProgressNote
.appointmentNo !=
null
? patientProgressNote
.appointmentNo
.toString()
: '',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14,
), ),
], ],
), ),
AppText( AppText(
widget.patientProgressNote.createdOn != null patientProgressNote.createdOn !=
? AppDateUtils.getDayMonthYearDateFormatted( null
DateTime.parse(widget.patientProgressNote.createdOn)) ? AppDateUtils
: AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), .getDayMonthYearDateFormatted(
DateTime.parse(
patientProgressNote
.createdOn))
: AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
) )
], ],
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.start, MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Row( // Row(
children: [ // children: [
AppText( // AppText(
'Condition: ', // 'Condition: ',
fontSize: 12, // fontSize: 12,
), // ),
AppText(widget.patientProgressNote.mName ?? '', // AppText(
fontWeight: FontWeight.w600), // patientProgressNote.mName ??
], // '',
), // fontWeight: FontWeight.w600),
// ],
// ),
AppText( AppText(
widget.patientProgressNote.createdOn != null patientProgressNote.createdOn !=
null
? AppDateUtils.getHour( ? AppDateUtils.getHour(
DateTime.parse(widget.patientProgressNote.createdOn)) DateTime.parse(
: AppDateUtils.getHour(DateTime.now()), patientProgressNote
.createdOn))
: AppDateUtils.getHour(
DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
) )
@ -201,7 +276,8 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
height: 8, height: 8,
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
@ -213,7 +289,6 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
onTap: () { onTap: () {
setState(() { setState(() {
isAddProgress = true; isAddProgress = true;
widget.changePageViewIndex(3, isChangeState: false);
}); });
}, },
child: Icon( child: Icon(
@ -274,30 +349,23 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
), ),
Expanded( Expanded(
child: AppButton( child: AppButton(
title: TranslationBase.of(context).next, title: isAddProgress
? TranslationBase.of(context).next
: TranslationBase.of(context).finish,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.red[700], color: Colors.red[700],
loading: model.state == ViewState.BusyLocal,
disabled: progressNoteController.text.isEmpty, disabled: progressNoteController.text.isEmpty,
onPressed: () async { onPressed: () async {
if (progressNoteController.text.isNotEmpty) { if (progressNoteController.text.isNotEmpty) {
if (isAddProgress) { if (isAddProgress) {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
setState(() {
widget.patientProgressNote.createdByName =
widget.patientProgressNote.createdByName ?? doctorProfile.doctorName;
widget.patientProgressNote.editedByName = doctorProfile.doctorName;
widget.patientProgressNote.createdOn = DateTime.now().toString();
widget.patientProgressNote.planNote = progressNoteController.text;
isAddProgress = !isAddProgress;
});
submitPlan(model); submitPlan(model);
} else { } else {
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
} else { } else {
Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); Helpers.showErrorToast(
TranslationBase.of(context)
.progressNoteErrorMsg);
} }
}, },
), ),
@ -318,19 +386,20 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
submitPlan(SOAPViewModel model) async { submitPlan(SOAPViewModel model) async {
if (progressNoteController.text.isNotEmpty) { if (progressNoteController.text.isNotEmpty) {
PostProgressNoteRequestModel postProgressNoteRequestModel = new PostProgressNoteRequestModel( widget.changeLoadingState(true);
patientMRN: widget.patientInfo.patientMRN, PostProgressNoteRequestModel postProgressNoteRequestModel =
episodeId: widget.patientInfo.episodeNo, new PostProgressNoteRequestModel(
appointmentNo: widget.patientInfo.appointmentNo, patientMRN: widget.patientInfo.patientMRN,
planNote: widget.patientProgressNote.planNote, episodeId: widget.patientInfo.episodeNo,
doctorID: '', appointmentNo: widget.patientInfo.appointmentNo,
editedBy: ''); planNote: patientProgressNote.planNote,
doctorID: '',
editedBy: '');
if (model.patientProgressNoteList.isEmpty) { if (model.patientProgressNoteList.isEmpty) {
await model.postProgressNote(postProgressNoteRequestModel); await model.postProgressNote(postProgressNoteRequestModel);
} else { } else {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
postProgressNoteRequestModel.editedBy = doctorProfile.doctorID; postProgressNoteRequestModel.editedBy = doctorProfile.doctorID;
await model.patchProgressNote(postProgressNoteRequestModel); await model.patchProgressNote(postProgressNoteRequestModel);
@ -339,8 +408,37 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} else { } else {
widget.changePageViewIndex(4, isChangeState: false);
GetGetProgressNoteReqModel getGetProgressNoteReqModel =
GetGetProgressNoteReqModel(
appointmentNo:
int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '');
await model.getPatientProgressNote(getGetProgressNoteReqModel);
if (model.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString(
model.patientProgressNoteList[0].planNote);
patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName =
model.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn =
model.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn =
model.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName =
model.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo =
model.patientProgressNoteList[0].appointmentNo;
setState(() {
isAddProgress = false;
});
}
} }
widget.changeLoadingState(false);
} else { } else {
Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg);
} }

@ -1,7 +1,7 @@
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class BottomSheetTitle extends StatelessWidget { class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget {
const BottomSheetTitle({ const BottomSheetTitle({
Key key, this.title, Key key, this.title,
}) : super(key: key); }) : super(key: key);
@ -57,4 +57,7 @@ class BottomSheetTitle extends StatelessWidget {
), ),
); );
} }
@override
Size get preferredSize => Size(double.maxFinite,115);
} }

@ -247,6 +247,8 @@ class StepsWidget extends StatelessWidget {
"Plan", "Plan",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
textAlign: TextAlign.end,
marginLeft: 25,
), ),
StatusLabel( StatusLabel(
selectedStepId: index, selectedStepId: index,
@ -530,20 +532,22 @@ class StatusLabel extends StatelessWidget {
), ),
border: Border.all(color: HexColor('#707070'), width: 0.30), border: Border.all(color: HexColor('#707070'), width: 0.30),
), ),
child: AppText( child: Center(
stepId == selectedStepId child: AppText(
? "inProgress" stepId == selectedStepId
: stepId < selectedStepId ? "inProgress"
? "Completed" : stepId < selectedStepId
: " Locked ", ? "Completed"
fontWeight: FontWeight.bold, : "Locked",
textAlign: TextAlign.center, fontWeight: FontWeight.bold,
fontSize: 10, textAlign: TextAlign.center,
color: stepId == selectedStepId fontSize: 10,
? Color(0xFFCC9B14) color: stepId == selectedStepId
: stepId < selectedStepId ? Color(0xFFCC9B14)
? Color(0xFF359846) : stepId < selectedStepId
: Color(0xFF969696), ? Color(0xFF359846)
: Color(0xFF969696),
),
), ),
); );
} }

@ -1,5 +1,6 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart';
@ -8,12 +9,12 @@ import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_allergies_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import '../../shared_soap_widgets/bottom_sheet_title.dart'; import '../../shared_soap_widgets/bottom_sheet_title.dart';
import 'master_key_checkbox_search_allergies_widget.dart';
class AddAllergies extends StatefulWidget { class AddAllergies extends StatefulWidget {
final Function addAllergiesFun; final Function addAllergiesFun;
@ -83,95 +84,107 @@ class _AddAllergiesState extends State<AddAllergies> {
} }
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: true,
body: Center( appBar: BottomSheetTitle(
child: Container( title: TranslationBase.of(context).addAllergies,
child: Column( ),
crossAxisAlignment: CrossAxisAlignment.start, body: Center(
children: [ child: Container(
BottomSheetTitle( child: Column(
title: TranslationBase.of(context).addAllergies, crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 10,
),
SizedBox(
height: 16,
),
Expanded(
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Center(
child: NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchAllergiesWidget(
model: model,
masterList: model.allergiesList,
removeAllergy: (master) {
setState(() {
removeAllergyFromLocalList(master);
});
},
addAllergy:
(MySelectedAllergy mySelectedAllergy) {
addAllergyLocally(mySelectedAllergy);
},
addSelectedAllergy: () {
setState(() {
widget
.addAllergiesFun(myAllergiesListLocal);
});
},
isServiceSelected: (master) =>
isServiceSelected(master),
getServiceSelectedAllergy: (master) =>
getSelectedAllergy(master),
),
),
),
),
), ),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.11,
),
]),
),
),
bottomSheet: model.state == ViewState.Busy
? Container(
height: 0,
)
: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
),
border: Border.all(color: HexColor('#707070'), width: 0),
),
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox( SizedBox(
height: 10, height: 10,
), ),
SizedBox( Container(
height: 16, child: FractionallySizedBox(
), widthFactor: .80,
Expanded( child: Center(
child: Center( child: AppButton(
child: FractionallySizedBox( title: TranslationBase.of(context).addAllergies,
widthFactor: 0.9, padding: 10,
child: Center( color: Color(0xFF359846),
child: NetworkBaseView( onPressed: () {
baseViewModel: model, setState(() {
child: MasterKeyCheckboxSearchAllergiesWidget( widget.addAllergiesFun(myAllergiesListLocal);
model: model, });
masterList: model.allergiesList, },
removeAllergy: (master) {
setState(() {
removeAllergyFromLocalList(master);
});
},
addAllergy:
(MySelectedAllergy mySelectedAllergy) {
addAllergyLocally(mySelectedAllergy);
},
addSelectedAllergy: () => widget
.addAllergiesFun(myAllergiesListLocal),
isServiceSelected: (master) =>
isServiceSelected(master),
getServiceSelectedAllergy: (master) =>
getSelectedAllergy(master),
),
),
), ),
), ),
), ),
), ),
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * 0.11, height: 5,
), ),
]), ],
),
),bottomSheet: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
),
border: Border.all(color: HexColor('#707070'), width: 0),
),
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
title:
TranslationBase.of(context).addAllergies,
padding: 10,
color: Color(0xFF359846),
onPressed: () {
widget.addAllergiesFun(myAllergiesListLocal);
},
),
), ),
), ),
), ),
SizedBox(
height: 5,
),
],
),
),),
), ),
); );
} }
@ -207,17 +220,15 @@ class _AddAllergiesState extends State<AddAllergies> {
addAllergyLocally(MySelectedAllergy mySelectedAllergy) { addAllergyLocally(MySelectedAllergy mySelectedAllergy) {
if (mySelectedAllergy.selectedAllergy == null) { if (mySelectedAllergy.selectedAllergy == null) {
Helpers.showErrorToast(TranslationBase Helpers.showErrorToast(TranslationBase.of(context).requiredMsg);
.of(context)
.requiredMsg);
} else { } else {
setState(() { setState(() {
List<MySelectedAllergy> allergy = List<MySelectedAllergy> allergy =
// ignore: missing_return // ignore: missing_return
myAllergiesListLocal myAllergiesListLocal
.where((element) => .where((element) =>
mySelectedAllergy.selectedAllergy.id == mySelectedAllergy.selectedAllergy.id ==
element.selectedAllergy.id) element.selectedAllergy.id)
.toList(); .toList();
if (allergy.isEmpty) { if (allergy.isEmpty) {

@ -0,0 +1,197 @@
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class AddAllergiesItem extends StatefulWidget {
final SOAPViewModel model;
final Function(MasterKeyModel) removeAllergy;
final Function(MySelectedAllergy mySelectedAllergy) addAllergy;
final bool Function(MasterKeyModel) isServiceSelected;
final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy;
final MasterKeyModel item;
const AddAllergiesItem(
{Key key,
this.model,
this.removeAllergy,
this.addAllergy,
this.isServiceSelected,
this.getServiceSelectedAllergy,
this.item})
: super(key: key);
@override
_AddAllergiesItemState createState() => _AddAllergiesItemState();
}
class _AddAllergiesItemState extends State<AddAllergiesItem> {
MasterKeyModel _selectedAllergySeverity;
bool isSubmitted = false;
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
bool isSelected = widget.isServiceSelected(widget.item);
MySelectedAllergy mySelectedAllergy;
if (isSelected) {
mySelectedAllergy = widget.getServiceSelectedAllergy(widget.item);
}
TextEditingController remarkController = TextEditingController(
text: isSelected ? mySelectedAllergy.remark : null);
TextEditingController severityController = TextEditingController(
text: isSelected
? mySelectedAllergy.selectedAllergySeverity != null
? projectViewModel.isArabic
? mySelectedAllergy.selectedAllergySeverity.nameAr
: mySelectedAllergy.selectedAllergySeverity.nameEn
: null
: null);
return HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Checkbox(
value: widget.isServiceSelected(widget.item),
activeColor: Colors.red[800],
onChanged: (bool newValue) {
onTapItem();
}),
InkWell(
onTap:onTapItem,
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 10, vertical: 0),
child: Container(
child: AppText(
projectViewModel.isArabic
? widget.item.nameAr != ""
? widget.item.nameAr
: widget.item.nameEn
: widget.item.nameEn,
color: Color(0xFF575757),
fontSize: 16,
fontWeight: FontWeight.w600,
),
width: MediaQuery.of(context).size.width * 0.55,
),
),
),
],
),
InkWell(
onTap: () {
if (mySelectedAllergy != null) {
setState(() {
mySelectedAllergy.isExpanded =
mySelectedAllergy.isExpanded ? false : true;
});
}
},
child: Icon((mySelectedAllergy != null
? mySelectedAllergy.isExpanded
: false)
? EvaIcons.arrowIosUpwardOutline
: EvaIcons.arrowIosDownwardOutline))
],
),
bodyWidget: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Center(
child: Column(
children: [
AppTextFieldCustom(
onClick: widget.model.allergySeverityList != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: widget.model.allergySeverityList,
selectedValue:
mySelectedAllergy.selectedAllergySeverity,
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
mySelectedAllergy.selectedAllergySeverity =
selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
isTextFieldHasSuffix: true,
hintText: TranslationBase.of(context).selectSeverity,
enabled: false,
maxLines: 2,
minLines: 2,
validationError: mySelectedAllergy != null &&
mySelectedAllergy.selectedAllergySeverity == null &&
mySelectedAllergy.hasValidationError
? TranslationBase.of(context).emptyMessage
: null,
controller: severityController,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).remarks,
controller: remarkController,
maxLines: 25,
minLines: 3,
hasBorder: true,
onChanged: (value){
mySelectedAllergy.remark = value;
},
inputType: TextInputType.multiline,
),
SizedBox(
height: 10,
),
],
),
),
),
),
isExpand:
mySelectedAllergy != null ? mySelectedAllergy.isExpanded : false,
);
}
onTapItem(){
setState(() {
if (widget.isServiceSelected(widget.item)) {
widget.removeAllergy(widget.item);
} else {
MySelectedAllergy mySelectedAllergy =
new MySelectedAllergy(
selectedAllergy: widget.item,
selectedAllergySeverity: _selectedAllergySeverity,
remark: null,
isChecked: true,
isExpanded: true);
widget.addAllergy(mySelectedAllergy);
}
});
}
}

@ -0,0 +1,148 @@
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'allergies_item.dart';
class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget {
final SOAPViewModel model;
final Function() addSelectedAllergy;
final Function(MasterKeyModel) removeAllergy;
final Function(MySelectedAllergy mySelectedAllergy) addAllergy;
final bool Function(MasterKeyModel) isServiceSelected;
final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy;
final List<MasterKeyModel> masterList;
final String buttonName;
final String hintSearchText;
MasterKeyCheckboxSearchAllergiesWidget(
{Key key,
this.model,
this.addSelectedAllergy,
this.removeAllergy,
this.masterList,
this.addAllergy,
this.isServiceSelected,
this.buttonName,
this.hintSearchText,
this.getServiceSelectedAllergy})
: super(key: key);
@override
_MasterKeyCheckboxSearchAllergiesWidgetState createState() =>
_MasterKeyCheckboxSearchAllergiesWidgetState();
}
class _MasterKeyCheckboxSearchAllergiesWidgetState
extends State<MasterKeyCheckboxSearchAllergiesWidget> {
List<MasterKeyModel> items = List();
@override
void initState() {
items.addAll(widget.masterList);
super.initState();
}
@override
Widget build(BuildContext context) {
return Container(
child: Column(
children: [
Expanded(
child: Container(
height: MediaQuery.of(context).size.height * 0.70,
child: Center(
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
children: [
AppTextFieldCustom(
// height:
// MediaQuery.of(context).size.height * 0.070,
hintText:
TranslationBase.of(context).selectAllergy,
isTextFieldHasSuffix: true,
hasBorder: false,
// controller: filteredSearchController,
onChanged: (value) {
filterSearchResults(value);
},
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Colors.black,
)),
),
DividerWithSpacesAround(),
SizedBox(
height: 10,
),
Expanded(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Container(
height:
MediaQuery.of(context).size.height * 0.60,
child: ListView.builder(
itemCount: items.length,
itemBuilder: (context, index) {
return AddAllergiesItem(
item:items[index],
model: widget.model,
removeAllergy: widget.removeAllergy,
addAllergy:widget.addAllergy,
isServiceSelected: widget.isServiceSelected,
getServiceSelectedAllergy: widget.getServiceSelectedAllergy,
);
},
),
),
),
),
],
))),
),
),
SizedBox(
height: 10,
),
],
),
);
}
void filterSearchResults(String query) {
List<MasterKeyModel> dummySearchList = List();
dummySearchList.addAll(widget.masterList);
if (query.isNotEmpty) {
List<MasterKeyModel> dummyListData = List();
dummySearchList.forEach((items) {
if (items.nameAr.toLowerCase().contains(query.toLowerCase()) ||
items.nameEn.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(items);
}
});
setState(() {
items.clear();
items.addAll(dummyListData);
});
return;
} else {
setState(() {
items.clear();
items.addAll(widget.masterList);
});
}
}
}

@ -34,10 +34,8 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
return Column( return Column(
children: [ children: [
SOAPOpenItems(label: "${TranslationBase.of(context).addAllergies}",onTap: () { SOAPOpenItems(label: "${TranslationBase.of(context).addAllergies}",onTap: () {
openAllergiesList(context, changeAllState); openAllergiesList(context, changeAllState, removeAllergy);
},), },),
SizedBox( SizedBox(
height: 20, height: 20,
@ -153,16 +151,18 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
).toList(); ).toList();
if (allergy.length > 0) { if (allergy.length > 0) {
if(allergy.first.isLocal) {
setState(() {
widget.myAllergiesList.remove(allergy.first);
});
}
setState(() { setState(() {
allergy[0].isChecked = false; allergy[0].isChecked = false;
}); });
} }
print(allergy);
} }
openAllergiesList(BuildContext context, Function changeParentState) { openAllergiesList(BuildContext context, Function changeParentState, removeAllergy) {
showModalBottomSheet( showModalBottomSheet(
backgroundColor: Colors.white, backgroundColor: Colors.white,
isScrollControlled: true, isScrollControlled: true,
@ -175,15 +175,29 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
bool isAllDataFilled = true; bool isAllDataFilled = true;
mySelectedAllergy.forEach((element) { mySelectedAllergy.forEach((element) {
if (element.selectedAllergySeverity == null) { if (element.selectedAllergySeverity == null) {
element.hasValidationError = true;
isAllDataFilled = false; isAllDataFilled = false;
} }
}); });
if (isAllDataFilled) { if (isAllDataFilled) {
mySelectedAllergy.forEach((element) { mySelectedAllergy.forEach((element) {
if (!widget.myAllergiesList.contains(element.selectedAllergySeverity.id)) { if ((widget.myAllergiesList.singleWhere((it) => it.selectedAllergy.id == element.selectedAllergy.id,
orElse: () => null)) == null) {
widget.myAllergiesList.add(element); widget.myAllergiesList.add(element);
} }
}); });
/// remove items.
List<MySelectedAllergy> removedList= [];
widget.myAllergiesList.forEach((element) {
if ((mySelectedAllergy.singleWhere((it) => it.selectedAllergy.id == element.selectedAllergy.id,
orElse: () => null)) == null) {
removedList.add(element);
}});
removedList.forEach((element) {
removeAllergy(element);
});
changeParentState(); changeParentState();
Navigator.of(context).pop(); Navigator.of(context).pop();
} else { } else {

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart';
@ -19,10 +20,15 @@ class AddHistoryDialog extends StatefulWidget {
final PageController controller; final PageController controller;
final List<MySelectedHistory> myHistoryList; final List<MySelectedHistory> myHistoryList;
final Function addSelectedHistories; final Function addSelectedHistories;
final Function (MasterKeyModel) removeHistory; final Function(MasterKeyModel) removeHistory;
const AddHistoryDialog( const AddHistoryDialog(
{Key key, this.changePageViewIndex, this.controller, this.myHistoryList, this.addSelectedHistories, this.removeHistory}) {Key key,
this.changePageViewIndex,
this.controller,
this.myHistoryList,
this.addSelectedHistories,
this.removeHistory})
: super(key: key); : super(key: key);
@override @override
@ -51,96 +57,96 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: true,
appBar: BottomSheetTitle(
title: TranslationBase.of(context).addHistory),
body: Center( body: Center(
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
BottomSheetTitle(title:TranslationBase.of(context).addHistory), SizedBox(
SizedBox( height: 10,
height: 10, ),
), PriorityBar(onTap: (activePriority) async {
PriorityBar(onTap: (activePriority) async { widget.changePageViewIndex(activePriority);
widget.changePageViewIndex(activePriority); }),
}), SizedBox(
SizedBox( height: 20,
height: 20, ),
), Expanded(
Expanded( child: FractionallySizedBox(
child: FractionallySizedBox( widthFactor: 0.9,
widthFactor: 0.9, child: PageView(
child: PageView( physics: NeverScrollableScrollPhysics(),
physics: NeverScrollableScrollPhysics(), controller: widget.controller,
controller: widget.controller, onPageChanged: (index) {
onPageChanged: (index) { setState(() {});
setState(() { },
}); scrollDirection: Axis.horizontal,
}, children: <Widget>[
scrollDirection: Axis.horizontal, NetworkBaseView(
children: <Widget>[ baseViewModel: model,
NetworkBaseView( child: MasterKeyCheckboxSearchWidget(
baseViewModel: model, model: model,
child: MasterKeyCheckboxSearchWidget( masterList: model.historyFamilyList,
model: model, removeHistory: (history) {
masterList: model.historyFamilyList, setState(() {
removeHistory: (history){ widget.removeHistory(history);
setState(() { });
widget.removeHistory(history); },
}); addHistory: (history) {
}, setState(() {
addHistory: (history){ createAndAddHistory(history);
setState(() { });
createAndAddHistory( },
history); addSelectedHistories: () {
}); widget.addSelectedHistories();
}, },
addSelectedHistories: (){ isServiceSelected: (master) =>
widget.addSelectedHistories(); isServiceSelected(master),
}, ),
isServiceSelected: (master) =>isServiceSelected(master), ),
), NetworkBaseView(
), baseViewModel: model,
NetworkBaseView( child: MasterKeyCheckboxSearchWidget(
baseViewModel: model, model: model,
child: MasterKeyCheckboxSearchWidget( masterList: model
model: model, .mergeHistorySurgicalWithHistorySportList,
masterList: model.mergeHistorySurgicalWithHistorySportList, removeHistory: (history) {
removeHistory: (history){ setState(() {
setState(() { widget.removeHistory(history);
widget.removeHistory(history); });
}); },
}, addHistory: (history) {
addHistory: (history){ setState(() {
setState(() { createAndAddHistory(history);
createAndAddHistory( });
history); },
}); addSelectedHistories: () {
}, widget.addSelectedHistories();
addSelectedHistories: (){ },
widget.addSelectedHistories(); isServiceSelected: (master) =>
}, isServiceSelected(master),
isServiceSelected: (master) =>isServiceSelected(master), ),
), ),
), NetworkBaseView(
NetworkBaseView( baseViewModel: model,
baseViewModel: model, child: MasterKeyCheckboxSearchWidget(
child: MasterKeyCheckboxSearchWidget( model: model,
model: model, masterList: model.historyMedicalList,
masterList: model.historyMedicalList, removeHistory: (history) {
removeHistory: (history){ setState(() {
setState(() { widget.removeHistory(history);
widget.removeHistory(history); });
}); },
}, addHistory: (history) {
addHistory: (history){ setState(() {
setState(() { createAndAddHistory(history);
createAndAddHistory( });
history); },
}); addSelectedHistories: () {
}, widget.addSelectedHistories();
addSelectedHistories: (){ },
widget.addSelectedHistories();
},
isServiceSelected: (master) => isServiceSelected: (master) =>
isServiceSelected(master), isServiceSelected(master),
), ),
@ -149,59 +155,63 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
), ),
), ),
), ),
SizedBox(height:MediaQuery.of(context).size.height * 0.11 ,) SizedBox(
height: MediaQuery.of(context).size.height * 0.11,
)
], ],
) )),
),
), ),
bottomSheet: Container( bottomSheet: model.state == ViewState.Busy
decoration: BoxDecoration( ? Container(
color: Colors.white, height: 0,
borderRadius: BorderRadius.all( )
Radius.circular(0.0), : Container(
), decoration: BoxDecoration(
border: Border.all(color: HexColor('#707070'), width: 0), color: Colors.white,
), borderRadius: BorderRadius.all(
height: MediaQuery.of(context).size.height * 0.1, Radius.circular(0.0),
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
title:
TranslationBase.of(context).addSelectedHistories,
padding: 10,
color: Color(0xFF359846),
onPressed: () {
widget.addSelectedHistories();
},
),
), ),
border: Border.all(color: HexColor('#707070'), width: 0),
),
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
title: TranslationBase.of(context)
.addSelectedHistories,
padding: 10,
color: Color(0xFF359846),
onPressed: () {
widget.addSelectedHistories();
},
),
),
),
),
SizedBox(
height: 5,
),
],
), ),
), ),
SizedBox(
height: 5,
),
],
),
),
), ),
)); ));
} }
createAndAddHistory(MasterKeyModel history) { createAndAddHistory(MasterKeyModel history) {
List<MySelectedHistory> myhistory = widget.myHistoryList.where((element) => List<MySelectedHistory> myhistory = widget.myHistoryList
history.id == .where((element) =>
element.selectedHistory.id && history.id == element.selectedHistory.id &&
history.typeId == history.typeId == element.selectedHistory.typeId)
element.selectedHistory.typeId .toList();
).toList();
if (myhistory.isEmpty) { if (myhistory.isEmpty) {
setState(() { setState(() {
@ -217,18 +227,14 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
} }
isServiceSelected(MasterKeyModel masterKey) { isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedHistory> history = Iterable<MySelectedHistory> history = widget.myHistoryList.where(
widget (element) =>
.myHistoryList masterKey.id == element.selectedHistory.id &&
.where((element) => masterKey.typeId == element.selectedHistory.typeId &&
masterKey.id == element.selectedHistory.id && element.isChecked);
masterKey.typeId == element.selectedHistory.typeId &&
element.isChecked);
if (history.length > 0) { if (history.length > 0) {
return true; return true;
} }
return false; return false;
} }
} }

@ -123,10 +123,19 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
).toList(); ).toList();
if (history.length > 0) if (history.length > 0) {
setState(() { if(history.first.isLocal) {
history[0].isChecked = false; setState(() {
}); widget.myHistoryList.remove(history.first);
});
} else {
setState(() {
history[0].isChecked = false;
});
}
}
} }
openHistoryList(BuildContext context) { openHistoryList(BuildContext context) {

@ -1,6 +1,7 @@
// ignore: must_be_immutable // ignore: must_be_immutable
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
@ -74,15 +75,15 @@ class _AddMedicationState extends State<AddMedication> {
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: true,
appBar: BottomSheetTitle(
title: TranslationBase.of(context).addMedication,
),
body: Center( body: Center(
child: Container( child: Container(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
BottomSheetTitle(
title: TranslationBase.of(context).addMedication,
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -187,6 +188,7 @@ class _AddMedicationState extends State<AddMedication> {
list: model.medicationDoseTimeList, list: model.medicationDoseTimeList,
okText: okText:
TranslationBase.of(context).ok, TranslationBase.of(context).ok,
selectedValue: _selectedMedicationDose,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
_selectedMedicationDose = _selectedMedicationDose =
@ -235,6 +237,7 @@ class _AddMedicationState extends State<AddMedication> {
list: model.medicationStrengthList, list: model.medicationStrengthList,
okText: okText:
TranslationBase.of(context).ok, TranslationBase.of(context).ok,
selectedValue: _selectedMedicationStrength,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
_selectedMedicationStrength = _selectedMedicationStrength =
@ -283,6 +286,7 @@ class _AddMedicationState extends State<AddMedication> {
MasterKeyDailog dialog = MasterKeyDailog dialog =
MasterKeyDailog( MasterKeyDailog(
list: model.medicationRouteList, list: model.medicationRouteList,
selectedValue: _selectedMedicationRoute,
okText: okText:
TranslationBase.of(context).ok, TranslationBase.of(context).ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
@ -332,6 +336,7 @@ class _AddMedicationState extends State<AddMedication> {
list: model.medicationFrequencyList, list: model.medicationFrequencyList,
okText: okText:
TranslationBase.of(context).ok, TranslationBase.of(context).ok,
selectedValue: _selectedMedicationFrequency,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
_selectedMedicationFrequency = _selectedMedicationFrequency =
@ -381,7 +386,7 @@ class _AddMedicationState extends State<AddMedication> {
]), ]),
), ),
), ),
bottomSheet: Container( bottomSheet:model.state == ViewState.Busy?Container(height: 0,): Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(

@ -30,16 +30,12 @@ import 'history/update_history_widget.dart';
class UpdateSubjectivePage extends StatefulWidget { class UpdateSubjectivePage extends StatefulWidget {
final Function changePageViewIndex; final Function changePageViewIndex;
final Function changeLoadingState; final Function changeLoadingState;
final List<MySelectedAllergy> myAllergiesList;
final List<MySelectedHistory> myHistoryList;
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
final int currentIndex; final int currentIndex;
UpdateSubjectivePage( UpdateSubjectivePage(
{Key key, {Key key,
this.changePageViewIndex, this.changePageViewIndex,
this.myAllergiesList,
this.myHistoryList,
this.patientInfo, this.patientInfo,
this.changeLoadingState, this.changeLoadingState,
this.currentIndex}); this.currentIndex});
@ -59,6 +55,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
String medicationControllerError = ''; String medicationControllerError = '';
String illnessControllerError = ''; String illnessControllerError = '';
final formKey = GlobalKey<FormState>(); final formKey = GlobalKey<FormState>();
List<MySelectedAllergy> myAllergiesList=List();
List<MySelectedHistory> myHistoryList=List();
getHistory(SOAPViewModel model) async { getHistory(SOAPViewModel model) async {
widget.changeLoadingState(true); widget.changeLoadingState(true);
@ -93,9 +91,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
); );
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false);
widget.myHistoryList.add(mySelectedHistory); myHistoryList.add(mySelectedHistory);
} }
} }
if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) { if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) {
@ -105,9 +103,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
); );
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false);
widget.myHistoryList.add(mySelectedHistory); myHistoryList.add(mySelectedHistory);
} }
} }
if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) { if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) {
@ -117,9 +115,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
); );
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false);
widget.myHistoryList.add(mySelectedHistory); myHistoryList.add(mySelectedHistory);
} }
} }
if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) { if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) {
@ -129,9 +127,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
); );
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false);
widget.myHistoryList.add(mySelectedHistory); myHistoryList.add(mySelectedHistory);
} }
} }
}); });
@ -169,8 +167,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
isChecked: element.isChecked, isChecked: element.isChecked,
createdBy: element.createdBy, createdBy: element.createdBy,
remark: element.remarks, remark: element.remarks,
isLocal : false,
selectedAllergySeverity: selectedAllergySeverity); selectedAllergySeverity: selectedAllergySeverity);
if (selectedAllergy != null && selectedAllergySeverity != null) widget.myAllergiesList.add(mySelectedAllergy); if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy);
}); });
} }
} }
@ -179,8 +178,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
widget.myAllergiesList.clear(); myAllergiesList.clear();
widget.myHistoryList.clear(); myHistoryList.clear();
GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
@ -246,7 +245,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
}); });
}, },
child: Column( child: Column(
children: [UpdateHistoryWidget(myHistoryList: widget.myHistoryList)], children: [UpdateHistoryWidget(myHistoryList: myHistoryList)],
), ),
isExpanded: isHistoryExpand, isExpanded: isHistoryExpand,
), ),
@ -264,7 +263,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
child: Column( child: Column(
children: [ children: [
UpdateAllergiesWidget( UpdateAllergiesWidget(
myAllergiesList: widget.myAllergiesList, myAllergiesList: myAllergiesList,
), ),
SizedBox( SizedBox(
height: 30, height: 30,
@ -304,10 +303,10 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
title: TranslationBase.of(context).next, title: TranslationBase.of(context).next,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.red[700], color: Colors.red[700],
loading: model.state == ViewState.BusyLocal, // loading: model.state == ViewState.BusyLocal,
onPressed: () async { onPressed: () async {
addSubjectiveInfo( addSubjectiveInfo(
model: model, myAllergiesList: widget.myAllergiesList, myHistoryList: widget.myHistoryList); model: model, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList);
}, },
), ),
), ),
@ -325,6 +324,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
addSubjectiveInfo( addSubjectiveInfo(
{SOAPViewModel model, List<MySelectedAllergy> myAllergiesList, List<MySelectedHistory> myHistoryList}) async { {SOAPViewModel model, List<MySelectedAllergy> myAllergiesList, List<MySelectedHistory> myHistoryList}) async {
if(FocusScope.of(context).hasFocus)
FocusScope.of(context).unfocus();
widget.changeLoadingState(true);
formKey.currentState.save(); formKey.currentState.save();
formKey.currentState.validate(); formKey.currentState.validate();
@ -338,7 +340,6 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} }
if (myHistoryList.length != 0) { if (myHistoryList.length != 0) {
await postHistories(model: model, myHistoryList: myHistoryList); await postHistories(model: model, myHistoryList: myHistoryList);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
@ -370,6 +371,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
medicationControllerError = TranslationBase.of(context).emptyMessage; medicationControllerError = TranslationBase.of(context).emptyMessage;
} }
}); });
widget.changeLoadingState(false);
Helpers.showErrorToast(TranslationBase.of(context).chiefComplaintErrorMsg); Helpers.showErrorToast(TranslationBase.of(context).chiefComplaintErrorMsg);
} }
} }
@ -380,7 +383,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
widget.myAllergiesList.forEach((allergy) { myAllergiesList.forEach((allergy) {
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null)
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(ListHisProgNotePatientAllergyDiseaseVM( postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(ListHisProgNotePatientAllergyDiseaseVM(
@ -404,6 +407,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
await model.patchAllergy(postAllergyRequestModel); await model.patchAllergy(postAllergyRequestModel);
} }
if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error);
}
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo, episodeId: widget.patientInfo.episodeNo,
@ -419,7 +425,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
postHistories({List<MySelectedHistory> myHistoryList, SOAPViewModel model}) async { postHistories({List<MySelectedHistory> myHistoryList, SOAPViewModel model}) async {
PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: ''); PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: '');
widget.myHistoryList.forEach((history) { myHistoryList.forEach((history) {
if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = [];
postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,

@ -31,11 +31,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
int _currentIndex = 0; int _currentIndex = 0;
List<MySelectedAllergy> myAllergiesList = List(); List<MySelectedAllergy> myAllergiesList = List();
List<MySelectedHistory> myHistoryList = List(); List<MySelectedHistory> myHistoryList = List();
List<MySelectedExamination> mySelectedExamination = List();
List<MySelectedAssessment> mySelectedAssessment = List();
GetPatientProgressNoteResModel patientProgressNote =
GetPatientProgressNoteResModel();
changePageViewIndex(pageIndex,{isChangeState = true}) { changePageViewIndex(pageIndex,{isChangeState = true}) {
if (pageIndex != _currentIndex && isChangeState) if (pageIndex != _currentIndex && isChangeState)
@ -65,12 +61,11 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
return BaseView<DoctorReplayViewModel>( return AppScaffold(
builder: (_, model, w) => AppScaffold( isLoading: _isLoading,
isLoading: _isLoading, isShowAppBar: false,
isShowAppBar: false, body: SingleChildScrollView(
body: SingleChildScrollView( child: SingleChildScrollView(
child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -105,27 +100,22 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
UpdateSubjectivePage( UpdateSubjectivePage(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex, currentIndex: _currentIndex,
myAllergiesList: myAllergiesList,
myHistoryList: myHistoryList,
patientInfo: patient, patientInfo: patient,
changeLoadingState: changeLoadingState), changeLoadingState: changeLoadingState),
UpdateObjectivePage( UpdateObjectivePage(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex, currentIndex: _currentIndex,
mySelectedExamination: mySelectedExamination,
patientInfo: patient, patientInfo: patient,
changeLoadingState: changeLoadingState), changeLoadingState: changeLoadingState),
UpdateAssessmentPage( UpdateAssessmentPage(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex, currentIndex: _currentIndex,
mySelectedAssessmentList: mySelectedAssessment,
patientInfo: patient, patientInfo: patient,
changeLoadingState: changeLoadingState), changeLoadingState: changeLoadingState),
UpdatePlanPage( UpdatePlanPage(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
currentIndex: _currentIndex, currentIndex: _currentIndex,
patientInfo: patient, patientInfo: patient,
patientProgressNote: patientProgressNote,
changeLoadingState: changeLoadingState) changeLoadingState: changeLoadingState)
], ],
), ),
@ -137,6 +127,6 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
), ),
), ),
), ),
)); );
} }
} }

@ -104,7 +104,7 @@ class PrescriptionsPage extends StatelessWidget {
prescriptionModel: model, prescriptionModel: model,
procedureType: procedureType:
ProcedureType.PRESCRIPTION, ProcedureType.PRESCRIPTION,
)), ),settings: RouteSettings(name: 'AddProcedureTabPage')),
); );
}, },
label: TranslationBase.of(context) label: TranslationBase.of(context)

@ -108,7 +108,7 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
patient: widget.patient, patient: widget.patient,
model: widget.prescriptionModel, model: widget.prescriptionModel,
groupProcedures: groupProcedures, groupProcedures: groupProcedures,
), ), settings: RouteSettings(name: 'PrescriptionCheckOutScreen')
), ),
); );
} else { } else {
@ -128,7 +128,7 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
patient: widget.patient, patient: widget.patient,
addButtonTitle: widget.procedureType.getAddButtonTitle(context), addButtonTitle: widget.procedureType.getAddButtonTitle(context),
toolbarTitle: widget.procedureType.getToolbarLabel(context), toolbarTitle: widget.procedureType.getToolbarLabel(context),
), ), settings: RouteSettings(name: 'ProcedureCheckOutScreen')
), ),
); );
} }

@ -110,7 +110,7 @@ class ProcedureScreen extends StatelessWidget {
patient: patient, patient: patient,
model: model, model: model,
procedureType: ProcedureType.PROCEDURE, procedureType: ProcedureType.PROCEDURE,
), ), settings: RouteSettings(name: 'AddProcedureTabPage')
), ),
); );
}, },

@ -982,6 +982,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => AddRescheduleLeavScreen(), builder: (context) => AddRescheduleLeavScreen(),
settings: RouteSettings(name: 'AddRescheduleLeaveScreen')
// MyReferredPatient(), // MyReferredPatient(),
), ),
); );
@ -1045,7 +1046,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => AddRescheduleLeavScreen(), builder: (context) => AddRescheduleLeavScreen(),
// MyReferredPatient(), settings: RouteSettings(name: 'AddRescheduleLeaveScreen')
), ),
); );
} }

@ -28,8 +28,10 @@ class AddSickLeavScreen extends StatelessWidget {
patient = routeArgs['patient']; patient = routeArgs['patient'];
bool isInpatient = routeArgs['isInpatient']; bool isInpatient = routeArgs['isInpatient'];
return BaseView<SickLeaveViewModel>( return BaseView<SickLeaveViewModel>(
onModelReady: (model) => onModelReady: (model) async {
model.getSickLeavePatient(patient.patientMRN ?? patient.patientId), await model.getSickLeavePatient(patient.patientMRN ?? patient.patientId);
await model.getSickLeaveDoctor(patient.patientMRN ?? patient.patientId);
},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
@ -61,56 +63,59 @@ class AddSickLeavScreen extends StatelessWidget {
), ),
], ],
)), )),
Container( InkWell(
width: SizeConfig.screenWidth, onTap: () {
margin: EdgeInsets.only( openSickLeave(
left: 20, right: 20, top: 10, bottom: 10), context,
padding: EdgeInsets.all(20), false,
decoration: BoxDecoration( );
borderRadius: BorderRadius.circular(10), },
color: HexColor('#EAEAEA')), child: Container(
child: Column( width: SizeConfig.screenWidth,
mainAxisAlignment: MainAxisAlignment.start, margin: EdgeInsets.only(left: 20, right: 20, top: 10, bottom: 10),
children: [ padding: EdgeInsets.all(20),
Container( decoration:
child: Container( BoxDecoration(borderRadius: BorderRadius.circular(10), color: HexColor('#EAEAEA')),
decoration: BoxDecoration( child: Column(
color: Colors.grey, mainAxisAlignment: MainAxisAlignment.start,
borderRadius: BorderRadius.circular(10)), children: [
padding: EdgeInsets.all(3), Container(
child: IconButton( child: Container(
decoration:
BoxDecoration(color: Colors.grey, borderRadius: BorderRadius.circular(10)),
padding: EdgeInsets.all(3),
child: IconButton(
icon: Icon( icon: Icon(
Icons.add, Icons.add,
size: 35, size: 35,
color: Colors.white, color: Colors.white,
), ),
onPressed: () { // onPressed: () {
openSickLeave( // openSickLeave(
context, // context,
false, // false,
); // );
}), // },
)), ),
Padding( )),
child: AppText( Padding(
TranslationBase.of(context) child: AppText(TranslationBase.of(context).noSickLeaveApplied,
.noSickLeaveApplied, fontWeight: FontWeight.bold,
fontWeight: FontWeight.bold, fontFamily: 'Poppins',
fontFamily: 'Poppins', fontSize: 16,
fontSize: 16, textAlign: TextAlign.center,
textAlign: TextAlign.center, color: HexColor('#7E7E7E')),
color: HexColor('#7E7E7E')), padding: EdgeInsets.all(10),
padding: EdgeInsets.all(10), ),
), ],
], )),
)), ),
], ],
) )
: SizedBox(), : SizedBox(),
model.getAllSIckLeavePatient.length > 0 model.getAllSIckLeavePatient.length > 0
? Column( ? Column(
children: model.getAllSIckLeavePatient children: model.getAllSIckLeavePatient.map<Widget>((SickLeavePatientModel item) {
.map<Widget>((SickLeavePatientModel item) {
return RoundedContainer( return RoundedContainer(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
child: Column( child: Column(
@ -129,8 +134,7 @@ class AddSickLeavScreen extends StatelessWidget {
// ))), // ))),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 4, flex: 4,
@ -139,13 +143,12 @@ class AddSickLeavScreen extends StatelessWidget {
// MainAxisAlignment.start, // MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Column( Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
padding: EdgeInsets.all(3), padding: EdgeInsets.all(3),
child: AppText( child: AppText(
item.doctorName, item.doctorName ?? "",
// item.status == 1 // item.status == 1
// ? TranslationBase.of( // ? TranslationBase.of(
// context) // context)
@ -158,8 +161,7 @@ class AddSickLeavScreen extends StatelessWidget {
// : TranslationBase // : TranslationBase
// .of(context) // .of(context)
// .all, // .all,
fontWeight: fontWeight: FontWeight.bold,
FontWeight.bold,
// color: item.status == 1 // color: item.status == 1
// ? Colors.yellow[800] // ? Colors.yellow[800]
// : item.status == 2 // : item.status == 2
@ -170,34 +172,25 @@ class AddSickLeavScreen extends StatelessWidget {
), ),
Row( Row(
children: [ children: [
AppText(TranslationBase AppText(TranslationBase.of(context).daysSickleave + ": "),
.of(context)
.daysSickleave +
": "),
AppText( AppText(
item.sickLeaveDays item.sickLeaveDays ?? item.noOfDays.toString(),
.toString(), fontWeight: FontWeight.bold,
fontWeight:
FontWeight.bold,
), ),
], ],
), ),
Row( Row(
children: [ children: [
AppText( AppText(
TranslationBase.of( TranslationBase.of(context).startDate + ' ' ?? "",
context)
.startDate +
' ',
), ),
Flexible( Flexible(
child: AppText( child: AppText(
AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils item.startDate.contains("/Date(")
.convertStringToDate( ? AppDateUtils.convertStringToDate(item.startDate)
item.startDate)), : DateTime.parse(item.startDate)),
fontWeight: fontWeight: FontWeight.bold,
FontWeight.bold,
), ),
) )
], ],
@ -205,42 +198,21 @@ class AddSickLeavScreen extends StatelessWidget {
Row( Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).endDate + ' ' ?? "",
.endDate +
' ',
), ),
Flexible( Flexible(
child: AppText( child: AppText(
AppDateUtils AppDateUtils.getDayMonthYearDateFormatted(
.getDayMonthYearDateFormatted( item.startDate.contains("/Date(")
AppDateUtils ? AppDateUtils.convertStringToDate(item.endDate)
.convertStringToDate( .add(Duration(days: item.noOfDays))
item.endDate, : DateTime.parse(item.startDate)
)), .add(Duration(days: item.noOfDays))),
fontWeight: fontWeight: FontWeight.bold,
FontWeight.bold,
), ),
) )
], ],
), ),
Row(children: [
AppText(TranslationBase.of(
context)
.branch +
": "),
AppText(
item.projectName ?? "",
),
]),
Row(children: [
AppText(TranslationBase.of(
context)
.clinic +
": "),
AppText(
item.clinicName ?? "",
),
]),
], ],
), ),
SizedBox( SizedBox(
@ -266,8 +238,7 @@ class AddSickLeavScreen extends StatelessWidget {
Image.asset('assets/images/no-data.png'), Image.asset('assets/images/no-data.png'),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: AppText( child: AppText(TranslationBase.of(context).noSickLeave),
TranslationBase.of(context).noSickLeave),
) )
], ],
), ),
@ -276,8 +247,7 @@ class AddSickLeavScreen extends StatelessWidget {
])))); ]))));
} }
openSickLeave(BuildContext context, isExtend, openSickLeave(BuildContext context, isExtend, {GetAllSickLeaveResponse extendedData}) {
{GetAllSickLeaveResponse extendedData}) {
// showModalBottomSheet( // showModalBottomSheet(
// context: context, // context: context,
// builder: (context) { // builder: (context) {
@ -287,12 +257,9 @@ class AddSickLeavScreen extends StatelessWidget {
context, context,
FadePage( FadePage(
page: SickLeaveScreen( page: SickLeaveScreen(
appointmentNo: isExtend == true appointmentNo:
? extendedData.appointmentNo isExtend == true ? extendedData.appointmentNo : patient.appointmentNo, //extendedData.appointmentNo,
: patient.appointmentNo, //extendedData.appointmentNo, patientMRN: isExtend == true ? extendedData.patientMRN : patient.patientMRN,
patientMRN: isExtend == true
? extendedData.patientMRN
: patient.patientMRN,
isExtended: isExtend, isExtended: isExtend,
extendedData: extendedData, extendedData: extendedData,
patient: patient))); patient: patient)));

@ -1,12 +1,14 @@
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/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_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:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart';
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
import 'package:doctor_app_flutter/routes.dart'; 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/sick-leave/add-sickleave.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
@ -28,12 +30,7 @@ class SickLeaveScreen extends StatefulWidget {
final appointmentNo; final appointmentNo;
final patientMRN; final patientMRN;
final patient; final patient;
SickLeaveScreen( SickLeaveScreen({this.appointmentNo, this.patientMRN, this.isExtended = false, this.extendedData, this.patient});
{this.appointmentNo,
this.patientMRN,
this.isExtended = false,
this.extendedData,
this.patient});
@override @override
_SickLeaveScreenState createState() => _SickLeaveScreenState(); _SickLeaveScreenState createState() => _SickLeaveScreenState();
} }
@ -76,8 +73,7 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
return BaseView<PatientViewModel>( return BaseView<PatientViewModel>(
onModelReady: (model) => model.getClinicsList(), onModelReady: (model) => model.getClinicsList(),
builder: (_, model, w) => BaseView<SickLeaveViewModel>( builder: (_, model, w) => BaseView<SickLeaveViewModel>(
onModelReady: (model2) => model2.preSickLeaveStatistics( onModelReady: (model2) => model2.preSickLeaveStatistics(widget.appointmentNo, widget.patientMRN),
widget.appointmentNo, widget.patientMRN),
builder: (_, model2, w) => GestureDetector( builder: (_, model2, w) => GestureDetector(
onTap: () { onTap: () {
FocusScope.of(context).requestFocus(new FocusNode()); FocusScope.of(context).requestFocus(new FocusNode());
@ -108,46 +104,35 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10), margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.all(Radius.circular(6.0)),
BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0,
color: HexColor("#CCCCCC"), color: HexColor("#CCCCCC"),
), ),
color: Colors.white), color: Colors.white),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
crossAxisAlignment: Padding(
CrossAxisAlignment.start, padding: EdgeInsets.only(top: 5, left: 10, right: 10),
children: [ child: AppText(TranslationBase.of(context).sickLeave +
Padding( ' ' +
padding: EdgeInsets.only( TranslationBase.of(context).days)),
top: 5, left: 10, right: 10), AppTextFormField(
child: AppText( borderColor: Colors.white,
TranslationBase.of(context) onChanged: (value) {
.sickLeave + addSickLeave.noOfDays = value;
' ' + if (widget.extendedData != null) {
TranslationBase.of(context) widget.extendedData.noOfDays = int.parse(value);
.days)), }
AppTextFormField( },
borderColor: Colors.white, hintText:
onChanged: (value) { widget.extendedData != null ? widget.extendedData.noOfDays.toString() : '',
addSickLeave.noOfDays = value; // validator: (value) {
if (widget.extendedData != null) { // return TextValidator().validateName(value);
widget.extendedData.noOfDays = // },
int.parse(value); textInputType: TextInputType.number,
} inputFormatter: ONLY_NUMBERS)
}, ]),
hintText: widget.extendedData != null
? widget.extendedData.noOfDays
.toString()
: '',
// validator: (value) {
// return TextValidator().validateName(value);
// },
textInputType:TextInputType.number,
inputFormatter: ONLY_NUMBERS)
]),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -155,146 +140,107 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10), margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.all(Radius.circular(6.0)),
BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC")),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC")),
color: Colors.white, color: Colors.white,
), ),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(top: 5, left: 10, right: 10),
top: 5, left: 10, right: 10),
child: AppText( child: AppText(
TranslationBase.of(context) TranslationBase.of(context).sickLeaveDate,
.sickLeaveDate,
)), )),
AppTextFormField( AppTextFormField(
hintText: widget.extendedData != null hintText: widget.extendedData != null ? widget.extendedData.startDate : '',
? widget.extendedData.startDate
: '',
borderColor: Colors.white, borderColor: Colors.white,
prefix: IconButton( prefix: IconButton(icon: Icon(Icons.calendar_today)),
icon: Icon(Icons.calendar_today)),
textInputType: TextInputType.number, textInputType: TextInputType.number,
controller: _toDateController, controller: _toDateController,
onTap: () { onTap: () {
_presentDatePicker( _presentDatePicker('_selectedToDate');
'_selectedToDate');
}, },
inputFormatter: ONLY_DATE, inputFormatter: ONLY_DATE,
onChanged: (value) { onChanged: (value) {
addSickLeave.startDate = value; addSickLeave.startDate = value;
if (widget.extendedData != null) { if (widget.extendedData != null) {
widget.extendedData.startDate = widget.extendedData.startDate = value;
value;
} }
}), }),
], ],
)), )),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(top: 10, left: 10, right: 10),
top: 10, left: 10, right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.all(Radius.circular(6.0)),
BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC")),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC")),
color: Colors.white, color: Colors.white,
), ),
width: double.infinity, width: double.infinity,
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9, top: SizeConfig.widthMultiplier * 0.9,
bottom: bottom: SizeConfig.widthMultiplier * 0.9,
SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3, right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3), left: SizeConfig.widthMultiplier * 3),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only(top: 5), padding: EdgeInsets.only(top: 5),
child: AppText( child: AppText(
TranslationBase.of(context) TranslationBase.of(context).clinicName,
.clinicName,
)), )),
Row( Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: child: DropdownButtonHideUnderline(
DropdownButtonHideUnderline( child: new IgnorePointer(
child: new IgnorePointer( ignoring: true,
ignoring: true, child: DropdownButton(
child: DropdownButton( isExpanded: true,
isExpanded: true, value: getClinicName(model) ?? "",
value: getClinicName( iconSize: 0,
model) ?? elevation: 16,
"", selectedItemBuilder: (BuildContext context) {
iconSize: 0, return model.getClinicNameList().map((item) {
elevation: 16, return Row(
selectedItemBuilder: mainAxisSize: MainAxisSize.max,
(BuildContext children: <Widget>[
context) { AppText(
return model
.getClinicNameList()
.map((item) {
return Row(
mainAxisSize:
MainAxisSize
.max,
children: <
Widget>[
AppText(
item,
fontSize:
SizeConfig.textMultiplier *
2.1,
color: Colors
.grey,
),
],
);
}).toList();
},
onChanged:
(newValue) =>
{},
items: model
.getClinicNameList()
.map((item) {
return DropdownMenuItem(
value: item
.toString(),
child: Text(
item, item,
textAlign: fontSize: SizeConfig.textMultiplier * 2.1,
TextAlign color: Colors.grey,
.end,
), ),
); ],
}).toList(), );
))), }).toList();
},
onChanged: (newValue) => {},
items: model.getClinicNameList().map((item) {
return DropdownMenuItem(
value: item.toString(),
child: Text(
item,
textAlign: TextAlign.end,
),
);
}).toList(),
))),
), ),
], ],
) )
], ],
), ),
)), )),
model2.sickLeaveStatistics[ model2.sickLeaveStatistics['recommendedSickLeaveDays'] != null
'recommendedSickLeaveDays'] !=
null
? Padding( ? Padding(
child: AppText( child: AppText(
model2.sickLeaveStatistics[ model2.sickLeaveStatistics['recommendedSickLeaveDays'],
'recommendedSickLeaveDays'],
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.start, textAlign: TextAlign.start,
), ),
@ -306,10 +252,8 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10), margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.all(Radius.circular(6.0)),
BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC")),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC")),
color: Colors.white, color: Colors.white,
), ),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
@ -317,11 +261,9 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(top: 5, left: 10, right: 10),
top: 5, left: 10, right: 10),
child: AppText( child: AppText(
TranslationBase.of(context) TranslationBase.of(context).doctorName,
.doctorName,
)), )),
new IgnorePointer( new IgnorePointer(
ignoring: true, ignoring: true,
@ -343,10 +285,8 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10), margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.all(Radius.circular(6.0)),
BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC")),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC")),
color: Colors.white, color: Colors.white,
), ),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
@ -354,8 +294,7 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(top: 5, left: 10, right: 10),
top: 5, left: 10, right: 10),
child: AppText( child: AppText(
TranslationBase.of(context).remarks, TranslationBase.of(context).remarks,
)), )),
@ -364,9 +303,7 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
decoration: InputDecoration( decoration: InputDecoration(
contentPadding: EdgeInsets.all(20.0), contentPadding: EdgeInsets.all(20.0),
border: InputBorder.none, border: InputBorder.none,
hintText: widget.extendedData != null hintText: widget.extendedData != null ? widget.extendedData.remarks : ''),
? widget.extendedData.remarks
: ''),
onChanged: (value) { onChanged: (value) {
addSickLeave.remarks = value; addSickLeave.remarks = value;
if (widget.extendedData != null) { if (widget.extendedData != null) {
@ -378,40 +315,60 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
), ),
), ),
Container( Container(
margin: EdgeInsets.all( margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
SizeConfig.widthMultiplier * 5),
child: Wrap( child: Wrap(
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
AppButton( AppButton(
title: widget.isExtended == true title: widget.isExtended == true
? TranslationBase.of(context).extend ? TranslationBase.of(context).extend
: TranslationBase.of(context) : TranslationBase.of(context).addSickLeaverequest,
.addSickLeaverequest,
color: Colors.green, color: Colors.green,
onPressed: () async { onPressed: () async {
if (widget.isExtended) { if (widget.isExtended) {
await model2.extendSickLeave( await model2.extendSickLeave(widget.extendedData);
widget.extendedData);
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast(
model2.sickleaveResponse[ model2.sickleaveResponse['ListSickLeavesToExtent']['success']);
'ListSickLeavesToExtent'] Navigator.of(context).popUntil((route) {
['success']); return route.settings.name == PATIENTS_PROFILE;
Navigator.of(context)
.popUntil((route) {
return route.settings.name ==
PATIENTS_PROFILE;
}); });
Navigator.of(context).pushNamed( Navigator.of(context)
ADD_SICKLEAVE, .pushNamed(ADD_SICKLEAVE, arguments: {'patient': widget.patient});
arguments: {
'patient': widget.patient
});
//print(value); //print(value);
//}); //});
} else { } else {
_validateInputs(model2); try {
if (addSickLeave.noOfDays == null) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).pleaseEnterNoOfDays);
} else if (addSickLeave.remarks == null) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).pleaseEnterRemarks);
} else if (addSickLeave.startDate == null) {
DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseEnterDate);
} else {
addSickLeave.patientMRN = widget.patient.patientMRN.toString();
addSickLeave.appointmentNo = widget.patient.appointmentNo.toString();
await model2.addSickLeave(addSickLeave);
if (model2.sickleaveResponse['SickLeavesList']['success'] != null)
DrAppToastMsg.showSuccesToast(
model2.sickleaveResponse['SickLeavesList']['success']);
}
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => AddSickLeavScreen()),
// );
// Navigator.of(context).popUntil((route) {
// return route.settings.name == PATIENTS_PROFILE;
// });
// Navigator.of(context)
// .pushNamed(ADD_SICKLEAVE, arguments: {'patient': widget.patient});
} catch (err) {
print(err);
}
} }
}, },
), ),
@ -437,26 +394,21 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
void _validateInputs(model2) async { void _validateInputs(model2) async {
try { try {
if (addSickLeave.noOfDays == null) { if (addSickLeave.noOfDays == null) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseEnterNoOfDays);
TranslationBase.of(context).pleaseEnterNoOfDays);
} else if (addSickLeave.remarks == null) { } else if (addSickLeave.remarks == null) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseEnterRemarks);
TranslationBase.of(context).pleaseEnterRemarks);
} else if (addSickLeave.startDate == null) { } else if (addSickLeave.startDate == null) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseEnterDate);
TranslationBase.of(context).pleaseEnterDate);
} else { } else {
addSickLeave.patientMRN = widget.patient.patientMRN.toString(); addSickLeave.patientMRN = widget.patient.patientMRN.toString();
addSickLeave.appointmentNo = widget.patient.appointmentNo.toString(); addSickLeave.appointmentNo = widget.patient.appointmentNo.toString();
await model2.addSickLeave(addSickLeave).then((value) => print(value)); await model2.addSickLeave(addSickLeave).then((value) => print(value));
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast(model2.sickleaveResponse['ListSickLeavesToExtent']['success']);
model2.sickleaveResponse['ListSickLeavesToExtent']['success']);
Navigator.of(context).popUntil((route) { Navigator.of(context).popUntil((route) {
return route.settings.name == PATIENTS_PROFILE; return route.settings.name == PATIENTS_PROFILE;
}); });
Navigator.of(context) Navigator.of(context).pushNamed(ADD_SICKLEAVE, arguments: {'patient': widget.patient});
.pushNamed(ADD_SICKLEAVE, arguments: {'patient': widget.patient});
} }
} catch (err) { } catch (err) {
print(err); print(err);
@ -471,9 +423,7 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
} }
getClinicName(model) { getClinicName(model) {
var clinicInfo = model.clinicsList var clinicInfo = model.clinicsList.where((i) => i['ClinicID'] == this.profile['ClinicID']).toList();
.where((i) => i['ClinicID'] == this.profile['ClinicID'])
.toList();
return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : ""; return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : "";
} }
} }

@ -562,6 +562,7 @@ class TranslationBase {
localizedValues['no-priscription-listed'][locale.languageCode]; localizedValues['no-priscription-listed'][locale.languageCode];
String get next => localizedValues['next'][locale.languageCode]; String get next => localizedValues['next'][locale.languageCode];
String get finish => localizedValues['finish'][locale.languageCode];
String get previous => localizedValues['previous'][locale.languageCode]; String get previous => localizedValues['previous'][locale.languageCode];

@ -71,6 +71,7 @@ class PrescriptionOutPatientWidget extends StatelessWidget {
prescriptionResModel: prescriptionResModel:
patientPrescriptionsList[index], patientPrescriptionsList[index],
), ),
settings: RouteSettings(name: 'OutPatientPrescriptionDetailsScreen')
), ),
); );
}, },

@ -118,6 +118,7 @@ class _AppDrawerState extends State<AppDrawer> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => AddRescheduleLeavScreen(), builder: (context) => AddRescheduleLeavScreen(),
settings: RouteSettings(name: 'AddRescheduleLeaveScreen')
// MyReferredPatient(), // MyReferredPatient(),
)); ));
}, },

@ -1,421 +0,0 @@
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/new_text_Field.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/custom_validation_error.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'app_texts_widget.dart';
import 'dialogs/master_key_dailog.dart';
import 'divider_with_spaces_around.dart';
import 'expandable-widget-header-body.dart';
import 'text_fields/app-textfield-custom.dart';
class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget {
final SOAPViewModel model;
final Function() addSelectedAllergy;
final Function(MasterKeyModel) removeAllergy;
final Function(MySelectedAllergy mySelectedAllergy) addAllergy;
final bool Function(MasterKeyModel) isServiceSelected;
final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy;
final List<MasterKeyModel> masterList;
final String buttonName;
final String hintSearchText;
MasterKeyCheckboxSearchAllergiesWidget(
{Key key,
this.model,
this.addSelectedAllergy,
this.removeAllergy,
this.masterList,
this.addAllergy,
this.isServiceSelected,
this.buttonName,
this.hintSearchText,
this.getServiceSelectedAllergy})
: super(key: key);
@override
_MasterKeyCheckboxSearchAllergiesWidgetState createState() =>
_MasterKeyCheckboxSearchAllergiesWidgetState();
}
class _MasterKeyCheckboxSearchAllergiesWidgetState
extends State<MasterKeyCheckboxSearchAllergiesWidget> {
List<MasterKeyModel> items = List();
MasterKeyModel _selectedAllergySeverity;
bool isSubmitted = false;
@override
void initState() {
items.addAll(widget.masterList);
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
child: Column(
children: [
Expanded(
child: Container(
height: MediaQuery.of(context).size.height * 0.70,
child: Center(
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
children: [
AppTextFieldCustom(
// height:
// MediaQuery.of(context).size.height * 0.070,
hintText:
TranslationBase.of(context).selectAllergy,
isTextFieldHasSuffix: true,
hasBorder: false,
// controller: filteredSearchController,
onChanged: (value) {
filterSearchResults(value);
},
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Colors.black,
)),
),
DividerWithSpacesAround(),
SizedBox(
height: 10,
),
Expanded(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Container(
height:
MediaQuery.of(context).size.height * 0.60,
child: ListView.builder(
itemCount: items.length,
itemBuilder: (context, index) {
bool isSelected = widget
.isServiceSelected(items[index]);
MySelectedAllergy mySelectedAllergy;
if (isSelected) {
mySelectedAllergy =
widget.getServiceSelectedAllergy(
items[index]);
}
TextEditingController remarkController =
TextEditingController(
text: isSelected
? mySelectedAllergy.remark
: null);
TextEditingController severityController =
TextEditingController(
text: isSelected
? mySelectedAllergy
.selectedAllergySeverity !=
null
? projectViewModel
.isArabic
? mySelectedAllergy
.selectedAllergySeverity
.nameAr
: mySelectedAllergy
.selectedAllergySeverity
.nameEn
: null
: null);
return HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Checkbox(
value: widget
.isServiceSelected(
items[index]),
activeColor:
Colors.red[800],
onChanged: (bool newValue) {
setState(() {
if (widget
.isServiceSelected(
items[index])) {
widget.removeAllergy(
items[index]);
} else {
MySelectedAllergy
mySelectedAllergy =
new MySelectedAllergy(
selectedAllergy:
items[
index],
selectedAllergySeverity:
_selectedAllergySeverity,
remark: null,
isChecked:
true,
isExpanded:
true);
widget.addAllergy(
mySelectedAllergy);
}
});
}),
InkWell(
onTap: () {
setState(() {
if (widget
.isServiceSelected(
items[index])) {
widget.removeAllergy(
items[index]);
} else {
MySelectedAllergy mySelectedAllergy =
new MySelectedAllergy(
selectedAllergy:
items[
index],
selectedAllergySeverity:
_selectedAllergySeverity,
remark: null,
isChecked: true,
isExpanded:
true);
widget.addAllergy(
mySelectedAllergy);
}
});
},
child: Padding(
padding: const EdgeInsets
.symmetric(
horizontal: 10,
vertical: 0),
child: Container(
child: AppText(
projectViewModel
.isArabic
? items[index]
.nameAr !=
""
? items[index]
.nameAr
: items[index]
.nameEn
: items[index]
.nameEn,
color:
Color(0xFF575757),
fontSize: 16,
fontWeight:
FontWeight.w600,
),
width:
MediaQuery.of(context)
.size
.width *
0.55,
),
),
),
],
),
InkWell(
onTap: () {
if (mySelectedAllergy !=
null) {
setState(() {
mySelectedAllergy
.isExpanded =
mySelectedAllergy
.isExpanded
? false
: true;
});
}
},
child: Icon((mySelectedAllergy !=
null
? mySelectedAllergy
.isExpanded
: false)
? EvaIcons
.arrowIosUpwardOutline
: EvaIcons
.arrowIosDownwardOutline))
],
),
bodyWidget: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Center(
child: Column(
children: [
AppTextFieldCustom(
onClick: widget.model
.allergySeverityList !=
null
? () {
MasterKeyDailog
dialog =
MasterKeyDailog(
list: widget.model
.allergySeverityList,
okText:
TranslationBase.of(
context)
.ok,
okFunction:
(selectedValue) {
setState(() {
mySelectedAllergy
.selectedAllergySeverity =
selectedValue;
});
},
);
showDialog(
barrierDismissible:
false,
context: context,
builder:
(BuildContext
context) {
return dialog;
},
);
}
: null,
isTextFieldHasSuffix: true,
hintText:
TranslationBase.of(
context)
.selectSeverity,
enabled: false,
maxLines: 2,
minLines: 2,
controller:
severityController,
),
SizedBox(
height: 5,
),
if (isSubmitted &&
mySelectedAllergy !=
null &&
mySelectedAllergy
.selectedAllergySeverity ==
null)
Row(
children: [
CustomValidationError(),
],
mainAxisAlignment:
MainAxisAlignment
.start,
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(
left: 0,
right: 0,
top: 15),
child: NewTextFields(
hintText:
TranslationBase.of(
context)
.remarks,
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight:
FontWeight.w600,
maxLines: 25,
minLines: 3,
initialValue: isSelected
? mySelectedAllergy
.remark
: '',
// controller: remarkControlle
onChanged: (value) {
if (isSelected) {
mySelectedAllergy
.remark = value;
}
},
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 10,
),
],
),
),
),
),
isExpand: mySelectedAllergy != null
? mySelectedAllergy.isExpanded
: false,
);
},
),
),
),
),
],
))),
),
),
SizedBox(
height: 10,
),
],
),
);
}
void filterSearchResults(String query) {
List<MasterKeyModel> dummySearchList = List();
dummySearchList.addAll(widget.masterList);
if (query.isNotEmpty) {
List<MasterKeyModel> dummyListData = List();
dummySearchList.forEach((items) {
if (items.nameAr.toLowerCase().contains(query.toLowerCase()) ||
items.nameEn.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(items);
}
});
setState(() {
items.clear();
items.addAll(dummyListData);
});
return;
} else {
setState(() {
items.clear();
items.addAll(widget.masterList);
});
}
}
}

@ -27,6 +27,7 @@ class AppTextFieldCustom extends StatefulWidget {
final String validationError; final String validationError;
final bool isPrscription; final bool isPrscription;
final bool isSecure; final bool isSecure;
final bool focus;
AppTextFieldCustom({ AppTextFieldCustom({
this.height = 0, this.height = 0,
@ -47,6 +48,7 @@ class AppTextFieldCustom extends StatefulWidget {
this.validationError, this.validationError,
this.isPrscription = false, this.isPrscription = false,
this.isSecure = false, this.isSecure = false,
this.focus = false,
}); });
@override @override
@ -54,6 +56,32 @@ class AppTextFieldCustom extends StatefulWidget {
} }
class _AppTextFieldCustomState extends State<AppTextFieldCustom> { class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
final FocusNode _focusNode = FocusNode();
bool focus = false;
bool view = false;
@override
void initState() {
super.initState();
_focusNode.addListener(() {
setState(() {
focus = _focusNode.hasFocus;
});
});
}
@override
void didUpdateWidget(AppTextFieldCustom oldWidget) {
if (widget.focus) _focusNode.requestFocus();
super.didUpdateWidget(oldWidget);
}
@override
void dispose() {
_focusNode.dispose();
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
@ -104,10 +132,11 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
widget.height != 0 && widget.maxLines == 1 widget.height != 0 && widget.maxLines == 1
? widget.height - 22 ? widget.height - 22
: null, : null,
child: TextField( child: TextFormField(
textAlign: projectViewModel.isArabic textAlign: projectViewModel.isArabic
? TextAlign.right ? TextAlign.right
: TextAlign.left, : TextAlign.left,
focusNode: _focusNode,
decoration: TextFieldsUtils decoration: TextFieldsUtils
.textFieldSelectorDecoration( .textFieldSelectorDecoration(
widget.hintText, null, true), widget.hintText, null, true),
@ -129,7 +158,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
? widget.inputFormatters ? widget.inputFormatters
: [], : [],
onChanged: (value) { onChanged: (value) {
setState(() {}); // setState(() {});
if (widget.onChanged != null) { if (widget.onChanged != null) {
widget.onChanged(value); widget.onChanged(value);
} }
@ -162,9 +191,10 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
), ),
), ),
), ),
if (widget.validationError != null) if (widget.validationError != null && widget.validationError.isNotEmpty)
TextFieldsError(error: widget.validationError), TextFieldsError(error: widget.validationError),
], ],
); );
} }
} }

@ -13,9 +13,9 @@ class CustomValidationError extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if(error == null ) if(error == null )
error = TranslationBase error = TranslationBase
.of(context) .of(context)
.emptyMessage; .emptyMessage;
return Column( return Column(
children: [ children: [
SizedBox( SizedBox(

@ -7,6 +7,7 @@ class FadePage extends PageRouteBuilder {
FadePage({this.page}) FadePage({this.page})
: super( : super(
opaque: false, opaque: false,
settings: RouteSettings(name: page.runtimeType.toString()),
fullscreenDialog: true, fullscreenDialog: true,
barrierDismissible: true, barrierDismissible: true,
barrierColor: Colors.black.withOpacity(0.8), barrierColor: Colors.black.withOpacity(0.8),

@ -24,6 +24,7 @@ class SlideUpPageRoute extends PageRouteBuilder {
opaque: opaque, opaque: opaque,
barrierColor: Color.fromRGBO(0, 0, 0, 0.5), barrierColor: Color.fromRGBO(0, 0, 0, 0.5),
barrierDismissible: true, barrierDismissible: true,
settings: RouteSettings(name: widget.runtimeType.toString()),
transitionDuration: Duration(milliseconds: 800), transitionDuration: Duration(milliseconds: 800),
transitionsBuilder: ((BuildContext context, transitionsBuilder: ((BuildContext context,
Animation<double> animation, Animation<double> animation,

@ -351,6 +351,34 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.2.1" version: "5.2.1"
firebase:
dependency: transitive
description:
name: firebase
url: "https://pub.dartlang.org"
source: hosted
version: "7.3.3"
firebase_analytics:
dependency: "direct main"
description:
name: firebase_analytics
url: "https://pub.dartlang.org"
source: hosted
version: "6.3.0"
firebase_analytics_platform_interface:
dependency: transitive
description:
name: firebase_analytics_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
firebase_analytics_web:
dependency: transitive
description:
name: firebase_analytics_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.1"
firebase_core: firebase_core:
dependency: transitive dependency: transitive
description: description:

@ -71,6 +71,7 @@ dependencies:
# Firebase # Firebase
firebase_messaging: ^7.0.3 firebase_messaging: ^7.0.3
firebase_analytics: 6.3.0
#GIF image #GIF image
flutter_gifimage: ^1.0.1 flutter_gifimage: ^1.0.1

Loading…
Cancel
Save