Compare commits

...

29 Commits

Author SHA1 Message Date
Elham Ali bc7f3e9f35 Merge branch 'Er_signin' into 'development'
Er signin

See merge request Cloud_Solution/doctor_app_flutter!999
4 years ago
Elham Rababh 3a9c64779e small fix 4 years ago
Elham Ali 4fe2a4444d Merge branch 'add_doctor_id' into 'development'
Add doctor

See merge request Cloud_Solution/doctor_app_flutter!997
4 years ago
Elham Rababh bcb1e90ae6 ER Done form our side 4 years ago
Elham Rababh 6bdb2a1600 fix operation_report_servive.dart 4 years ago
Elham Rababh 092cfbc891 fix some issue in prescription 4 years ago
Elham Rababh f2bb245c25 return insert back 4 years ago
Elham Rababh 8b79b0041c design issue 4 years ago
Elham Rababh 5f7b52a529 fix issue 4 years ago
Elham Rababh 17f32c4dc8 fixes on procedure 4 years ago
Elham Rababh 986af6ba9c fix issue 4 years ago
Elham Rababh d717d9e0cf fix in patient_service 4 years ago
Elham Rababh 10798f73de Merge branch 'add_doctor_id' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into add_doctor_id 4 years ago
Elham Rababh d4f01c19f7 session management update 4 years ago
Elham Ali 6c1425ad5a Merge branch 'procedures_refactoring' into 'add_doctor_id'
Procedures refactoring

See merge request Cloud_Solution/doctor_app_flutter!994
4 years ago
Elham Rababh 46760ffc77 session management update 4 years ago
Elham Rababh 8069e89a61 session management update 4 years ago
Elham Rababh c30d6bebd8 session management update 4 years ago
Elham Rababh 5422472ccc update procedure 4 years ago
Elham Rababh 33b8d6d78d update procedure 4 years ago
Elham Rababh 1a3ad32aa5 Fix issue on procedure_card.dart 4 years ago
Elham Rababh 70573d190a first step from procedures 4 years ago
RoaaGhali98 379bfd5bb3 Merge branch 'procedures_refactoring' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into procedures_refactoring 4 years ago
ruaa ghali 89d4a7aacb Merge branch 'DAPP_9_less_25' into 'procedures_refactoring'
DAPP-9: remove 25 letter validation

See merge request Cloud_Solution/doctor_app_flutter!995
4 years ago
RoaaGhali98 9ecfe896f9 DAPP-9: remove 25 letter validation 4 years ago
Elham Ali 4b7b4fda7f Merge branch 'hot_fix' into 'development'
hot fix the progress_note_screen.dart

See merge request Cloud_Solution/doctor_app_flutter!993
4 years ago
Elham Rababh e242aa19bc hot fix the progress_note_screen.dart 4 years ago
Elham Ali 8bdde45d81 Merge branch 'hot_fix' into 'development'
fix the keyborad issue on real device

See merge request Cloud_Solution/doctor_app_flutter!991
4 years ago
Elham Rababh 8c93d5c450 fix the keyborad issue on real device 4 years ago

@ -40,10 +40,12 @@ class BaseAppClient {
try { try {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
if (profile != null) { if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (body['DoctorID'] == null) if (body['DoctorID'] == null) {
body['DoctorID'] = doctorProfile?.doctorID; body['DoctorID'] = doctorProfile?.doctorID;
}
if (body['DoctorID'] == "") body['DoctorID'] = null; if (body['DoctorID'] == "") body['DoctorID'] = null;
if (body['EditedBy'] == null) if (body['EditedBy'] == null)
body['EditedBy'] = doctorProfile?.doctorID; body['EditedBy'] = doctorProfile?.doctorID;
@ -53,17 +55,19 @@ class BaseAppClient {
if (body['ClinicID'] == null) if (body['ClinicID'] == null)
body['ClinicID'] = doctorProfile?.clinicID; body['ClinicID'] = doctorProfile?.clinicID;
} } else {
String doctorID = await sharedPref.getString(DOCTOR_ID);
if (body['DoctorID'] == '') { if (body['DoctorID'] == '') {
body['DoctorID'] = null; body['DoctorID'] = null;
} else if (doctorID != null) body['DoctorID'] = int.parse(doctorID);
} }
if (body['EditedBy'] == '') { if (body['EditedBy'] == '') {
body.remove("EditedBy"); body.remove("EditedBy");
} }
if (body['TokenID'] == null) { if (body['TokenID'] == null) {
body['TokenID'] = token ?? ''; body['TokenID'] = token ?? '';
} }
// body['TokenID'] = "@dm!n" ?? '';
if (!isFallLanguage) { if (!isFallLanguage) {
String lang = await sharedPref.getString(APP_Language); String lang = await sharedPref.getString(APP_Language);
@ -73,7 +77,6 @@ class BaseAppClient {
body['LanguageID'] = 2; body['LanguageID'] = 2;
} }
body['stamp'] = DateTime.now().toIso8601String(); body['stamp'] = DateTime.now().toIso8601String();
// if(!body.containsKey("IPAdress"))
body['IPAdress'] = IP_ADDRESS; body['IPAdress'] = IP_ADDRESS;
if (body['VersionID'] == null) { if (body['VersionID'] == null) {
body['VersionID'] = VERSION_ID; body['VersionID'] = VERSION_ID;
@ -173,6 +176,14 @@ class BaseAppClient {
}; };
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (body['DoctorID'] == null) {
body['DoctorID'] = doctorProfile?.doctorID;
}
}
var languageID = var languageID =
await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); await sharedPref.getStringWithDefaultValue(APP_Language, 'en');
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
@ -220,7 +231,7 @@ class BaseAppClient {
: PATIENT_TYPE_ID : PATIENT_TYPE_ID
: PATIENT_TYPE_ID; : PATIENT_TYPE_ID;
body['TokenID'] = body.containsKey('TokenID') ? body['TokenID'] : token; body['TokenID'] = body.containsKey('TokenID') ? body['TokenID']??token : token;
body['PatientID'] = body['PatientID'] != null body['PatientID'] = body['PatientID'] != null
? body['PatientID'] ? body['PatientID']
: patient.patientId ?? patient.patientMRN; : patient.patientId ?? patient.patientMRN;

@ -384,6 +384,10 @@ const SET_ACCEPTED_OR_REJECTED =
const GET_STP_MASTER_LIST = const GET_STP_MASTER_LIST =
"Services/DoctorApplication.svc/REST/DoctorApp_GetSTPMasterList"; "Services/DoctorApplication.svc/REST/DoctorApp_GetSTPMasterList";
const DOCTOR_ER_SIGN_ASSESSMENT =
"Services/DoctorApplication.svc/REST/DoctorApp_DoctorERSignAssessment";
var selectedPatientType = 1; var selectedPatientType = 1;
//*********change value to decode json from Dropdown ************ //*********change value to decode json from Dropdown ************
@ -434,7 +438,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.7; const VERSION_ID = 8.3;
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;

@ -93,6 +93,10 @@ const Map<String, Map<String, String>> localizedValues = {
"en": "scan Qr code to retrieve patient profile", "en": "scan Qr code to retrieve patient profile",
"ar": "مسح رمزاال QR لاسترداد ملف تعريف المريض" "ar": "مسح رمزاال QR لاسترداد ملف تعريف المريض"
}, },
"scanERQrCode": {
"en": "Scan Qr code to handle ER Sign In",
"ar": "امسح رمز ال ER للتعامل مع تسجيل الدخول"
},
"scanQr": {"en": "Scan Qr", "ar": "اقراء ال QR"}, "scanQr": {"en": "Scan Qr", "ar": "اقراء ال QR"},
"profile": {"en": "Profile", "ar": "ملفي الشخصي"}, "profile": {"en": "Profile", "ar": "ملفي الشخصي"},
"gender": {"en": "Gender", "ar": "الجنس"}, "gender": {"en": "Gender", "ar": "الجنس"},
@ -1129,7 +1133,7 @@ const Map<String, Map<String, String>> localizedValues = {
"VTE_Type": {"en": "VTE Type", "ar": "VTE Type"}, "VTE_Type": {"en": "VTE Type", "ar": "VTE Type"},
"pharmacology": {"en": "Pharmacology", "ar": "علم العقاقير"}, "pharmacology": {"en": "Pharmacology", "ar": "علم العقاقير"},
"reasonsThrombo": {"en": "Reasons Thrombo", "ar": "أسباب ثرومبو"}, "reasonsThrombo": {"en": "Reasons Thrombo", "ar": "أسباب ثرومبو"},
"youDoNotHaveFavoritePrescription": {"en": "You Don't Have Favorite Prescription", "ar": "ليس لديك وصفة طبية مفضلة"}, "youDoNotHaveFavoriteTemplate": {"en": "You Don't Have Favorite Template", "ar": "ليس لديك وصفة طبية مفضلة"},
"pleaseSelectItem": {"en": "please Select Item", "ar": "الرجاء اختيار عنصر"}, "pleaseSelectItem": {"en": "please Select Item", "ar": "الرجاء اختيار عنصر"},
"searchFavoriteTemplate": {"en": "search Favorites Template", "ar": "البحث في قالب المفضلة"}, "searchFavoriteTemplate": {"en": "search Favorites Template", "ar": "البحث في قالب المفضلة"},
"sorryNoMatch": {"en": "Sorry No Match", "ar": "عذرا لا يوجد تطابق"}, "sorryNoMatch": {"en": "Sorry No Match", "ar": "عذرا لا يوجد تطابق"},

@ -0,0 +1,25 @@
class DoctorErSignAssessmentReqModel {
String setupID;
int signInType;
int loginDoctorID;
int patientID;
DoctorErSignAssessmentReqModel(
{this.setupID, this.signInType, this.loginDoctorID, this.patientID});
DoctorErSignAssessmentReqModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
signInType = json['SignInType'];
loginDoctorID = json['LoginDoctorID'];
patientID = json['PatientID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['SignInType'] = this.signInType;
data['LoginDoctorID'] = this.loginDoctorID;
data['PatientID'] = this.patientID;
return data;
}
}

@ -32,6 +32,8 @@ class InsertIMEIDetailsModel {
String vidaAuthTokenID; String vidaAuthTokenID;
String vidaRefreshTokenID; String vidaRefreshTokenID;
dynamic password; dynamic password;
int loginDoctorID;
InsertIMEIDetailsModel( InsertIMEIDetailsModel(
{this.iMEI, {this.iMEI,
@ -66,7 +68,7 @@ class InsertIMEIDetailsModel {
this.patientOutSA, this.patientOutSA,
this.vidaAuthTokenID, this.vidaAuthTokenID,
this.vidaRefreshTokenID, this.vidaRefreshTokenID,
this.password}); this.password, this.loginDoctorID});
InsertIMEIDetailsModel.fromJson(Map<String, dynamic> json) { InsertIMEIDetailsModel.fromJson(Map<String, dynamic> json) {
iMEI = json['IMEI']; iMEI = json['IMEI'];
@ -102,7 +104,7 @@ class InsertIMEIDetailsModel {
vidaAuthTokenID = json['VidaAuthTokenID']; vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID']; vidaRefreshTokenID = json['VidaRefreshTokenID'];
password = json['Password']; password = json['Password'];
} loginDoctorID = json['LoginDoctorID']; }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
@ -139,6 +141,8 @@ class InsertIMEIDetailsModel {
data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID; data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
data['Password'] = this.password; data['Password'] = this.password;
data['LoginDoctorID'] = this.loginDoctorID;
return data; return data;
} }
} }

@ -14,6 +14,8 @@ class PatientSearchRequestModel {
String identificationNo; String identificationNo;
int nursingStationID; int nursingStationID;
int clinicID = 0; int clinicID = 0;
int loginDoctorID;
PatientSearchRequestModel( PatientSearchRequestModel(
{this.doctorID, {this.doctorID,
@ -30,7 +32,7 @@ class PatientSearchRequestModel {
this.to = "0", this.to = "0",
this.clinicID, this.clinicID,
this.nursingStationID = 0, this.nursingStationID = 0,
this.projectID}); this.projectID, this.loginDoctorID});
PatientSearchRequestModel.fromJson(Map<String, dynamic> json) { PatientSearchRequestModel.fromJson(Map<String, dynamic> json) {
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
@ -48,6 +50,7 @@ class PatientSearchRequestModel {
nursingStationID = json['NursingStationID']; nursingStationID = json['NursingStationID'];
clinicID = json['ClinicID']; clinicID = json['ClinicID'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
loginDoctorID = json['LoginDoctorID'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -67,6 +70,7 @@ class PatientSearchRequestModel {
data['NursingStationID'] = this.nursingStationID; data['NursingStationID'] = this.nursingStationID;
data['ClinicID'] = this.clinicID; data['ClinicID'] = this.clinicID;
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;
data['LoginDoctorID'] = this.loginDoctorID;
return data; return data;
} }
} }

@ -1,18 +1,18 @@
class ProcedureValadteRequestModel { class ProcedureValidationRequestModel {
String vidaAuthTokenID; String vidaAuthTokenID;
int patientMRN; int patientMRN;
int appointmentNo; int appointmentNo;
int episodeID; int episodeID;
List<String> procedure; List<String> procedure;
ProcedureValadteRequestModel( ProcedureValidationRequestModel(
{this.vidaAuthTokenID, {this.vidaAuthTokenID,
this.patientMRN, this.patientMRN,
this.appointmentNo, this.appointmentNo,
this.episodeID, this.episodeID,
this.procedure}); this.procedure});
ProcedureValadteRequestModel.fromJson(Map<String, dynamic> json) { ProcedureValidationRequestModel.fromJson(Map<String, dynamic> json) {
vidaAuthTokenID = json['VidaAuthTokenID']; vidaAuthTokenID = json['VidaAuthTokenID'];
patientMRN = json['PatientMRN']; patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo']; appointmentNo = json['AppointmentNo'];

@ -142,7 +142,6 @@ class AuthenticationService extends BaseService {
Future insertDeviceImei(InsertIMEIDetailsModel insertIMEIDetailsModel) async { Future insertDeviceImei(InsertIMEIDetailsModel insertIMEIDetailsModel) async {
hasError = false; hasError = false;
// insertIMEIDetailsModel.tokenID = "@dm!n";
_insertDeviceImeiRes = {}; _insertDeviceImeiRes = {};
try { try {
await baseAppClient.post(INSERT_DEVICE_IMEI, await baseAppClient.post(INSERT_DEVICE_IMEI,

@ -11,8 +11,8 @@ class ScanQrService extends BaseService {
PatientSearchRequestModel requestModel, bool isMyInpatient) async { PatientSearchRequestModel requestModel, bool isMyInpatient) async {
hasError = false; hasError = false;
await getDoctorProfile(); await getDoctorProfile();
requestModel.loginDoctorID = doctorProfile.doctorID;
requestModel.doctorID = 0; requestModel.doctorID = 0;
await baseAppClient.post( await baseAppClient.post(
GET_PATIENT_IN_PATIENT_LIST, GET_PATIENT_IN_PATIENT_LIST,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {

@ -11,7 +11,7 @@ class PatientInPatientService extends BaseService {
PatientSearchRequestModel requestModel, bool isMyInpatient) async { PatientSearchRequestModel requestModel, bool isMyInpatient) async {
hasError = false; hasError = false;
await getDoctorProfile(isGetProfile: true); await getDoctorProfile(isGetProfile: true);
requestModel.loginDoctorID = doctorProfile.doctorID;
if (isMyInpatient) { if (isMyInpatient) {
requestModel.doctorID = doctorProfile.doctorID; requestModel.doctorID = doctorProfile.doctorID;
} else { } else {

@ -168,8 +168,9 @@ class PatientService extends BaseService {
Future getInPatient( Future getInPatient(
PatientSearchRequestModel requestModel, bool isMyInpatient) async { PatientSearchRequestModel requestModel, bool isMyInpatient) async {
hasError = false; hasError = false;
await getDoctorProfile();
await getDoctorProfile();
requestModel.loginDoctorID = doctorProfile.doctorID;
if (isMyInpatient) { if (isMyInpatient) {
requestModel.doctorID = doctorProfile.doctorID; requestModel.doctorID = doctorProfile.doctorID;
} else { } else {

@ -20,7 +20,7 @@ class OperationReportService extends BaseService {
{GetReservationsRequestModel getReservationsRequestModel, {GetReservationsRequestModel getReservationsRequestModel,
int patientId}) async { int patientId}) async {
getReservationsRequestModel = getReservationsRequestModel =
GetReservationsRequestModel(patientID: patientId, doctorID: ""); GetReservationsRequestModel(patientID: patientId);
hasError = false; hasError = false;
await baseAppClient.post(GET_RESERVATIONS, await baseAppClient.post(GET_RESERVATIONS,

@ -0,0 +1,49 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_entity_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart';
import 'package:doctor_app_flutter/core/model/calculate_box_request_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/item_by_medicine_request_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/search_drug_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/search_drug_request_model.dart';
import 'package:doctor_app_flutter/core/service/base/lookup-service.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-data.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:flutter/cupertino.dart';
class ERSignInService extends LookupService {
Future signInERPatient({DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel}) async {
hasError = false;
await baseAppClient.post(DOCTOR_ER_SIGN_ASSESSMENT,
onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: doctorErSignAssessmentReqModel.toJson());
}
}

@ -33,7 +33,6 @@ class PatientMedicalReportService extends BaseService {
Future getMedicalReportTemplate() async { Future getMedicalReportTemplate() async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['TokenID'] = "@dm!n";
body['SetupID'] = "91877"; body['SetupID'] = "91877";
body['TemplateID'] = 43; body['TemplateID'] = 43;
@ -54,7 +53,6 @@ class PatientMedicalReportService extends BaseService {
Future insertMedicalReport(PatiantInformtion patient, String htmlText) async { Future insertMedicalReport(PatiantInformtion patient, String htmlText) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
// body['TokenID'] = "@dm!n";
body['SetupID'] = "91877"; body['SetupID'] = "91877";
body['AdmissionNo'] = patient.admissionNo; body['AdmissionNo'] = patient.admissionNo;
body['MedicalReportHTML'] = htmlText; body['MedicalReportHTML'] = htmlText;
@ -71,7 +69,6 @@ class PatientMedicalReportService extends BaseService {
PatiantInformtion patient, MedicalReportModel medicalReport) async { PatiantInformtion patient, MedicalReportModel medicalReport) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['TokenID'] = "@dm!n";
body['SetupID'] = "91877"; body['SetupID'] = "91877";
body['AdmissionNo'] = patient.admissionNo; body['AdmissionNo'] = patient.admissionNo;
body['InvoiceNo'] = medicalReport.invoiceNo; body['InvoiceNo'] = medicalReport.invoiceNo;
@ -92,7 +89,6 @@ class PatientMedicalReportService extends BaseService {
Future addMedicalReport(PatiantInformtion patient, String htmlText) async { Future addMedicalReport(PatiantInformtion patient, String htmlText) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
// body['TokenID'] = "@dm!n";
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] != null
? body['SetupID'] ? body['SetupID']
@ -117,7 +113,6 @@ class PatientMedicalReportService extends BaseService {
int limitNumber, String invoiceNumber) async { int limitNumber, String invoiceNumber) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
// body['TokenID'] = "@dm!n";
body['LineItemNo'] = limitNumber; body['LineItemNo'] = limitNumber;
body['InvoiceNo'] = invoiceNumber; body['InvoiceNo'] = invoiceNumber;

@ -427,7 +427,6 @@ class PrescriptionService extends LookupService {
GetMedicationForInPatientRequestModel( GetMedicationForInPatientRequestModel(
isDentalAllowedBackend: false, isDentalAllowedBackend: false,
admissionNo: int.parse(patient.admissionNo), admissionNo: int.parse(patient.admissionNo),
tokenID: "@dm!n",
projectID: patient.projectId, projectID: patient.projectId,
); );
await baseAppClient.postPatient(GET_MEDICATION_FOR_IN_PATIENT, await baseAppClient.postPatient(GET_MEDICATION_FOR_IN_PATIENT,

@ -183,8 +183,8 @@ class ProcedureService extends BaseService {
}, body: updateProcedureRequestModel.toJson()); }, body: updateProcedureRequestModel.toJson());
} }
Future valadteProcedure( Future validationProcedure(
ProcedureValadteRequestModel procedureValadteRequestModel) async { ProcedureValidationRequestModel validationProcedureRequestModel) async {
hasError = false; hasError = false;
_valadteProcedureList.clear(); _valadteProcedureList.clear();
await baseAppClient.post(GET_PROCEDURE_VALIDATION, await baseAppClient.post(GET_PROCEDURE_VALIDATION,
@ -194,6 +194,6 @@ class ProcedureService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: procedureValadteRequestModel.toJson()); }, body: validationProcedureRequestModel.toJson());
} }
} }

@ -0,0 +1,41 @@
import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_entity_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-data.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/ER_signin/ER_signin_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:flutter/cupertino.dart';
class ERSignInViewModel extends BaseViewModel {
bool hasError = false;
ERSignInService _ERSignInService = locator<ERSignInService>();
Future signInERPatient({int patientId, int signInType}) async {
hasError = false;
await getDoctorProfile();
DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel = new DoctorErSignAssessmentReqModel(setupID:"010266", signInType:signInType, loginDoctorID:doctorProfile.doctorID, patientID: patientId );
setState(ViewState.BusyLocal);
await _ERSignInService.signInERPatient(doctorErSignAssessmentReqModel: doctorErSignAssessmentReqModel);
if (_ERSignInService.hasError) {
error = _ERSignInService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
}

@ -70,6 +70,7 @@ class PatientSearchViewModel extends BaseViewModel {
setState(ViewState.Busy); setState(ViewState.Busy);
} }
await getDoctorProfile(isGetProfile: true); await getDoctorProfile(isGetProfile: true);
patientSearchRequestModel.loginDoctorID = doctorProfile.doctorID;
patientSearchRequestModel.doctorID = doctorProfile.doctorID; patientSearchRequestModel.doctorID = doctorProfile.doctorID;
await _outPatientService.getOutPatient(patientSearchRequestModel); await _outPatientService.getOutPatient(patientSearchRequestModel);
if (_outPatientService.hasError) { if (_outPatientService.hasError) {

@ -112,6 +112,8 @@ class AuthenticationViewModel extends BaseViewModel {
insertIMEIDetailsModel.vidaRefreshTokenID = insertIMEIDetailsModel.vidaRefreshTokenID =
await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
insertIMEIDetailsModel.password = userInfo.password; insertIMEIDetailsModel.password = userInfo.password;
insertIMEIDetailsModel.loginDoctorID = loggedUser != null ? loggedUser.listMemberInformation[0].employeeID
: int.parse(user.editedBy.toString());
await _authService.insertDeviceImei(insertIMEIDetailsModel); await _authService.insertDeviceImei(insertIMEIDetailsModel);
if (_authService.hasError) { if (_authService.hasError) {
@ -154,6 +156,8 @@ class AuthenticationViewModel extends BaseViewModel {
isMobileFingerPrint: 1, isMobileFingerPrint: 1,
vidaAuthTokenID: user.vidaAuthTokenID, vidaAuthTokenID: user.vidaAuthTokenID,
vidaRefreshTokenID: user.vidaRefreshTokenID); vidaRefreshTokenID: user.vidaRefreshTokenID);
await sharedPref.setString(DOCTOR_ID, user.editedBy.toString());
await _authService await _authService
.sendActivationCodeVerificationScreen(activationCodeModel); .sendActivationCodeVerificationScreen(activationCodeModel);
if (_authService.hasError) { if (_authService.hasError) {
@ -174,6 +178,7 @@ class AuthenticationViewModel extends BaseViewModel {
loginDoctorID: loggedUser.listMemberInformation[0].employeeID, loginDoctorID: loggedUser.listMemberInformation[0].employeeID,
otpSendType: authMethodType.getTypeIdService().toString(), otpSendType: authMethodType.getTypeIdService().toString(),
); );
await sharedPref.setString(DOCTOR_ID, (loggedUser.listMemberInformation[0].employeeID).toString());
await _authService.sendActivationCodeForDoctorApp(activationCodeModel); await _authService.sendActivationCodeForDoctorApp(activationCodeModel);
if (_authService.hasError) { if (_authService.hasError) {
error = _authService.error; error = _authService.error;
@ -189,6 +194,7 @@ class AuthenticationViewModel extends BaseViewModel {
Future checkActivationCodeForDoctorApp( Future checkActivationCodeForDoctorApp(
{String activationCode, bool isSilentLogin = false}) async { {String activationCode, bool isSilentLogin = false}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = CheckActivationCodeRequestModel checkActivationCodeForDoctorApp =
new CheckActivationCodeRequestModel( new CheckActivationCodeRequestModel(
zipCode: loggedUser != null ? loggedUser.zipCode : user.zipCode, zipCode: loggedUser != null ? loggedUser.zipCode : user.zipCode,
@ -208,9 +214,8 @@ class AuthenticationViewModel extends BaseViewModel {
: user.projectID.toString(), : user.projectID.toString(),
oTPSendType: await sharedPref.getInt(OTP_TYPE), oTPSendType: await sharedPref.getInt(OTP_TYPE),
iMEI: localToken, iMEI: localToken,
loginDoctorID: userInfo.userID != null loginDoctorID: loggedUser != null ? loggedUser.listMemberInformation[0].employeeID
? int.parse(userInfo.userID) : int.parse(user.editedBy.toString()),///loggedUser.listMemberInformation[0].employeeID,
: user.editedBy,
// loggedUser.listMemberInformation[0].employeeID, // loggedUser.listMemberInformation[0].employeeID,
isForSilentLogin: isSilentLogin, isForSilentLogin: isSilentLogin,
generalid: "Cs2020@2016\$2958"); generalid: "Cs2020@2016\$2958");

@ -59,6 +59,7 @@ class DashboardViewModel extends BaseViewModel {
_firebaseMessaging.getToken().then((String token) async { _firebaseMessaging.getToken().then((String token) async {
if (token != '') { if (token != '') {
// DEVICE_TOKEN = token; // DEVICE_TOKEN = token;
///TODO Elham* return it back
authProvider.insertDeviceImei(token); authProvider.insertDeviceImei(token);
} }
}); });

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/labs/lab_order_result.dart'; import 'package:doctor_app_flutter/core/model/labs/lab_order_result.dart';
@ -6,7 +7,8 @@ import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart';
import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' as cpe; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'
as cpe;
import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel.dart';
@ -70,9 +72,16 @@ class ProcedureViewModel extends BaseViewModel {
List<ProcedureTempleteDetailsModel> get procedureTemplateDetails => List<ProcedureTempleteDetailsModel> get procedureTemplateDetails =>
_procedureService.templateDetailsList; _procedureService.templateDetailsList;
Future getProcedure({int mrn, String patientType, int appointmentNo}) async { Future getProcedure(
{int mrn,
String patientType,
int appointmentNo,
bool isLocalBusy = false}) async {
hasError = false; hasError = false;
await getDoctorProfile(); await getDoctorProfile();
if (isLocalBusy)
setState(ViewState.BusyLocal);
else
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.getProcedure( await _procedureService.getProcedure(
mrn: mrn, appointmentNo: appointmentNo); mrn: mrn, appointmentNo: appointmentNo);
@ -87,9 +96,15 @@ class ProcedureViewModel extends BaseViewModel {
} }
Future getProcedureCategory( Future getProcedureCategory(
{String categoryName, String categoryID, patientId}) async { {String categoryName,
String categoryID,
patientId,
bool isLocalBusy = false}) async {
if (categoryName == null) return; if (categoryName == null) return;
hasError = false; hasError = false;
if (isLocalBusy)
setState(ViewState.BusyLocal);
else
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.getProcedureCategory( await _procedureService.getProcedureCategory(
categoryName: categoryName, categoryName: categoryName,
@ -114,13 +129,17 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getProcedureTemplate({String categoryID, bool isLocalBusy = false, BuildContext context}) async { Future getProcedureTemplate(
{String categoryID,
bool isLocalBusy = false,
BuildContext context}) async {
if (isLocalBusy) { if (isLocalBusy) {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
} else { } else {
setState(ViewState.Busy); setState(ViewState.Busy);
} }
await _procedureService.getProcedureTemplate(categoryID: categoryID, isLocalBusy: false); await _procedureService.getProcedureTemplate(
categoryID: categoryID, isLocalBusy: false);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -166,27 +185,33 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future postProcedure( Future postProcedure(PostProcedureReqModel postProcedureReqModel, int mrn,
PostProcedureReqModel postProcedureReqModel, int mrn) async { {bool isLocalBusy = false}) async {
hasError = false; hasError = false;
//_insuranceCardService.clearInsuranceCard(); if (isLocalBusy)
setState(ViewState.BusyLocal);
else
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.postProcedure(postProcedureReqModel); await _procedureService.postProcedure(postProcedureReqModel);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else { } else {
await getProcedure(mrn: mrn); await getProcedure(mrn: mrn, isLocalBusy:isLocalBusy);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future valadteProcedure( Future validationProcedure(
ProcedureValadteRequestModel procedureValadteRequestModel) async { ProcedureValidationRequestModel procedureValidateRequestModel,
{bool isLocalBusy = false}) async {
hasError = false; hasError = false;
//_insuranceCardService.clearInsuranceCard(); if (isLocalBusy) {
setState(ViewState.BusyLocal);
} else {
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.valadteProcedure(procedureValadteRequestModel); }
await _procedureService.validationProcedure(procedureValidateRequestModel);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -197,9 +222,9 @@ class ProcedureViewModel extends BaseViewModel {
Future updateProcedure( Future updateProcedure(
{UpdateProcedureRequestModel updateProcedureRequestModel, {UpdateProcedureRequestModel updateProcedureRequestModel,
int mrn}) async { int mrn, bool isLocalBusy = false}) async {
hasError = false; hasError = false;
//_insuranceCardService.clearInsuranceCard(); if(isLocalBusy)setState(ViewState.BusyLocal); else
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.updateProcedure(updateProcedureRequestModel); await _procedureService.updateProcedure(updateProcedureRequestModel);
if (_procedureService.hasError) { if (_procedureService.hasError) {
@ -365,15 +390,14 @@ class ProcedureViewModel extends BaseViewModel {
DrAppToastMsg.showSuccesToast(mes); DrAppToastMsg.showSuccesToast(mes);
} }
Future preparePostProcedure( Future preparePostProcedure({
{String remarks, String remarks,
String orderType, String orderType,
PatiantInformtion patient, PatiantInformtion patient,
List<cpe.EntityList> entityList, List<cpe.EntityList> entityList,
ProcedureType procedureType, ProcedureType procedureType,
bool isLocalBusy = false, bool isLocalBusy = false,
}) async { }) async {
///TODO Roaa Move it to function ///TODO Roaa Move it to function
if (isLocalBusy) { if (isLocalBusy) {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
@ -381,8 +405,8 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Busy); setState(ViewState.Busy);
} }
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
ProcedureValadteRequestModel procedureValadteRequestModel = ProcedureValidationRequestModel procedureValadteRequestModel =
new ProcedureValadteRequestModel(); new ProcedureValidationRequestModel();
procedureValadteRequestModel.patientMRN = patient.patientMRN; procedureValadteRequestModel.patientMRN = patient.patientMRN;
procedureValadteRequestModel.episodeID = patient.episodeNo; procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo; procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
@ -415,16 +439,22 @@ class ProcedureViewModel extends BaseViewModel {
}); });
postProcedureReqModel.procedures = controlsProcedure; postProcedureReqModel.procedures = controlsProcedure;
await valadteProcedure(procedureValadteRequestModel); await validationProcedure(procedureValadteRequestModel,
isLocalBusy: isLocalBusy);
if (state == ViewState.Idle) { if (state == ViewState.Idle) {
if (valadteProcedureList[0].entityList.length == 0) { if (valadteProcedureList[0].entityList.length == 0) {
await postProcedure(postProcedureReqModel, patient.patientMRN); await postProcedure(postProcedureReqModel, patient.patientMRN,
isLocalBusy: isLocalBusy);
if (state == ViewState.ErrorLocal) { if (state == ViewState.ErrorLocal) {
Utils.showErrorToast(error); Utils.showErrorToast(error);
getProcedure(mrn: patient.patientMRN); getProcedure(mrn: patient.patientMRN, isLocalBusy: isLocalBusy);
} else if (state == ViewState.Idle) { } else if (state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been added'); DrAppToastMsg.showSuccesToast('procedure has been added');
if (Navigator.canPop(AppGlobal.CONTEX))
Navigator.pop(AppGlobal.CONTEX);
if (Navigator.canPop(AppGlobal.CONTEX))
Navigator.pop(AppGlobal.CONTEX);
} }
} else { } else {
if (state == ViewState.ErrorLocal) { if (state == ViewState.ErrorLocal) {
@ -440,15 +470,18 @@ class ProcedureViewModel extends BaseViewModel {
} }
} }
bool isEntityListSelected(cpe.EntityList masterKey, List<cpe.EntityList> entityList) { bool isEntityListSelected(
Iterable<cpe.EntityList> history = entityList.where((element) => masterKey.procedureId == element.procedureId); cpe.EntityList masterKey, List<cpe.EntityList> entityList) {
Iterable<cpe.EntityList> history = entityList
.where((element) => masterKey.procedureId == element.procedureId);
if (history.length > 0) { if (history.length > 0) {
return true; return true;
} }
return false; return false;
} }
bool isProcedureEntityListSelected(ProcedureTempleteDetailsModel masterKey, List<ProcedureTempleteDetailsModel> entityList) { bool isProcedureEntityListSelected(ProcedureTempleteDetailsModel masterKey,
List<ProcedureTempleteDetailsModel> entityList) {
Iterable<ProcedureTempleteDetailsModel> history = entityList.where( Iterable<ProcedureTempleteDetailsModel> history = entityList.where(
(element) => (element) =>
masterKey.templateID == element.templateID && masterKey.templateID == element.templateID &&
@ -459,13 +492,12 @@ class ProcedureViewModel extends BaseViewModel {
return false; return false;
} }
Future addProcedures(
ProcedureViewModel model,
Future addProcedures(ProcedureViewModel model,
List<ProcedureTempleteDetailsModel> items, List<ProcedureTempleteDetailsModel> items,
PatiantInformtion patient, PatiantInformtion patient,
TextEditingController remarksController, TextEditingController remarksController,
{bool isLocalBusy = false,}) async { {bool isLocalBusy = false}) async {
if (isLocalBusy) { if (isLocalBusy) {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
} else { } else {
@ -489,11 +521,12 @@ class ProcedureViewModel extends BaseViewModel {
await model.preparePostProcedure( await model.preparePostProcedure(
entityList: entityList, entityList: entityList,
patient: patient, patient: patient,
remarks: remarksController.text); remarks: remarksController.text,
isLocalBusy: isLocalBusy);
} }
Future filterSearchResults(String query,List<cpe.EntityList> masterList, List<cpe.EntityList> items) async { Future filterSearchResults(String query, List<cpe.EntityList> masterList,
List<cpe.EntityList> items) async {
List<cpe.EntityList> dummySearchList = List(); List<cpe.EntityList> dummySearchList = List();
dummySearchList.addAll(masterList); dummySearchList.addAll(masterList);
if (query.isNotEmpty) { if (query.isNotEmpty) {
@ -511,8 +544,12 @@ class ProcedureViewModel extends BaseViewModel {
} }
} }
void filterProcedureSearchResults(String query, List<ProcedureTempleteModel> masterList, List<ProcedureTempleteModel> items) { void filterProcedureSearchResults(
String query,
List<ProcedureTempleteModel> masterList,
List<ProcedureTempleteModel> items) {
List<ProcedureTempleteModel> dummySearchList = List(); List<ProcedureTempleteModel> dummySearchList = List();
if(masterList!= null)
dummySearchList.addAll(masterList); dummySearchList.addAll(masterList);
if (query.isNotEmpty) { if (query.isNotEmpty) {
List<ProcedureTempleteModel> dummyListData = List(); List<ProcedureTempleteModel> dummyListData = List();

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/core/service/authentication_service.dart'; import 'package:doctor_app_flutter/core/service/authentication_service.dart';
import 'package:doctor_app_flutter/core/service/home/scan_qr_service.dart'; import 'package:doctor_app_flutter/core/service/home/scan_qr_service.dart';
import 'package:doctor_app_flutter/core/service/patient/profile/discharge_summary_servive.dart'; import 'package:doctor_app_flutter/core/service/patient/profile/discharge_summary_servive.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/ER_signin/ER_signin_service.dart';
import 'package:doctor_app_flutter/core/service/pending_order_service.dart'; import 'package:doctor_app_flutter/core/service/pending_order_service.dart';
import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/hospitals_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/hospitals_view_model.dart';
@ -50,6 +51,7 @@ import 'core/service/patient_medical_file/ucaf/patient-ucaf-service.dart';
import 'core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart'; import 'core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart';
import 'core/service/special_clinics/special_clinic_service.dart'; import 'core/service/special_clinics/special_clinic_service.dart';
import 'core/viewModel/DischargedPatientViewModel.dart'; import 'core/viewModel/DischargedPatientViewModel.dart';
import 'core/viewModel/ER_sign_in/ER_sign_in_view_model.dart';
import 'core/viewModel/InsuranceViewModel.dart'; import 'core/viewModel/InsuranceViewModel.dart';
import 'core/viewModel/LiveCarePatientViewModel.dart'; import 'core/viewModel/LiveCarePatientViewModel.dart';
import 'core/viewModel/PatientMedicalReportViewModel.dart'; import 'core/viewModel/PatientMedicalReportViewModel.dart';
@ -114,6 +116,8 @@ void setupLocator() {
locator.registerLazySingleton(() => DischargeSummaryService()); locator.registerLazySingleton(() => DischargeSummaryService());
locator.registerLazySingleton(() => VteAssessmentService()); locator.registerLazySingleton(() => VteAssessmentService());
locator.registerLazySingleton(() => InterventionMedicationService()); locator.registerLazySingleton(() => InterventionMedicationService());
locator.registerLazySingleton(() => ERSignInService());
/// View Model /// View Model
locator.registerFactory(() => DoctorReplayViewModel()); locator.registerFactory(() => DoctorReplayViewModel());
@ -147,4 +151,5 @@ void setupLocator() {
locator.registerFactory(() => DischargeSummaryViewModel()); locator.registerFactory(() => DischargeSummaryViewModel());
locator.registerFactory(() => VteAssessmentViewModel()); locator.registerFactory(() => VteAssessmentViewModel());
locator.registerFactory(() => InterventionMedicationViewModel()); locator.registerFactory(() => InterventionMedicationViewModel());
locator.registerFactory(() => ERSignInViewModel());
} }

@ -0,0 +1,227 @@
import 'package:barcode_scan2/barcode_scan2.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/scan_qr_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../routes.dart';
import '../base/base_view.dart';
Utils helpers = Utils();
class ErSignInScreen extends StatefulWidget {
@override
_ErSignInScreenState createState() => _ErSignInScreenState();
}
class _ErSignInScreenState extends State<ErSignInScreen> {
ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<ERSignInViewModel>(
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBar: PatientSearchHeader(title: "ER Sign In",)
,
body: Center(
child: Container(
margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7),
child: FractionallySizedBox(
widthFactor: 0.9,
child: ListView(
children: [
AppText(
TranslationBase.of(context).startScanning,
fontSize: 18,
fontWeight: FontWeight.bold,
textAlign: TextAlign.center,
),
SizedBox(
height: 7,
),
AppText(TranslationBase.of(context).scanERQrCode,
fontSize: 14,
fontWeight: FontWeight.w400,
textAlign: TextAlign.center),
SizedBox(
height: 15,
),
Container(
height: 150,
child: Image.asset('assets/images/qr_code.png'),
),
SizedBox(
height: 35,
),
AppButton(
title: TranslationBase.of(context).scanQr,
onPressed: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "ErSigninScreen",
eventAction: "Scan QR",
);
_scanQrAndGetPatient(context, model);
},
icon: Image.asset('assets/images/qr_code_white.png'),
),
],
),
),
),
),
),
);
}
_scanQrAndGetPatient(BuildContext context, ERSignInViewModel model) async {
var result = (await BarcodeScanner.scan()).rawContent;
if (result != "") {
try{
List<String> listOfParams = result.split(',');
int patientID = 0;
if (listOfParams[0].length != 0)
patientID = int.parse(listOfParams[0]);
showMyDialog(context:context, firstAction: (){
signInERPatient(context: context, model: model, patientId: patientID, signInType: 1);
} , secondAction: (){
signInERPatient(context: context, model: model, patientId: patientID, signInType: 2);
} );
}catch(e){
Utils.showErrorToast("Please Enter Valid Code");
}
}
}
signInERPatient ({BuildContext context, ERSignInViewModel model, patientId, signInType}) async {
GifLoaderDialogUtils.showMyDialog(context);
await model.signInERPatient(patientId:patientId, signInType: signInType );
if(model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
/// TODO Elham* Create this in Utils
DrAppToastMsg.showSuccesToast("Add successfully");
}
GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pop();
}
/// TODO Elham* Make this as custom Dialog
showMyDialog({BuildContext context, Function firstAction,Function secondAction, }) {
showDialog(
context: context,
builder: (ctx) => Center(
child: Container(
width: MediaQuery.of(context).size.width * 0.8,
height: 250,
child: AppScaffold(
isShowAppBar: false,
body: Container(
color: Colors.white,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// SizedBox(height: 20,),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
"Select option",
fontWeight: FontWeight.w600,
color: Colors.black,
fontSize: 16,
),
],
),
SizedBox(
height: 10,
),
DividerWithSpacesAround(),
SizedBox(
height: 12,
),
Container(
padding: EdgeInsets.all(20),
color: Colors.white,
child: AppText(
projectViewModel.isArabic
? "الرجاء اختيار الإجراء الذي تريد القيام به"
: 'Please choose the action you want to do ',
fontSize: 15,
textAlign: TextAlign.center,
),
),
SizedBox(
height: 8,
),
DividerWithSpacesAround(),
FractionallySizedBox(
widthFactor: 0.75,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
FlatButton(
child: AppText(
"Sing In",
fontWeight: FontWeight.w600,
color: Colors.black,
fontSize: 16,
), //Text("Cancel"),
onPressed: () async {
await firstAction();
}),
FlatButton(
child: AppText(
"Sing Out",
fontWeight: FontWeight.w600,
color: Colors.black,
fontSize: 16,
), //Text("Confirm", ),
onPressed: () async {
await secondAction();
})
],
),
)
],
),
),
),
),
),
));
}
}

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/core/viewModel/dashboard_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/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/screens/ER_singin/ER_singin_screen.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/home/dashboard_slider-item-widget.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_slider-item-widget.dart';
import 'package:doctor_app_flutter/screens/home/dashboard_swipe_widget.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_swipe_widget.dart';
@ -405,6 +406,24 @@ class _HomeScreenState extends State<HomeScreen> {
changeColorIndex(); changeColorIndex();
} }
patientCards.add(HomePatientCard(
gradient: backgroundColors[colorIndex],
backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.qr_reader,
textColor: textColors[colorIndex],
text: "ER sign In" ,
onTap: () {
Navigator.push(
context,
FadePage(
page: ErSignInScreen(
),
),
);
},
));
changeColorIndex();
patientCards.add(HomePatientCard( patientCards.add(HomePatientCard(
gradient: backgroundColors[colorIndex], gradient: backgroundColors[colorIndex],
backgroundIconColor: backgroundIconColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex],

@ -84,7 +84,7 @@ class _LabsHomePageState extends State<LabsHomePage> {
MaterialPageRoute( MaterialPageRoute(
builder: (context) => BaseAddProcedureTabPage( builder: (context) => BaseAddProcedureTabPage(
patient: patient, patient: patient,
model: model, previousProcedureViewModel: model,
procedureType: ProcedureType.LAB_RESULT, procedureType: ProcedureType.LAB_RESULT,
), ),
settings: RouteSettings(name: 'AddProcedureTabPage'), settings: RouteSettings(name: 'AddProcedureTabPage'),

@ -283,6 +283,9 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
.patientProgressNoteList[ .patientProgressNoteList[
index] index]
.lineItemNo, .lineItemNo,
conditionId: model
.patientProgressNoteList[
index].condition,
createdBy: model createdBy: model
.patientProgressNoteList[ .patientProgressNoteList[
index] index]
@ -364,6 +367,9 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
admissionNo: int admissionNo: int
.parse(patient .parse(patient
.admissionNo), .admissionNo),
conditionId: model
.patientProgressNoteList[
index].condition,
cancelledNote: true, cancelledNote: true,
lineItemNo: model lineItemNo: model
.patientProgressNoteList[ .patientProgressNoteList[
@ -586,6 +592,8 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
); );
} }
/// TODO Elham* Make this as custom Dialog
showMyDialog({BuildContext context, Function confirmFun, String actionName}) { showMyDialog({BuildContext context, Function confirmFun, String actionName}) {
showDialog( showDialog(
context: context, context: context,

@ -197,8 +197,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
.progressNote, .progressNote,
//TranslationBase.of(context).addProgressNote, //TranslationBase.of(context).addProgressNote,
controller: progressNoteController, controller: progressNoteController,
maxLines: 35, maxLines: 40,
minLines: 25, minLines: 20,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,

@ -88,7 +88,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
SlideUpPageRoute( SlideUpPageRoute(
widget: BaseAddProcedureTabPage( widget: BaseAddProcedureTabPage(
patient: patient, patient: patient,
model: model, previousProcedureViewModel: model,
procedureType: ProcedureType.RADIOLOGY, procedureType: ProcedureType.RADIOLOGY,
), ),
settingRoute: 'AddProcedureTabPage'), settingRoute: 'AddProcedureTabPage'),
@ -96,6 +96,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
}, },
label: TranslationBase.of(context).applyForRadiologyOrder, label: TranslationBase.of(context).applyForRadiologyOrder,
), ),
///TODO Elham * fix this to be list view builder
...List.generate( ...List.generate(
model.radiologyList.length, model.radiologyList.length,
(index) => Container( (index) => Container(

@ -293,8 +293,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
model.medicationControllerError = ''; model.medicationControllerError = '';
model.illnessControllerError = ''; model.illnessControllerError = '';
if (complaintsController.text.isNotEmpty && if (complaintsController.text.isNotEmpty &&
illnessController.text.isNotEmpty && illnessController.text.isNotEmpty) {
complaintsController.text.length > 25) {
await model.postSubjectServices( await model.postSubjectServices(
patientInfo: widget.patientInfo, patientInfo: widget.patientInfo,
complaintsText: complaintsController.text, complaintsText: complaintsController.text,
@ -312,9 +311,6 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
if (complaintsController.text.isEmpty) { if (complaintsController.text.isEmpty) {
model.complaintsControllerError = model.complaintsControllerError =
TranslationBase.of(context).emptyMessage; TranslationBase.of(context).emptyMessage;
} else if (complaintsController.text.length < 25) {
model.complaintsControllerError =
TranslationBase.of(context).chiefComplaintLength;
} }
if (illnessController.text.isEmpty) { if (illnessController.text.isEmpty) {

@ -46,6 +46,7 @@ class PrescriptionItemsPage extends StatelessWidget {
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * .9,
child: Column( child: Column(
children: [ children: [
ListView.builder( ListView.builder(

@ -1,19 +1,19 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/procedures/procedure_type.dart'; import 'package:doctor_app_flutter/screens/procedures/procedure_type.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../config/config.dart';
import 'entity_list_checkbox_search_widget.dart'; import 'entity_list_checkbox_search_widget.dart';
class AddProcedurePage extends StatefulWidget { class AddProcedurePage extends StatefulWidget {
@ -65,6 +65,9 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
AppScaffold( AppScaffold(
isShowAppBar: false, isShowAppBar: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: FractionallySizedBox(
widthFactor: .97,
child: Center(
child: Column( child: Column(
children: [ children: [
Container( Container(
@ -118,18 +121,28 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
), ),
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () { onTap: () async {
if (procedureName.text.isNotEmpty && if (procedureName.text.isNotEmpty &&
procedureName.text.length >= 3) procedureName.text.length >= 3) {
model.getProcedureCategory( GifLoaderDialogUtils.showMyDialog(
context);
await model.getProcedureCategory(
patientId: patient.patientId, patientId: patient.patientId,
categoryName: categoryName: procedureName.text,
procedureName.text); isLocalBusy: true);
else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
}
GifLoaderDialogUtils.hideDialog(
context);
} else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
TranslationBase.of(context) TranslationBase.of(context)
.atLeastThreeCharacters, .atLeastThreeCharacters,
); );
}
}, },
child: Icon( child: Icon(
Icons.search, Icons.search,
@ -149,8 +162,7 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
baseViewModel: model, baseViewModel: model,
child: EntityListCheckboxSearchWidget( child: EntityListCheckboxSearchWidget(
model: widget.model, model: widget.model,
masterList: masterList: model.categoriesList[0].entityList,
model.categoriesList[0].entityList,
removeProcedure: (item) { removeProcedure: (item) {
setState(() { setState(() {
entityList.remove(item); entityList.remove(item);
@ -161,27 +173,31 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
entityList.add(history); entityList.add(history);
}); });
}, },
addSelectedHistories: () { addSelectedHistories: () {},
}, isEntityListSelected: (master) => widget.model
isEntityListSelected: (master) => .isEntityListSelected(master, entityList),
widget.model.isEntityListSelected(master,entityList),
)), )),
SizedBox(height: 10,) SizedBox(
height: 10,
)
], ],
), ),
), ),
), ),
), ),
Container( ],
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), ),
child: Wrap( ),
alignment: WrapAlignment.center, ),
children: <Widget>[ ),
AppButton( bottomSheet: model.state == ViewState.BusyLocal || entityList.isEmpty
title: procedureType.getAddButtonTitle(context), ? Container(
fontWeight: FontWeight.w700, height: 0,
color: AppGlobal.appGreenColor, )
onPressed: () async { : CustomBottomSheetContainer(
label: procedureType.getAddButtonTitle(context),
onTap: () async {
{
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
if (entityList.isEmpty == true) { if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
@ -192,7 +208,7 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
return; return;
} }
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await this.model.preparePostProcedure( await widget.model.preparePostProcedure(
orderType: selectedType.toString(), orderType: selectedType.toString(),
entityList: entityList, entityList: entityList,
patient: patient, patient: patient,
@ -200,15 +216,9 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
procedureType: ProcedureType.PROCEDURE, procedureType: ProcedureType.PROCEDURE,
isLocalBusy: true, isLocalBusy: true,
); );
Navigator.pop(context); GifLoaderDialogUtils.hideDialog(context);
}, }
), }),
],
),
),
],
),
),
), ),
); );
} }

@ -1,27 +1,26 @@
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/screens/prescription/add_prescription/add_prescription.dart'; import 'package:doctor_app_flutter/screens/prescription/add_prescription/add_prescription.dart';
import 'package:doctor_app_flutter/screens/procedures/favorite_procedure/add_favourite_procedure.dart';
import 'package:doctor_app_flutter/screens/procedures/add_procedure_page.dart'; import 'package:doctor_app_flutter/screens/procedures/add_procedure_page.dart';
import 'package:doctor_app_flutter/screens/procedures/favorite_procedure/add_favourite_procedure.dart';
import 'package:doctor_app_flutter/screens/procedures/procedure_type.dart'; import 'package:doctor_app_flutter/screens/procedures/procedure_type.dart';
import 'package:doctor_app_flutter/screens/procedures/tab_widget.dart'; import 'package:doctor_app_flutter/screens/procedures/tab_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/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';
class BaseAddProcedureTabPage extends StatefulWidget { class BaseAddProcedureTabPage extends StatefulWidget {
final ProcedureViewModel model; final ProcedureViewModel previousProcedureViewModel;
final PrescriptionViewModel prescriptionModel; final PrescriptionViewModel prescriptionModel;
final PatiantInformtion patient; final PatiantInformtion patient;
final ProcedureType procedureType; final ProcedureType procedureType;
const BaseAddProcedureTabPage( const BaseAddProcedureTabPage(
{Key key, {Key key,
this.model, this.previousProcedureViewModel,
this.prescriptionModel, this.prescriptionModel,
this.patient, this.patient,
@required this.procedureType}) @required this.procedureType})
@ -29,16 +28,15 @@ class BaseAddProcedureTabPage extends StatefulWidget {
@override @override
_BaseAddProcedureTabPageState createState() => _BaseAddProcedureTabPageState( _BaseAddProcedureTabPageState createState() => _BaseAddProcedureTabPageState(
patient: patient, model: model, procedureType: procedureType); patient: patient, procedureType: procedureType);
} }
class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage> class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
final ProcedureViewModel model;
final PatiantInformtion patient; final PatiantInformtion patient;
final ProcedureType procedureType; final ProcedureType procedureType;
_BaseAddProcedureTabPageState({this.patient, this.model, this.procedureType}); _BaseAddProcedureTabPageState({this.patient, this.procedureType});
TabController _tabController; TabController _tabController;
int _activeTab = 0; int _activeTab = 0;
@ -68,20 +66,25 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
await model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId()); if (widget.previousProcedureViewModel == null) {
await model.getProcedureTemplate(
categoryID: widget.procedureType.getCategoryId());
}
}, },
builder: (BuildContext context, ProcedureViewModel model, Widget child) => builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold( AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBar: BottomSheetTitle(title: procedureType.getToolbarLabel(context),), appBar: BottomSheetTitle(
title: procedureType.getToolbarLabel(context),
),
body: NetworkBaseView( body: NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: Scaffold( child: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
appBar: PreferredSize( appBar: PreferredSize(
preferredSize: Size.fromHeight( preferredSize:
MediaQuery.of(context).size.height * 0.070), Size.fromHeight(MediaQuery.of(context).size.height * 0.070),
child: TabBar( child: TabBar(
isScrollable: false, isScrollable: false,
controller: _tabController, controller: _tabController,
@ -89,24 +92,16 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
indicatorWeight: 1.0, indicatorWeight: 1.0,
indicatorSize: TabBarIndicatorSize.tab, indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor,
labelPadding: EdgeInsets.only( labelPadding:
top: 0, left: 0, right: 0, bottom: 0), EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0),
unselectedLabelColor: Colors.grey[800], unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [
TabWidget.tabWidget( TabWidget.tabWidget(screenSize, _activeTab == 0,
screenSize, procedureType.getFavouriteTabName(context),
_activeTab == 0, isFirst: true, context: context),
TabWidget.tabWidget(screenSize, _activeTab == 1,
procedureType
.getFavouriteTabName(context),
isFirst: true,context: context
),
TabWidget.tabWidget(
screenSize,
_activeTab == 1,
procedureType.getAllLabelName(context), procedureType.getAllLabelName(context),
isLast: true,context: context isLast: true, context: context),
),
], ],
), ),
), ),
@ -118,14 +113,13 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
controller: _tabController, controller: _tabController,
children: [ children: [
AddFavouriteProcedure( AddFavouriteProcedure(
previousProcedureViewModel: model, previousProcedureViewModel:
prescriptionModel: widget.previousProcedureViewModel ?? model,
widget.prescriptionModel, prescriptionModel: widget.prescriptionModel,
patient: patient, patient: patient,
procedureType: procedureType, procedureType: procedureType,
), ),
if (widget.procedureType == if (widget.procedureType == ProcedureType.PRESCRIPTION)
ProcedureType.PRESCRIPTION)
AddPrescription( AddPrescription(
widget.prescriptionModel, widget.prescriptionModel,
widget.patient, widget.patient,
@ -133,7 +127,7 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
) )
else else
AddProcedurePage( AddProcedurePage(
model: this.model, model: widget.previousProcedureViewModel?? model,
patient: patient, patient: patient,
procedureType: procedureType, procedureType: procedureType,
), ),
@ -142,8 +136,7 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
), ),
], ],
), ),
) )),
),
), ),
); );
} }

@ -1,13 +1,15 @@
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart'; import 'package:doctor_app_flutter/utils/utils.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/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.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:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../config/config.dart'; import '../../config/config.dart';
class EntityListCheckboxSearchWidget extends StatefulWidget { class EntityListCheckboxSearchWidget extends StatefulWidget {
@ -18,16 +20,15 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
final bool Function(EntityList) isEntityListSelected; final bool Function(EntityList) isEntityListSelected;
final List<EntityList> masterList; final List<EntityList> masterList;
EntityListCheckboxSearchWidget( EntityListCheckboxSearchWidget({
{Key key, Key key,
this.model, this.model,
this.addSelectedHistories, this.addSelectedHistories,
this.removeProcedure, this.removeProcedure,
this.masterList, this.masterList,
this.addProcedure, this.addProcedure,
this.isEntityListSelected, this.isEntityListSelected,
}) }) : super(key: key);
: super(key: key);
@override @override
_EntityListCheckboxSearchWidgetState createState() => _EntityListCheckboxSearchWidgetState createState() =>
@ -80,7 +81,8 @@ class _EntityListCheckboxSearchWidgetState
suffixIcon: EvaIcons.search, suffixIcon: EvaIcons.search,
suffixIconColor: Color(0xff2B353E), suffixIconColor: Color(0xff2B353E),
onChanged: (value) { onChanged: (value) {
widget.model.filterSearchResults(value, widget.masterList, items); widget.model.filterSearchResults(
value, widget.masterList, items);
}, },
hasBorder: false, hasBorder: false,
), ),
@ -106,8 +108,8 @@ class _EntityListCheckboxSearchWidgetState
widget.removeProcedure( widget.removeProcedure(
historyInfo); historyInfo);
} else { } else {
widget widget.addProcedure(
.addProcedure(historyInfo); historyInfo);
} }
}); });
}), }),
@ -116,7 +118,7 @@ class _EntityListCheckboxSearchWidgetState
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0), horizontal: 10, vertical: 0),
child: AppText( child: AppText(
historyInfo.procedureName, Utils.convertToTitleCase( historyInfo.procedureName),
fontSize: 14.0, fontSize: 14.0,
variant: "bodyText", variant: "bodyText",
bold: true, bold: true,

@ -86,7 +86,6 @@ class _ExpansionProcedureState extends State<ExpansionProcedure> {
color: AppGlobal.appTextColor, color: AppGlobal.appTextColor,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
), ),
], ],
@ -176,7 +175,8 @@ class _ExpansionProcedureState extends State<ExpansionProcedure> {
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0), horizontal: 10, vertical: 0),
child: AppText( child: AppText(
Utils.convertToTitleCase(itemProcedure.procedureName), Utils.convertToTitleCase(
itemProcedure.procedureName),
fontSize: 14.0, fontSize: 14.0,
variant: "bodyText", variant: "bodyText",
bold: true, bold: true,

@ -1,7 +1,7 @@
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_checkout_screen.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_checkout_screen.dart';
import 'package:doctor_app_flutter/screens/procedures/favorite_procedure/entity_list_fav_procedure.dart'; import 'package:doctor_app_flutter/screens/procedures/favorite_procedure/entity_list_fav_procedure.dart';
@ -48,7 +48,6 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
Widget child) => Widget child) =>
AppScaffold( AppScaffold(
isShowAppBar: false, isShowAppBar: false,
baseViewModel: model,
body: Column(children: [ body: Column(children: [
(widget.previousProcedureViewModel.templateList.length != 0) (widget.previousProcedureViewModel.templateList.length != 0)
? Expanded( ? Expanded(
@ -67,7 +66,8 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
}); });
}, },
isEntityFavListSelected: (master) => isEntityFavListSelected: (master) =>
procedureViewModel.isProcedureEntityListSelected(master, entityList), procedureViewModel.isProcedureEntityListSelected(
master, entityList),
groupProcedures: groupProcedures, groupProcedures: groupProcedures,
selectProcedures: (selectedProcedure) { selectProcedures: (selectedProcedure) {
setState(() { setState(() {
@ -78,10 +78,10 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
) )
: ErrorMessage( : ErrorMessage(
error: TranslationBase.of(context) error: TranslationBase.of(context)
.youDoNotHaveFavoritePrescription, .youDoNotHaveFavoriteTemplate,
), ),
]), ]),
bottomSheet: CustomBottomSheetContainer( bottomSheet: widget.previousProcedureViewModel.templateList.length == 0?Container(height: 0,):CustomBottomSheetContainer(
label: widget.procedureType.getAddButtonTitle(context) ?? label: widget.procedureType.getAddButtonTitle(context) ??
TranslationBase.of(context).addSelectedProcedures, TranslationBase.of(context).addSelectedProcedures,
onTap: () async { onTap: () async {
@ -117,7 +117,8 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
MaterialPageRoute( MaterialPageRoute(
builder: (context) => ProcedureCheckOutScreen( builder: (context) => ProcedureCheckOutScreen(
items: entityList, items: entityList,
model: model, previousProcedureViewModel:
widget.previousProcedureViewModel,
patient: widget.patient, patient: widget.patient,
addButtonTitle: widget.procedureType addButtonTitle: widget.procedureType
.getAddButtonTitle(context), .getAddButtonTitle(context),

@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import '../../../config/config.dart'; import '../../../config/config.dart';
import '../../../widgets/shared/text_fields/app_text_field_custom_serach.dart'; import '../../../widgets/shared/text_fields/app_text_field_custom_serach.dart';
@ -76,7 +77,6 @@ class _EntityListCheckboxSearchFavProceduresWidgetState
TextEditingController remarksController = TextEditingController(); TextEditingController remarksController = TextEditingController();
TextEditingController patientFileInfoController = TextEditingController(); TextEditingController patientFileInfoController = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView( return SingleChildScrollView(
@ -88,19 +88,18 @@ class _EntityListCheckboxSearchFavProceduresWidgetState
child: Container( child: Container(
margin: EdgeInsets.only(top: 15), margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8), color: Colors.white),
color: Colors.white),
child: ListView( child: ListView(
children: [ children: [
AppTextFieldCustomSearch( AppTextFieldCustomSearch(
searchController: patientFileInfoController, searchController: patientFileInfoController,
onChangeFun: (value) { onChangeFun: (value) {
widget.model.filterProcedureSearchResults(value, widget.masterList, items); widget.model.filterProcedureSearchResults(
value, widget.masterList, items);
}, },
marginTop: 5, marginTop: 5,
inputFormatters: [ inputFormatters: [
FilteringTextInputFormatter.allow( FilteringTextInputFormatter.allow(RegExp(ONLY_LETTERS))
RegExp(ONLY_LETTERS))
], ],
inputType: TextInputType.text, inputType: TextInputType.text,
hintText: TranslationBase.of(context).searchFavoriteTemplate, hintText: TranslationBase.of(context).searchFavoriteTemplate,
@ -110,16 +109,14 @@ class _EntityListCheckboxSearchFavProceduresWidgetState
), ),
widget.model.templateList.length != 0 widget.model.templateList.length != 0
? Column( ? Column(
children: children: widget.model.templateList.map((historyInfo) {
widget.model.templateList.map((historyInfo) {
return ExpansionProcedure( return ExpansionProcedure(
procedureTempleteModel: historyInfo, procedureTempleteModel: historyInfo,
model: widget.model, model: widget.model,
removeFavProcedure: widget.removeFavProcedure, removeFavProcedure: widget.removeFavProcedure,
addFavProcedure: widget.addFavProcedure, addFavProcedure: widget.addFavProcedure,
selectProcedures: widget.selectProcedures, selectProcedures: widget.selectProcedures,
isEntityListSelected: isEntityListSelected: widget.isEntityListSelected,
widget.isEntityListSelected,
isEntityFavListSelected: isEntityFavListSelected:
widget.isEntityFavListSelected, widget.isEntityFavListSelected,
isProcedure: widget.isProcedure, isProcedure: widget.isProcedure,

@ -1,28 +1,31 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../config/config.dart'; import '../../../config/config.dart';
class ProcedureCheckOutScreen extends StatefulWidget { class ProcedureCheckOutScreen extends StatefulWidget {
final List<ProcedureTempleteDetailsModel> items; final List<ProcedureTempleteDetailsModel> items;
final ProcedureViewModel model; final ProcedureViewModel previousProcedureViewModel;
final PatiantInformtion patient; final PatiantInformtion patient;
final String addButtonTitle; final String addButtonTitle;
final String toolbarTitle; final String toolbarTitle;
ProcedureCheckOutScreen( ProcedureCheckOutScreen(
{this.items, {this.items,
this.model, this.previousProcedureViewModel,
this.patient, this.patient,
@required this.addButtonTitle, @required this.addButtonTitle,
@required this.toolbarTitle}); @required this.toolbarTitle});
@ -43,51 +46,28 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
builder: (BuildContext context, ProcedureViewModel model, Widget child) => builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold( AppScaffold(
backgroundColor: Color(0xffF8F8F8).withOpacity(0.9), backgroundColor: Color(0xffF8F8F8).withOpacity(0.9),
isShowAppBar: false, isShowAppBar: true,
appBar: PatientSearchHeader(
title: widget.toolbarTitle ?? 'Add Procedure',
),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Center(
child: FractionallySizedBox(
widthFactor: 0.95,
child: Column( child: Column(
children: [ children: [
Container(
height: MediaQuery.of(context).size.height * 0.070,
color: Colors.white,
),
Container(
color: Colors.white,
child: Padding(
padding: EdgeInsets.all(12.0),
child: Row(
//mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
child: Icon(
Icons.arrow_back_ios_sharp,
size: 24.0,
),
onTap: () {
Navigator.pop(context);
},
),
SizedBox(
width: 5.0,
),
AppText(
widget.toolbarTitle ?? 'Add Procedure',
fontWeight: FontWeight.w700,
fontSize: 20,
),
],
),
),
),
SizedBox( SizedBox(
height: 30, height: 30,
), ),
ListView.builder( ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
itemCount: widget.items.length, itemCount: widget.items.length,
physics: BouncingScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
final TextEditingController remarksControllerNew = TextEditingController(text: widget.items[index].remarks); final TextEditingController remarksControllerNew =
TextEditingController(
text: widget.items[index].remarks);
return Container( return Container(
margin: EdgeInsets.only(bottom: 15.0), margin: EdgeInsets.only(bottom: 15.0),
@ -99,17 +79,13 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
initiallyExpanded: true, initiallyExpanded: true,
title: Row( title: Row(
children: [ children: [
Icon(
Icons.check_box,
color: Color(0xffD02127),
size: 30.5,
),
SizedBox(
width: 6.0,
),
Expanded( Expanded(
child: child: AppText(
AppText(widget.items[index].procedureName)), Utils.convertToTitleCase(
widget.items[index].procedureName),
fontWeight: FontWeight.w700,
color: AppGlobal.appTextColor,
)),
], ],
), ),
children: [ children: [
@ -117,7 +93,8 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12), padding: EdgeInsets.symmetric(horizontal: 12),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Row( Row(
children: [ children: [
@ -125,7 +102,8 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 11), horizontal: 11),
child: AppText( child: AppText(
TranslationBase.of(context).orderType, TranslationBase.of(context)
.orderType,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: Color(0xff2B353E), color: Color(0xff2B353E),
), ),
@ -137,10 +115,11 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
Radio( Radio(
activeColor: Color(0xFFD02127), activeColor: Color(0xFFD02127),
value: 0, value: 0,
groupValue: groupValue: widget
widget.items[index].selectedType, .items[index].selectedType,
onChanged: (value) { onChanged: (value) {
widget.items[index].selectedType = 0; widget.items[index].selectedType =
0;
setState(() { setState(() {
widget.items[index].type = widget.items[index].type =
value.toString(); value.toString();
@ -154,11 +133,12 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
), ),
Radio( Radio(
activeColor: Color(0xFFD02127), activeColor: Color(0xFFD02127),
groupValue: groupValue: widget
widget.items[index].selectedType, .items[index].selectedType,
value: 1, value: 1,
onChanged: (value) { onChanged: (value) {
widget.items[index].selectedType = 1; widget.items[index].selectedType =
1;
setState(() { setState(() {
widget.items[index].type = widget.items[index].type =
value.toString(); value.toString();
@ -202,13 +182,15 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
), ),
); );
}), }),
SizedBox( SizedBox(
height: 90, height: 90,
), ),
], ],
), ),
), ),
),
),
///TODO Elham* use our custom bottomsheet
bottomSheet: Container( bottomSheet: Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap( child: Wrap(
@ -221,10 +203,12 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
onPressed: () async { onPressed: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.model.addProcedures(model, widget.items, widget.patient, remarksController, isLocalBusy: true); await widget.previousProcedureViewModel.addProcedures(
widget.previousProcedureViewModel,
Navigator.pop(context); widget.items,
Navigator.pop(context); widget.patient,
remarksController,
isLocalBusy: true);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}, },
), ),

@ -1,18 +1,20 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.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/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_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/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.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/user-guid/CusomRow.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
/// TODO Roaa Add translation and make sure it working fine
class ProcedureCard extends StatelessWidget { class ProcedureCard extends StatelessWidget {
final Function onTap; final Function onTap;
final EntityList entityList; final EntityList entityList;
@ -200,9 +202,10 @@ class ProcedureCard extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
entityList.remarks!= null?Utils.convertToTitleCase( entityList.remarks != null
entityList.remarks.toString()) : ? Utils.convertToTitleCase(
'', entityList.remarks.toString())
: '',
fontSize: 12, fontSize: 12,
), ),
), ),

@ -1,21 +1,22 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/procedures/procedure_card.dart'; import 'package:doctor_app_flutter/screens/procedures/procedure_card.dart';
import 'package:doctor_app_flutter/screens/procedures/procedure_type.dart'; import 'package:doctor_app_flutter/screens/procedures/procedure_type.dart';
import 'package:doctor_app_flutter/screens/procedures/update_procedure.dart'; import 'package:doctor_app_flutter/screens/procedures/update_procedure.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/patient_service_title.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/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../widgets/shared/errors/error_message.dart'; import '../../widgets/shared/errors/error_message.dart';
import 'base_add_procedure_tab_page.dart'; import 'base_add_procedure_tab_page.dart';
@ -57,13 +58,9 @@ class ProcedureScreen extends StatelessWidget {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
if (model.procedureList.length == 0 && if ((model.procedureList.length == 0 &&
patient.patientStatusType != 43) patient.patientStatusType != 43) ||
ServiceTitle( patient.patientStatusType != null &&
title: TranslationBase.of(context).orderTestOr,
subTitle: TranslationBase.of(context).procedure,
),
if (patient.patientStatusType != null &&
patient.patientStatusType == 43) patient.patientStatusType == 43)
ServiceTitle( ServiceTitle(
title: TranslationBase.of(context).orderTestOr, title: TranslationBase.of(context).orderTestOr,
@ -73,26 +70,32 @@ class ProcedureScreen extends StatelessWidget {
patient.patientStatusType == 43) || patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null)) (isFromLiveCare && patient.appointmentNo != null))
AddNewOrder( AddNewOrder(
onTap: () { onTap: () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.getProcedureTemplate(
categoryID: ProcedureType.PROCEDURE.getCategoryId(),
isLocalBusy: true);
GifLoaderDialogUtils.hideDialog(context);
Navigator.push( Navigator.push(
context, context,
SlideUpPageRoute( SlideUpPageRoute(
widget: BaseAddProcedureTabPage( widget: BaseAddProcedureTabPage(
patient: patient, patient: patient,
model: model, previousProcedureViewModel: model,
procedureType: ProcedureType.PROCEDURE, procedureType: ProcedureType.PROCEDURE,
), ),
settingRoute: 'AddProcedureTabPage'), settingRoute: 'AddProcedureTabPage'),
); );
}, },
label: TranslationBase.of(context) label: TranslationBase.of(context).addMoreProcedure,
.addMoreProcedure,
), ),
if (model.procedureList.isNotEmpty) if (model.procedureList.isNotEmpty)
ListView.builder( ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
itemCount: model.procedureList[0].rowcount, itemCount: model.procedureList[0].rowcount,
shrinkWrap: true, shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return ProcedureCard( return ProcedureCard(
categoryID: model categoryID: model
@ -120,12 +123,12 @@ class ProcedureScreen extends StatelessWidget {
procedureId: model.procedureList[0] procedureId: model.procedureList[0]
.entityList[index].procedureId, .entityList[index].procedureId,
limetNo: model.procedureList[0] limetNo: model.procedureList[0]
.entityList[index].lineItemNo); .entityList[index].lineItemNo,
// } else
// Helpers.showErrorToast( );
// 'You Cant Update This Procedure');
}, },
patient: patient, patient: patient,
doctorID: model?.doctorProfile?.doctorID, doctorID: model?.doctorProfile?.doctorID,
); );
}), }),

@ -3,13 +3,11 @@ import 'package:doctor_app_flutter/utils/tab_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class TabWidget { class TabWidget {
static Widget tabWidget( static Widget tabWidget(
Size screenSize, Size screenSize,
bool isActive, bool isActive,
String title, String title, {
{
int counter = -1, int counter = -1,
bool isFirst = false, bool isFirst = false,
bool isMiddle = false, bool isMiddle = false,
@ -29,7 +27,6 @@ class TabWidget {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
TabUtils.getTabText(title: title, isActive: isActive), TabUtils.getTabText(title: title, isActive: isActive),
if (counter != -1) if (counter != -1)
TabUtils.getTabCounter(isActive: isActive, counter: counter) TabUtils.getTabCounter(isActive: isActive, counter: counter)

@ -1,19 +1,20 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -37,18 +38,19 @@ void updateProcedureForm(context,
remarks: remarks, remarks: remarks,
remarksController: remarksController, remarksController: remarksController,
patient: patient, patient: patient,
model: model, previousModel: model,
procedureId: procedureId, procedureId: procedureId,
categoryId: categoreId, categoryId: categoreId,
orderNo: orderNo, orderNo: orderNo,
limetNo: limetNo, limetNo: limetNo,
selectedType: int.parse(orderType),
); );
}); });
} }
class UpdateProcedureWidget extends StatefulWidget { class UpdateProcedureWidget extends StatefulWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
final ProcedureViewModel model; final ProcedureViewModel previousModel;
final String procedureName; final String procedureName;
final String remarks; final String remarks;
final TextEditingController remarksController; final TextEditingController remarksController;
@ -56,9 +58,11 @@ class UpdateProcedureWidget extends StatefulWidget {
final String categoryId; final String categoryId;
final int orderNo; final int orderNo;
final int limetNo; final int limetNo;
int selectedType;
UpdateProcedureWidget( UpdateProcedureWidget(
{this.model, {this.previousModel,
this.procedureName, this.procedureName,
this.remarks, this.remarks,
this.remarksController, this.remarksController,
@ -66,18 +70,17 @@ class UpdateProcedureWidget extends StatefulWidget {
this.procedureId, this.procedureId,
this.categoryId, this.categoryId,
this.orderNo, this.orderNo,
this.limetNo}); this.limetNo, this.selectedType});
@override @override
_UpdateProcedureWidgetState createState() => _UpdateProcedureWidgetState(); _UpdateProcedureWidgetState createState() => _UpdateProcedureWidgetState();
} }
class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> { class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
int selectedType = 0;
setSelectedType(int val) { setSelectedType(int val) {
setState(() { setState(() {
selectedType = val; widget.selectedType = val;
}); });
} }
@ -89,18 +92,18 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
List<EntityList> entityList = List(); List<EntityList> entityList = List();
dynamic selectedCategory; dynamic selectedCategory;
/// TODO Roaa Add translation and make sure it working fine
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return StatefulBuilder(builder:
(BuildContext context, StateSetter setState /*You can rename this!*/) {
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getCategory(), onModelReady: (model) => model.getCategory(),
builder: builder:
(BuildContext context, ProcedureViewModel model, Widget child) => (BuildContext context, ProcedureViewModel _model, Widget child) =>
NetworkBaseView( AppScaffold(
baseViewModel: model, baseViewModel: widget.previousModel,
child: SingleChildScrollView( isShowAppBar: true,
appBar: BottomSheetTitle(title: "Update Procedure"),
body: SingleChildScrollView(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.9, height: MediaQuery.of(context).size.height * 0.9,
child: Form( child: Form(
@ -111,7 +114,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
widget.procedureName.toUpperCase(), Utils.convertToTitleCase(widget.procedureName),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
SizedBox( SizedBox(
@ -124,7 +127,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
Radio( Radio(
activeColor: AppGlobal.appRedColor, activeColor: AppGlobal.appRedColor,
value: 0, value: 0,
groupValue: selectedType, groupValue: widget.selectedType,
onChanged: (value) { onChanged: (value) {
setSelectedType(value); setSelectedType(value);
}, },
@ -132,7 +135,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
Text('routine'), Text('routine'),
Radio( Radio(
activeColor: AppGlobal.appRedColor, activeColor: AppGlobal.appRedColor,
groupValue: selectedType, groupValue: widget.selectedType,
value: 1, value: 1,
onChanged: (value) { onChanged: (value) {
setSelectedType(value); setSelectedType(value);
@ -165,66 +168,40 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
SizedBox( SizedBox(
height: 70.0, height: 70.0,
), ),
Container(
margin:
EdgeInsets.all(SizeConfig.widthMultiplier * 2),
child: Column(
children: <Widget>[
AppButton(
color: AppGlobal.appGreenColor,
title: TranslationBase.of(context)
.updateProcedure
.toUpperCase(),
onPressed: () {
Navigator.pop(context);
updateProcedure(
limetNO: widget.limetNo,
orderNo: widget.orderNo,
orderType: selectedType.toString(),
categorieId: widget.categoryId,
procedureId: widget.procedureId,
entityList: entityList,
patient: widget.patient,
model: widget.model,
remarks: widget.remarksController.text);
// authorizationForm(context);
},
),
SizedBox(
height: 20.0,
),
AppButton(
title: TranslationBase.of(context).cancel,
color: AppGlobal.appRedColor,
onPressed: () {
Navigator.pop(context);
},
)
],
),
),
], ],
), ),
), ),
)), )),
), ),
bottomSheet: CustomBottomSheetContainer(
label: TranslationBase.of(context).updateProcedure,
onTap: () => updateProcedure(
lineItemNo: widget.limetNo,
orderNo: widget.orderNo,
orderType: widget.selectedType.toString(),
categoryId: widget.categoryId,
procedureId: widget.procedureId,
entityList: entityList,
patient: widget.patient,
model: widget.previousModel,
remarks: widget.remarksController.text),
),
), ),
); );
});
} }
updateProcedure( updateProcedure(
{ProcedureViewModel model, {ProcedureViewModel model,
String remarks, String remarks,
int limetNO, int lineItemNo,
int orderNo, int orderNo,
String newProcedureId, String newProcedureId,
String newCategorieId, String newCategoryId,
List<EntityList> entityList, List<EntityList> entityList,
String orderType, String orderType,
String procedureId, String procedureId,
PatiantInformtion patient, PatiantInformtion patient,
String categorieId}) async { String categoryId}) async {
UpdateProcedureRequestModel updateProcedureReqModel = UpdateProcedureRequestModel updateProcedureReqModel =
new UpdateProcedureRequestModel(); new UpdateProcedureRequestModel();
List<Controls> controls = List(); List<Controls> controls = List();
@ -234,7 +211,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
updateProcedureReqModel.episodeID = patient.episodeNo; updateProcedureReqModel.episodeID = patient.episodeNo;
updateProcedureReqModel.patientMRN = patient.patientMRN; updateProcedureReqModel.patientMRN = patient.patientMRN;
updateProcedureReqModel.lineItemNo = limetNO; updateProcedureReqModel.lineItemNo = lineItemNo;
updateProcedureReqModel.orderNo = orderNo; updateProcedureReqModel.orderNo = orderNo;
{ {
@ -247,22 +224,24 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
); );
controlsProcedure.procedure = procedureId; controlsProcedure.procedure = procedureId;
controlsProcedure.category = '0' + categorieId; controlsProcedure.category = '0' + categoryId;
controlsProcedure.controls = controls; controlsProcedure.controls = controls;
} }
updateProcedureReqModel.procedureDetail = controlsProcedure; updateProcedureReqModel.procedureDetail = controlsProcedure;
GifLoaderDialogUtils.showMyDialog(context);
await model.updateProcedure( await widget.previousModel.updateProcedure(
updateProcedureRequestModel: updateProcedureReqModel, updateProcedureRequestModel: updateProcedureReqModel,
mrn: patient.patientMRN); mrn: patient.patientMRN, isLocalBusy: true);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
model.getProcedure(mrn: patient.patientMRN);
} else if (model.state == ViewState.Idle) { } else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been updated'); DrAppToastMsg.showSuccesToast('procedure has been updated');
model.getProcedure(mrn: patient.patientMRN); await widget.previousModel.getProcedure(mrn: patient.patientMRN, isLocalBusy: true);
Navigator.of(context).pop();
} }
GifLoaderDialogUtils.hideDialog(context);
} }
} }

@ -1,6 +1,8 @@
import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:barcode_scan2/barcode_scan2.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/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/scan_qr_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/scan_qr_view_model.dart';
@ -86,6 +88,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
_scanQrAndGetPatient(BuildContext context, ScanQrViewModel model) async { _scanQrAndGetPatient(BuildContext context, ScanQrViewModel model) async {
var result = (await BarcodeScanner.scan()).rawContent; var result = (await BarcodeScanner.scan()).rawContent;
if (result != "") { if (result != "") {
DoctorProfileModel doctorProfile =await getDoctorProfile(isGetProfile: true);
List<String> listOfParams = result.split(','); List<String> listOfParams = result.split(',');
int patientID = 0; int patientID = 0;
if (listOfParams[1].length != 0) patientID = int.parse(listOfParams[1]); if (listOfParams[1].length != 0) patientID = int.parse(listOfParams[1]);
@ -96,6 +99,8 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
doctorID: 0, doctorID: 0,
projectID: int.parse(listOfParams[0])); projectID: int.parse(listOfParams[0]));
patientSearchRequestModel.loginDoctorID = doctorProfile.doctorID;
await model await model
.getInPatientList(patientSearchRequestModel, isMyInpatient: false) .getInPatientList(patientSearchRequestModel, isMyInpatient: false)
.then((d) { .then((d) {
@ -115,4 +120,31 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
}); });
} }
} }
Future<DoctorProfileModel> getDoctorProfile(
{bool isGetProfile = false}) async {
DoctorProfileModel doctorProfile;
if (isGetProfile) {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) {
doctorProfile = DoctorProfileModel.fromJson(profile);
if (doctorProfile != null) {
return doctorProfile;
}
}
}
if (doctorProfile == null) {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) {
doctorProfile = DoctorProfileModel.fromJson(profile);
if (doctorProfile != null) {
return doctorProfile;
}
}
return null;
} else {
return doctorProfile;
}
}
} }

@ -159,6 +159,7 @@ class TranslationBase {
String get startScanning => localizedValues['startScanning'][locale.languageCode]; String get startScanning => localizedValues['startScanning'][locale.languageCode];
String get scanQrCode => localizedValues['scanQrCode'][locale.languageCode]; String get scanQrCode => localizedValues['scanQrCode'][locale.languageCode];
String get scanERQrCode => localizedValues['scanERQrCode'][locale.languageCode];
String get scanQr => localizedValues['scanQr'][locale.languageCode]; String get scanQr => localizedValues['scanQr'][locale.languageCode];
@ -1698,7 +1699,7 @@ class TranslationBase {
String get reasonsThrombo => localizedValues['reasonsThrombo'][locale.languageCode]; String get reasonsThrombo => localizedValues['reasonsThrombo'][locale.languageCode];
String get youDoNotHaveFavoritePrescription => localizedValues['youDoNotHaveFavoritePrescription'][locale.languageCode]; String get youDoNotHaveFavoriteTemplate => localizedValues['youDoNotHaveFavoriteTemplate'][locale.languageCode];
String get pleaseSelectItem => localizedValues['pleaseSelectItem'][locale.languageCode]; String get pleaseSelectItem => localizedValues['pleaseSelectItem'][locale.languageCode];

@ -91,6 +91,10 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
TextInputType localKeyboardType = widget.inputType ??
(widget.maxLines == 1
? TextInputType.text
: TextInputType.multiline);
return Column( return Column(
children: [ children: [
@ -124,17 +128,12 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
// if ((widget.controller != null &&
// widget.controller.text != "") ||
// widget.dropDownText != null)
AppText( AppText(
widget.hintText, widget.hintText,
// marginTop: widget.hasHintmargin ? 0 : 30,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: widget.isPrscription == false fontSize: widget.isPrscription == false
? 11.0 ? 11.0
// SizeConfig.getHeightMultiplier() *
// (SizeConfig.isWidthLarge ? 1.1 : 1.3)
: 0, : 0,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.44, letterSpacing: -0.44,
@ -146,6 +145,19 @@ 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: RawKeyboardListener(
focusNode: FocusNode(),
autofocus: false,
onKey: (rawKeyEvent) {
final isFormSkippedEnterEvent = rawKeyEvent is RawKeyDownEvent &&
rawKeyEvent.isKeyPressed(LogicalKeyboardKey.enter);
final needToInsertNewLine = isFormSkippedEnterEvent &&
localKeyboardType == TextInputType.multiline;
if (needToInsertNewLine) {
TextEditingControllerHelper.insertText(widget.controller, '\n');
}
},
child: TextFormField( child: TextFormField(
textAlign: projectViewModel.isArabic textAlign: projectViewModel.isArabic
? TextAlign.right ? TextAlign.right
@ -163,10 +175,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
letterSpacing: -0.56, letterSpacing: -0.56,
), ),
controller: widget.controller, controller: widget.controller,
keyboardType: widget.inputType ?? keyboardType: localKeyboardType,
(widget.maxLines == 1
? TextInputType.text
: TextInputType.multiline),
enabled: widget.enabled, enabled: widget.enabled,
minLines: widget.minLines, minLines: widget.minLines,
maxLines: widget.maxLines, maxLines: widget.maxLines,
@ -182,6 +191,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
}, },
onFieldSubmitted: widget.onFieldSubmitted, onFieldSubmitted: widget.onFieldSubmitted,
obscureText: widget.isSecure), obscureText: widget.isSecure),
),
) )
: AppText( : AppText(
Utils.convertToTitleCase(widget.dropDownText), Utils.convertToTitleCase(widget.dropDownText),
@ -224,3 +234,24 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
); );
} }
} }
class TextEditingControllerHelper {
static insertText(TextEditingController controller, String textToInsert) {
final selection = controller.selection;
final cursorPosition = selection.base.offset;
if (cursorPosition < 0) {
controller.text += textToInsert;
return;
}
final text = controller.text;
final newText =
text.replaceRange(selection.start, selection.end, textToInsert);
controller.value = controller.value.copyWith(
text: newText,
selection: TextSelection.collapsed(
offset: selection.baseOffset + textToInsert.length,
),
);
}
}
Loading…
Cancel
Save