Merge branch 'development' into 'master'

Release 2

See merge request Cloud_Solution/doctor_app_flutter!615
merge-requests/624/merge
Mohammad Aljammal 5 years ago
commit e5de65bc82

Binary file not shown.

@ -1,4 +1,5 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:io' show Platform;
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
@ -6,32 +7,12 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'dart:io' show Platform;
import '../UpdatePage.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Helpers helpers = new Helpers(); Helpers helpers = new Helpers();
//ProjectProvider projectsProvider = new ProjectProvider();
/*
*@author: Mohammad Aljammal
*@Date:28/5/2020
*@param: url, onSuccess callBack, onFailure callBack
*@return:
*@desc:
*/
///Example
/*
await BaseAppClient.post('',
onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {},
body: null);
* */
class BaseAppClient { class BaseAppClient {
//TODO change the post fun to nun static when you change all service //TODO change the post fun to nun static when you change all service
post(String endPoint, post(String endPoint,
@ -86,6 +67,11 @@ class BaseAppClient {
await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
} }
if (body['ProjectID'] != null &&
(body['ProjectID'] == 2 || body['ProjectID'] == 3)) {
body['PatientOutSA'] = true;
}
print("URL : $url"); print("URL : $url");
print("Body : ${json.encode(body)}"); print("Body : ${json.encode(body)}");
var asd = json.encode(body); var asd = json.encode(body);
@ -161,11 +147,11 @@ class BaseAppClient {
: SETUP_ID; : SETUP_ID;
} }
body['VersionID'] = 6.3; body['VersionID'] = 8.3;
body['Channel'] = CHANNEL; body['Channel'] = CHANNEL;
body['LanguageID'] = languageID == 'ar' ? 1 : 2; body['LanguageID'] = languageID == 'ar' ? 1 : 2;
body['IPAdress'] = IP_ADDRESS; body['IPAdress'] = "10.20.10.20";
body['generalid'] = GENERAL_ID; body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA') body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null ? body['PatientOutSA'] != null
@ -208,6 +194,11 @@ class BaseAppClient {
body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it
body['SessionID'] = SESSION_ID; //getSe body['SessionID'] = SESSION_ID; //getSe
if (body['ProjectID'] != null &&
(body['ProjectID'] == 2 || body['ProjectID'] == 3)) {
body['PatientOutSA'] = true;
}
print("URL : $url"); print("URL : $url");
print("Body : ${json.encode(body)}"); print("Body : ${json.encode(body)}");

@ -129,7 +129,7 @@ const GET_SICKLEAVE_STATISTIC =
const ARRIVED_PATIENT_URL = const ARRIVED_PATIENT_URL =
'Services/DoctorApplication.svc/REST/PatientArrivalList'; 'Services/DoctorApplication.svc/REST/PatientArrivalList';
const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave'; const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave';
const GET_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/GetAllSickLeaves'; const GET_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave';
const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave'; const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave';
const GET_OFFTIME = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; const GET_OFFTIME = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList';
@ -152,6 +152,9 @@ const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure';
const GET_PATIENT_ARRIVAL_LIST = const GET_PATIENT_ARRIVAL_LIST =
'Services/DoctorApplication.svc/REST/PatientArrivalList'; 'Services/DoctorApplication.svc/REST/PatientArrivalList';
const GET_PATIENT_IN_PATIENT_LIST =
'Services/DoctorApplication.svc/REST/GetMyInPatient';
const Verify_Referral_Doctor_Remarks = const Verify_Referral_Doctor_Remarks =
'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks'; 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks';
@ -238,9 +241,13 @@ const GET_BOX_QUANTITY =
///GET ECG ///GET ECG
const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults";
const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; const GET_MY_REFERRAL_INPATIENT =
"Services/DoctorApplication.svc/REST/GtMyReferralPatient";
const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; const GET_MY_DISCHARGE_PATIENT =
"Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient";
const GET_DISCHARGE_PATIENT =
"Services/DoctorApplication.svc/REST/GtMyDischargePatient";
const GET_PAtIENTS_INSURANCE_APPROVALS = const GET_PAtIENTS_INSURANCE_APPROVALS =
"Services/Patients.svc/REST/GetApprovalStatus"; "Services/Patients.svc/REST/GetApprovalStatus";
@ -273,6 +280,7 @@ const GET_INSURANCE_IN_PATIENT =
"Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient";
const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave"; const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave";
const GET_MY_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GetMyOutPatient";
var selectedPatientType = 1; var selectedPatientType = 1;

@ -32,7 +32,7 @@ const Map<String, Map<String, String>> localizedValues = {
'outPatients': {'en': 'Out Patient', 'ar': 'المريض الخارجي'}, 'outPatients': {'en': 'Out Patient', 'ar': 'المريض الخارجي'},
'myOutPatient': {'en': 'My OutPatients', 'ar': 'المريض الخارجي'}, 'myOutPatient': {'en': 'My OutPatients', 'ar': 'المريض الخارجي'},
'searchPatient': {'en': 'Search Patient', 'ar': 'البحث عن مريض'}, 'searchPatient': {'en': 'Search Patients', 'ar': 'البحث عن مريض'},
'searchAbout': {'en': 'Search', 'ar': 'البحث عن'}, 'searchAbout': {'en': 'Search', 'ar': 'البحث عن'},
'patient': {'en': 'Patient', 'ar': ' مريض'}, 'patient': {'en': 'Patient', 'ar': ' مريض'},
'patients': {'en': "Patient's", 'ar': ' مريض'}, 'patients': {'en': "Patient's", 'ar': ' مريض'},
@ -48,9 +48,11 @@ const Map<String, Map<String, String>> localizedValues = {
'service': {'en': 'Service', 'ar': 'خدمة'}, 'service': {'en': 'Service', 'ar': 'خدمة'},
'referral': {'en': 'Referral', 'ar': 'الإحالة'}, 'referral': {'en': 'Referral', 'ar': 'الإحالة'},
'inPatient': {'en': 'My InPatients', 'ar': 'المريض الداخلي'}, 'inPatient': {'en': 'My InPatients', 'ar': 'المريض الداخلي'},
'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'},
'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى الداخليين'},
'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'},
'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'},
'searchMedicine': {'en': 'Search Medicine', 'ar': 'بحث عن الدواء'}, 'searchMedicine': {'en': 'Search Medicines', 'ar': 'بحث عن الدواء'},
'myReferralPatient': {'en': 'My Referral Patient', 'ar': 'مرضى الاحالة'}, 'myReferralPatient': {'en': 'My Referral Patient', 'ar': 'مرضى الاحالة'},
'referPatient': {'en': 'Referral Patient', 'ar': 'إحالة مريض'}, 'referPatient': {'en': 'Referral Patient', 'ar': 'إحالة مريض'},
'myReferral': {'en': 'My Referral', 'ar': 'إحالة'}, 'myReferral': {'en': 'My Referral', 'ar': 'إحالة'},
@ -383,8 +385,8 @@ const Map<String, Map<String, String>> localizedValues = {
'leanBodyWeight': {'en': "Lean Body Weight", 'ar': 'وزن الجسم الهزيل'}, 'leanBodyWeight': {'en': "Lean Body Weight", 'ar': 'وزن الجسم الهزيل'},
'bodyMassIndex': {'en': "Body Mass Index", 'ar': 'مؤشر كتلة الجسم'}, 'bodyMassIndex': {'en': "Body Mass Index", 'ar': 'مؤشر كتلة الجسم'},
'yourBodyMassIndex': { 'yourBodyMassIndex': {
'en': "Your Body Mass Index is", 'en': "Body Mass Index is",
'ar': 'مؤشر كتلة جسمك هو' 'ar': 'مؤشر كتلة الجسم هو'
}, },
'bmiUnderWeight': {'en': "UnderWeight", 'ar': 'تحت الوزن'}, 'bmiUnderWeight': {'en': "UnderWeight", 'ar': 'تحت الوزن'},
'bmiHealthy': {'en': "Healthy", 'ar': 'صحي'}, 'bmiHealthy': {'en': "Healthy", 'ar': 'صحي'},
@ -768,7 +770,7 @@ const Map<String, Map<String, String>> localizedValues = {
'arrived_p': {'en': "Arrived", 'ar': "وصل"}, 'arrived_p': {'en': "Arrived", 'ar': "وصل"},
'details': {'en': 'Details', 'ar': 'التفاصيل'}, 'details': {'en': 'Details', 'ar': 'التفاصيل'},
"liveCare": {"en": "Live Care", "ar": "لايف كير"}, "liveCare": {"en": "Live Care", "ar": "لايف كير"},
"out-patient": {"en": "Out Patient", "ar": "عيادات خارجية"}, "out-patient": {"en": "OutPatient", "ar": "عيادات خارجية"},
"BillNo": {"en": "Bill No :", "ar": "رقم الفاتورة"}, "BillNo": {"en": "Bill No :", "ar": "رقم الفاتورة"},
"labResults": {"en": "Lab Result", "ar": "نتيجة المختبر"}, "labResults": {"en": "Lab Result", "ar": "نتيجة المختبر"},
"sendSuc": { "sendSuc": {
@ -782,7 +784,7 @@ const Map<String, Map<String, String>> localizedValues = {
}, },
"show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"}, "show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"},
"open-rad": {"en": "Open Image", "ar": "فتح صور الاشعة"}, "open-rad": {"en": "Open Radiology Image", "ar": "فتح صور الاشعة"},
'fileNumber': {'en': "File Number: ", 'ar': " :رقم الملف"}, 'fileNumber': {'en': "File Number: ", 'ar': " :رقم الملف"},
'searchPatient-name': { 'searchPatient-name': {
@ -862,5 +864,10 @@ const Map<String, Map<String, String>> localizedValues = {
"try-saying": {"en": "Try saying something", "ar": 'حاول قول شيء ما'}, "try-saying": {"en": "Try saying something", "ar": 'حاول قول شيء ما'},
"refClinic": {"en": "Ref Clinic", "ar": "Ref Clinic"}, "refClinic": {"en": "Ref Clinic", "ar": "Ref Clinic"},
"acknowledged": {"en": "Acknowledged", "ar": "إقرار"}, "acknowledged": {"en": "Acknowledged", "ar": "إقرار"},
"didntCatch": {
"en": "Didn't catch that. Try Speaking again",
"ar": "لم يتم التقاط ذلك. حاول التحدث مرة أخرى"
},
"showDetail": {"en": "Show Detail", "ar": "أظهر المعلومات"}, "showDetail": {"en": "Show Detail", "ar": "أظهر المعلومات"},
"viewProfile": {"en": "View Profile", "ar": "إعرض الملف"},
}; };

@ -0,0 +1,2 @@
enum PatientType { inPatient, OutPatient }

@ -0,0 +1,60 @@
class PatientSearchRequestModel {
int doctorID;
String firstName;
String middleName;
String lastName;
String patientMobileNumber;
String patientIdentificationID;
int patientID;
String from;
String to;
int searchType;
String mobileNo;
String identificationNo;
PatientSearchRequestModel(
{this.doctorID =0,
this.firstName ="0",
this.middleName ="0",
this.lastName ="0",
this.patientMobileNumber ="0",
this.patientIdentificationID ="0",
this.patientID =0,
this.searchType =1,
this.mobileNo="",
this.identificationNo="0",
this.from ="0",
this.to ="0"});
PatientSearchRequestModel.fromJson(Map<String, dynamic> json) {
doctorID = json['DoctorID'];
firstName = json['FirstName'];
middleName = json['MiddleName'];
lastName = json['LastName'];
patientMobileNumber = json['PatientMobileNumber'];
patientIdentificationID = json['PatientIdentificationID'];
patientID = json['PatientID'];
from = json['From'];
to = json['To'];
searchType = json['SearchType'];
mobileNo = json['MobileNo'];
identificationNo = json['IdentificationNo'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['DoctorID'] = this.doctorID;
data['FirstName'] = this.firstName;
data['MiddleName'] = this.middleName;
data['LastName'] = this.lastName;
data['PatientMobileNumber'] = this.patientMobileNumber;
data['PatientIdentificationID'] = this.patientIdentificationID;
data['PatientID'] = this.patientID;
data['From'] = this.from;
data['To'] = this.to;
data['SearchType'] = this.searchType;
data['MobileNo'] = this.mobileNo;
data['IdentificationNo'] = this.identificationNo;
return data;
}
}

@ -72,7 +72,7 @@ class PatientLabOrders {
PatientLabOrders.fromJson(Map<String, dynamic> json) { PatientLabOrders.fromJson(Map<String, dynamic> json) {
actualDoctorRate = json['ActualDoctorRate']; actualDoctorRate = json['ActualDoctorRate'];
clinicDescription = json['ClinicDescription']; clinicDescription = json['ClinicDescription']?? json['ClinicName'];
clinicDescriptionEnglish = json['ClinicDescriptionEnglish']; clinicDescriptionEnglish = json['ClinicDescriptionEnglish'];
clinicDescriptionN = json['ClinicDescriptionN']; clinicDescriptionN = json['ClinicDescriptionN'];
clinicID = json['ClinicID']; clinicID = json['ClinicID'];

@ -108,7 +108,7 @@ class FinalRadiology {
admissionNo = json['AdmissionNo']; admissionNo = json['AdmissionNo'];
isInOutPatient = json['IsInOutPatient']; isInOutPatient = json['IsInOutPatient'];
actualDoctorRate = json['ActualDoctorRate']; actualDoctorRate = json['ActualDoctorRate'];
clinicDescription = json['ClinicDescription']; clinicDescription = json['ClinicDescription']?? json['ClinicName'];
dIAPACSURL = json['DIA_PACS_URL']; dIAPACSURL = json['DIA_PACS_URL'];
doctorImageURL = json['DoctorImageURL']; doctorImageURL = json['DoctorImageURL'];
doctorName = json['DoctorName']; doctorName = json['DoctorName'];
@ -125,7 +125,7 @@ class FinalRadiology {
orderNo = json['OrderNo']; orderNo = json['OrderNo'];
projectName = json['ProjectName']; projectName = json['ProjectName'];
qR = json['QR']; qR = json['QR'];
isLiveCareAppodynamicment = json['IsLiveCareAppodynamicment']; isLiveCareAppodynamicment = json['IsLiveCareAppointment'];
reportDataHTML = json['ReportDataHTML']; reportDataHTML = json['ReportDataHTML'];
reportDataTextdynamic = json['ReportDataTextdynamic']; reportDataTextdynamic = json['ReportDataTextdynamic'];
// speciality = json['Speciality'].cast<dynamic>(); // speciality = json['Speciality'].cast<dynamic>();

@ -1,3 +1,5 @@
import 'package:doctor_app_flutter/widgets/shared/StarRating.dart';
class SickLeavePatientModel { class SickLeavePatientModel {
String setupID; String setupID;
int projectID; int projectID;
@ -30,8 +32,10 @@ class SickLeavePatientModel {
dynamic patientName; dynamic patientName;
String projectName; String projectName;
String qR; String qR;
List<String> speciality; // List<String> speciality;
String strRequestDate; String strRequestDate;
String startDate;
String endDate;
SickLeavePatientModel( SickLeavePatientModel(
{this.setupID, {this.setupID,
@ -65,11 +69,14 @@ class SickLeavePatientModel {
this.patientName, this.patientName,
this.projectName, this.projectName,
this.qR, this.qR,
this.speciality, // this.speciality,
this.strRequestDate}); this.strRequestDate,
this.startDate,
this.endDate});
SickLeavePatientModel.fromJson(Map<String, dynamic> json) { SickLeavePatientModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID']; setupID = json['SetupID'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
patientID = json['PatientID']; patientID = json['PatientID'];
patientType = json['PatientType']; patientType = json['PatientType'];
@ -100,13 +107,16 @@ class SickLeavePatientModel {
patientName = json['PatientName']; patientName = json['PatientName'];
projectName = json['ProjectName']; projectName = json['ProjectName'];
qR = json['QR']; qR = json['QR'];
speciality = json['Speciality'].cast<String>(); // speciality = json['Speciality'].cast<String>();
strRequestDate = json['StrRequestDate']; strRequestDate = json['StrRequestDate'];
startDate = json['StartDate'];
endDate = json['EndDate'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID; data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;
data['PatientID'] = this.patientID; data['PatientID'] = this.patientID;
data['PatientType'] = this.patientType; data['PatientType'] = this.patientType;
@ -137,8 +147,10 @@ class SickLeavePatientModel {
data['PatientName'] = this.patientName; data['PatientName'] = this.patientName;
data['ProjectName'] = this.projectName; data['ProjectName'] = this.projectName;
data['QR'] = this.qR; data['QR'] = this.qR;
data['Speciality'] = this.speciality; // data['Speciality'] = this.speciality;
data['StrRequestDate'] = this.strRequestDate; data['StrRequestDate'] = this.strRequestDate;
data['StartDate'] = this.startDate;
data['EndDate'] = this.endDate;
return data; return data;
} }
} }

@ -11,7 +11,7 @@ class DischargedPatientService extends BaseService {
Future getDischargedPatient() async { Future getDischargedPatient() async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
await getDoctorProfile(); await getDoctorProfile(isGetProfile: true);
body['DoctorID'] = doctorProfile.doctorID; body['DoctorID'] = doctorProfile.doctorID;
body['FirstName'] = "0"; body['FirstName'] = "0";
body['MiddleName'] = "0"; body['MiddleName'] = "0";
@ -28,7 +28,7 @@ class DischargedPatientService extends BaseService {
body['PatientTypeID'] = 1; body['PatientTypeID'] = 1;
hasError = false; hasError = false;
myDischargedPatients.clear(); myDischargedPatients.clear();
await baseAppClient.post(GET_MY_DISCHARGE_PATIENT, await baseAppClient.post(GET_DISCHARGE_PATIENT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
if (response['List_MyDischargePatient'] != null) { if (response['List_MyDischargePatient'] != null) {
response['List_MyDischargePatient'].forEach((v) { response['List_MyDischargePatient'].forEach((v) {

@ -15,7 +15,17 @@ class BaseService {
List<PatiantInformtion> patientArrivalList = []; List<PatiantInformtion> patientArrivalList = [];
//TODO add the user login model when we need it //TODO add the user login model when we need it
Future<DoctorProfileModel> getDoctorProfile() async { Future<DoctorProfileModel> getDoctorProfile({bool isGetProfile = false}) async {
if(isGetProfile)
{
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) {
doctorProfile = DoctorProfileModel.fromJson(profile);
if (doctorProfile != null) {
return doctorProfile;
}
}
}
if (doctorProfile == null) { if (doctorProfile == null) {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) { if (profile != null) {

@ -25,14 +25,16 @@ class LabsService extends BaseService {
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
url = GET_Patient_LAB_ORDERS; url = GET_Patient_LAB_ORDERS;
} }
patientLabOrdersList=[];
patientLabOrdersList.clear();
await baseAppClient.postPatient(url, patient: patient, await baseAppClient.postPatient(url, patient: patient,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
patientLabOrdersList.clear(); patientLabOrdersList=[];
if (!isInpatient) { if (!isInpatient) {
response['ListPLO'].forEach((hospital) { response['ListPLO'].forEach((hospital) {
patientLabOrdersList.add(PatientLabOrders.fromJson(hospital)); patientLabOrdersList.add(PatientLabOrders.fromJson(hospital));
}); });
var asd="";
} else { } else {
response['List_GetLabOreders'].forEach((hospital) { response['List_GetLabOreders'].forEach((hospital) {
patientLabOrdersList.add(PatientLabOrders.fromJson(hospital)); patientLabOrdersList.add(PatientLabOrders.fromJson(hospital));
@ -132,7 +134,7 @@ class LabsService extends BaseService {
body['OrderNo'] = patientLabOrder.orderNo; body['OrderNo'] = patientLabOrder.orderNo;
body['SetupID'] = patientLabOrder.setupID; body['SetupID'] = patientLabOrder.setupID;
body['ProjectID'] = patientLabOrder.projectID; body['ProjectID'] = patientLabOrder.projectID;
body['ClinicID'] = patientLabOrder.clinicID; body['ClinicID'] = patientLabOrder.clinicID ?? 0;
} }
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['Procedure'] = procedure; body['Procedure'] = procedure;

@ -36,6 +36,35 @@ class UcafService extends LookupService {
}, body: body); }, body: body);
} }
Future getInPatientVitalSignHistory(PatiantInformtion patient, bool isInPatient) async {
hasError = false;
Map<String, dynamic> body = Map();
body['PatientID'] = patient.patientId;
body['PatientTypeID'] = 1;
if(isInPatient){
body['InOutPatientType'] = 1;
}else {
body['InOutPatientType'] = 2;
}
await baseAppClient.post(
GET_PATIENT_VITAL_SIGN,
onSuccess: (dynamic response, int statusCode) {
patientVitalSignsHistory.clear();
if (response['List_DoctorPatientVitalSign'] != null) {
response['List_DoctorPatientVitalSign'].forEach((v) {
patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v));
});
}
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error.toString();
},
body: body,
);
}
Future getPatientVitalSignsHistory( Future getPatientVitalSignsHistory(
PatiantInformtion patient, String fromDate, String toDate) async { PatiantInformtion patient, String fromDate, String toDate) async {
hasError = false; hasError = false;

@ -39,25 +39,29 @@ class VitalSignsService extends BaseService {
patientVitalSigns = null; patientVitalSigns = null;
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientId; // patient.patientMRN body['PatientID'] = patient.patientId; // patient.patientMRN
// body['AppointmentNo'] = patient.appointmentNo; body['InOutPatientType'] = 1;
// body['EpisodeID'] = patient.episodeNo;
body['PatientTypeID'] = 1; body['PatientTypeID'] = 1;
body['PatientType'] = 1; body['PatientType'] = 1;
body['DeviceTypeID'] = 1; body['DeviceTypeID'] = 1;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['From'] = fromDate; body['ProjectID'] = patient.projectId;
body['To'] = toDate; // body['From'] = fromDate;
// body['To'] = toDate;
if (patient.appointmentNo != null && patient.projectId != null) {
body['TransNo'] = patient.appointmentNo;
body['ProjectID'] = patient.projectId;
}
await baseAppClient.post( await baseAppClient.post(
GET_PATIENT_VITAL_SIGN_DATA, GET_PATIENT_VITAL_SIGN,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
patientVitalSignsHistory.clear(); patientVitalSignsHistory.clear();
if (response['VitalSignsHistory'] != null) { if (response['List_DoctorPatientVitalSign'] != null) {
response['VitalSignsHistory'].forEach((v) { response['List_DoctorPatientVitalSign'].forEach((v) {
patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v));
}); });
} }
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -67,28 +71,35 @@ class VitalSignsService extends BaseService {
); );
} }
Future getInPatientVitalSignHistory(PatiantInformtion patient) async { Future getOutPatientVitalSignHistory(PatiantInformtion patient, String fromDate, String toDate) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['PatientID'] = patient.patientId; body['PatientID'] = patient.patientId;
body['InOutPatientType'] = 1; body['PatientTypeID'] = patient.patientType;
body['PatientTypeID'] = 1; // if(isInPatient){
body['InOutPatientType'] = 0;
body['isDentalAllowedBackend'] = false;
body['IPAdress'] = "10.20.10.20";
// }else {
// body['InOutPatientType'] = 2;
// }
await baseAppClient.post(
GET_PATIENT_VITAL_SIGN, await baseAppClient.postPatient(
GET_PATIENT_VITAL_SIGN,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
patientVitalSignsHistory.clear(); patientVitalSignsHistory.clear();
if (response['List_DoctorPatientVitalSign'] != null) { if (response['List_DoctorPatientVitalSign'] != null) {
response['List_DoctorPatientVitalSign'].forEach((v) { response['List_DoctorPatientVitalSign'].forEach((v) {
patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v));
}); });}
}
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error.toString(); super.error = error.toString();
}, },
body: body, body: body,
patient: patient
); );
} }
} }

@ -0,0 +1,45 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
class OutPatientService extends BaseService {
List<PatiantInformtion> _patientList = [];
List<PatiantInformtion> get patientList => _patientList;
Future getOutPatient(PatientSearchRequestModel patientSearchRequestModel) async {
hasError = false;
await baseAppClient.post(
GET_MY_OUT_PATIENT,
onSuccess: (dynamic response, int statusCode) {
_patientList.clear();
response['List_MyOutPatient'].forEach((v) {
_patientList.add(PatiantInformtion.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: patientSearchRequestModel.toJson(),
);
}
Future getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel) async {
hasError = false;
await baseAppClient.post(
PRM_SEARCH_PATIENT,
onSuccess: (dynamic response, int statusCode) {
_patientList.clear();
response['GetPatientFileInformation_PRMList'].forEach((v) {
_patientList.add(PatiantInformtion.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: patientSearchRequestModel.toJson(),
);
}
}

@ -0,0 +1,36 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
class PatientInPatientService extends BaseService {
List<PatiantInformtion> inPatientList = List();
Future getInPatientList(
PatientSearchRequestModel requestModel, bool isMyInpatient) async {
hasError = false;
await getDoctorProfile();
if (isMyInpatient) {
requestModel.doctorID = doctorProfile.doctorID;
}else {
requestModel.doctorID = 0;
}
await baseAppClient.post(
GET_PATIENT_IN_PATIENT_LIST,
onSuccess: (dynamic response, int statusCode) {
inPatientList.clear();
response['List_MyInPatient'].forEach((v) {
inPatientList.add(PatiantInformtion.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: requestModel.toJson(),
);
}
}

@ -76,12 +76,12 @@ class ProcedureService extends BaseService {
Future getProcedureCategory({String categoryName, String categoryID}) async { Future getProcedureCategory({String categoryName, String categoryID}) async {
_getProcedureCategoriseReqModel = GetProcedureReqModel( _getProcedureCategoriseReqModel = GetProcedureReqModel(
search: [categoryName], search: ["$categoryName"],
patientMRN: 0, patientMRN: 0,
pageIndex: 0, pageIndex: 0,
clinicId: 0, clinicId: 0,
pageSize: 0, pageSize: 0,
category: categoryID ?? "01", category: categoryID ?? null,
); );
hasError = false; hasError = false;
_categoriesList.clear(); _categoriesList.clear();

@ -39,7 +39,7 @@ class RadiologyService extends BaseService {
await baseAppClient.postPatient(url, await baseAppClient.postPatient(url,
patient: patient, patient: patient,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
finalRadiologyList.clear(); finalRadiologyList = [];
String label = "ListRAD"; String label = "ListRAD";
if(isInPatient) { if(isInPatient) {
label ="List_GetRadOreders"; label ="List_GetRadOreders";

@ -17,7 +17,7 @@ class SickLeaveService extends BaseService {
List get getReasons => reasonse; List get getReasons => reasonse;
List reasonse = []; List reasonse = [];
List<GetAllSickLeaveResponse> get getAllSickLeave => _getAllsickLeave; List<GetAllSickLeaveResponse> get getAllSickLeave => _getAllsickLeave;
List<GetAllSickLeaveResponse> _getAllsickLeave = []; List<GetAllSickLeaveResponse> _getAllsickLeave = List();
List get coveringDoctorsList => _coveringDoctors; List get coveringDoctorsList => _coveringDoctors;
List _coveringDoctors = []; List _coveringDoctors = [];
@ -31,9 +31,8 @@ class SickLeaveService extends BaseService {
dynamic get sickLeaveResponse => _sickLeaveResponse; dynamic get sickLeaveResponse => _sickLeaveResponse;
dynamic _sickLeaveResponse; dynamic _sickLeaveResponse;
List<SickLeavePatientModel> get getAllSickLeavePatient =>
_getAllsickLeavePatient; List<SickLeavePatientModel> getAllSickLeavePatient = List();
List<SickLeavePatientModel> _getAllsickLeavePatient = [];
SickLeavePatientRequestModel _sickLeavePatientRequestModel = SickLeavePatientRequestModel _sickLeavePatientRequestModel =
SickLeavePatientRequestModel(); SickLeavePatientRequestModel();
@ -98,13 +97,14 @@ class SickLeaveService extends BaseService {
Future getSickLeave(patientMRN) async { Future getSickLeave(patientMRN) async {
hasError = false; hasError = false;
await baseAppClient.post( getAllSickLeavePatient = [];
await baseAppClient.postPatient(
GET_SICK_LEAVE, GET_SICK_LEAVE,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
Future.value(response); // Future.value(response);
_getAllsickLeave.clear(); getAllSickLeavePatient=[];
response['SickLeavesList']['entityList'].forEach((v) { response['List_SickLeave'].forEach((v) {
_getAllsickLeave.add(GetAllSickLeaveResponse.fromJson(v)); getAllSickLeavePatient.add(SickLeavePatientModel.fromJson(v));
}); });
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
@ -115,26 +115,28 @@ class SickLeaveService extends BaseService {
); );
} }
// Future getSickLeavePatient(patientMRN) async { Future getSickLeavePatient(patientMRN) async {
// _sickLeavePatientRequestModel = _sickLeavePatientRequestModel = SickLeavePatientRequestModel(
// SickLeavePatientRequestModel(patientID: patientMRN, patientType: 1); patientID: patientMRN, patientTypeID: 2, patientType: 1);
// hasError = false; hasError = false;
// await baseAppClient.post( getAllSickLeavePatient =[];
// GET_SICK_LEAVE_PATIENT, getAllSickLeavePatient.clear();
// onSuccess: (dynamic response, int statusCode) { await baseAppClient.postPatient(
// Future.value(response); GET_SICK_LEAVE_PATIENT,
// _getAllsickLeavePatient.clear(); onSuccess: (dynamic response, int statusCode) {
// response['List_SickLeave'].forEach((v) { Future.value(response);
// _getAllsickLeavePatient.add(SickLeavePatientModel.fromJson(v)); getAllSickLeavePatient.clear();
// }); response['List_SickLeave'].forEach((v) {
// }, getAllSickLeavePatient.add(SickLeavePatientModel.fromJson(v));
// onFailure: (String error, int statusCode) { });
// hasError = true; },
// super.error = error; onFailure: (String error, int statusCode) {
// }, hasError = true;
// body: _sickLeavePatientRequestModel.toJson(), super.error = error;
// ); },
// } body: _sickLeavePatientRequestModel.toJson(),
);
}
Future getRescheduleLeave() async { Future getRescheduleLeave() async {
hasError = false; hasError = false;

@ -13,15 +13,12 @@ class DischargedPatientViewModel extends BaseViewModel {
_dischargedPatientService.myDischargedPatients; _dischargedPatientService.myDischargedPatients;
List<PatiantInformtion> filterData = [];
List<PatiantInformtion> get filterData => filterData2.isNotEmpty? filterData2:myDischargedPatient;
List<PatiantInformtion> filterData2 = [];
searchData(String str) { searchData(String str) {
var strExist = str.length > 0 ? true : false; var strExist = str.length > 0 ? true : false;
if (strExist) { if (strExist) {
filterData2 = []; filterData = [];
for (var i = 0; i < myDischargedPatient.length; i++) { for (var i = 0; i < myDischargedPatient.length; i++) {
String firstName = myDischargedPatient[i].firstName.toUpperCase(); String firstName = myDischargedPatient[i].firstName.toUpperCase();
String lastName = myDischargedPatient[i].lastName.toUpperCase(); String lastName = myDischargedPatient[i].lastName.toUpperCase();
@ -32,12 +29,12 @@ class DischargedPatientViewModel extends BaseViewModel {
lastName.contains(str.toUpperCase()) || lastName.contains(str.toUpperCase()) ||
mobile.contains(str) || mobile.contains(str) ||
patientID.contains(str)) { patientID.contains(str)) {
filterData2.add(myDischargedPatient[i]); filterData.add(myDischargedPatient[i]);
} }
} }
notifyListeners(); notifyListeners();
} else { } else {
filterData2 = myDischargedPatient; filterData = myDischargedPatient;
notifyListeners(); notifyListeners();
} }
} }
@ -49,8 +46,9 @@ class DischargedPatientViewModel extends BaseViewModel {
if (_dischargedPatientService.hasError) { if (_dischargedPatientService.hasError) {
error = _dischargedPatientService.error; error = _dischargedPatientService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else } else{
setState(ViewState.Idle); filterData = myDischargedPatient;
setState(ViewState.Idle);}
} }
Future gtMyDischargeReferralPatient() async { Future gtMyDischargeReferralPatient() async {

@ -0,0 +1,195 @@
import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/patient/out_patient_service.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import '../../locator.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/patientInPatientService.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import '../../locator.dart';
import 'base_view_model.dart';
class PatientSearchViewModel extends BaseViewModel{
OutPatientService _outPatientService = locator<OutPatientService>();
List<PatiantInformtion> get patientList => _outPatientService.patientList;
List<PatiantInformtion> filterData = [];
searchData(String str) {
var strExist = str.length > 0 ? true : false;
if (strExist) {
filterData = [];
for (var i = 0; i < _outPatientService.patientList.length; i++) {
String firstName = _outPatientService.patientList[i].firstName.toUpperCase();
String lastName = _outPatientService.patientList[i].lastName.toUpperCase();
String mobile = _outPatientService.patientList[i].mobileNumber.toUpperCase();
String patientID = _outPatientService.patientList[i].patientId.toString();
if (firstName.contains(str.toUpperCase()) ||
lastName.contains(str.toUpperCase()) ||
mobile.contains(str) ||
patientID.contains(str)) {
filterData.add(_outPatientService.patientList[i]);
}
}
notifyListeners();
} else {
filterData = _outPatientService.patientList;
notifyListeners();
}
}
getOutPatient(PatientSearchRequestModel patientSearchRequestModel , {bool isLocalBusy = false}) async {
if(isLocalBusy) {
setState(ViewState.BusyLocal);
} else {
setState(ViewState.Busy);
}
await _outPatientService.getOutPatient(
patientSearchRequestModel);
if (_outPatientService.hasError) {
error = _outPatientService.error;
if(isLocalBusy) {
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Error);
}
setState(ViewState.Error);
} else {
filterData = _outPatientService.patientList;
setState(ViewState.Idle);
}
}
getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, {bool isLocalBusy = false}) async {
setState(ViewState.Busy);
await _outPatientService.getPatientFileInformation(
patientSearchRequestModel);
if (_outPatientService.hasError) {
error = _outPatientService.error;
setState(ViewState.Error);
} else {
filterData = _outPatientService.patientList;
setState(ViewState.Idle);
}
}
getPatientBasedOnDate (
{item, PatientSearchRequestModel patientSearchRequestModel, PatientType selectedPatientType,
bool isSearchWithKeyInfo })async {
String dateTo;
String dateFrom;
if (item == 'Tomorrow') {
dateTo = DateUtils.convertDateToFormat(
DateTime(DateTime.now().year, DateTime.now().month,
DateTime.now().day + 1),
'yyyy-MM-dd');
dateFrom = DateUtils.convertDateToFormat(
DateTime(DateTime.now().year, DateTime.now().month,
DateTime.now().day + 1),
'yyyy-MM-dd');
} else if (item == 'Next Week') {
dateTo = DateUtils.convertDateToFormat(
DateTime(DateTime.now().year, DateTime.now().month,
DateTime.now().day + 6),
'yyyy-MM-dd');
dateFrom = DateUtils.convertDateToFormat(
DateTime(DateTime.now().year, DateTime.now().month,
DateTime.now().day + 1),
'yyyy-MM-dd');
} else {
dateFrom = DateUtils.convertDateToFormat(
DateTime(
DateTime.now().year, DateTime.now().month, DateTime.now().day),
'yyyy-MM-dd');
dateTo= DateUtils.convertDateToFormat(
DateTime(
DateTime.now().year, DateTime.now().month, DateTime.now().day),
'yyyy-MM-dd');
}
PatientSearchRequestModel currentModel = PatientSearchRequestModel();
currentModel.patientID = patientSearchRequestModel.patientID;
currentModel.firstName = patientSearchRequestModel.firstName;
currentModel.lastName = patientSearchRequestModel.lastName;
currentModel.middleName = patientSearchRequestModel.middleName;
currentModel.doctorID = patientSearchRequestModel.doctorID;
currentModel.from = dateFrom;
currentModel.to = dateTo;
if(isSearchWithKeyInfo) {
await getPatientFileInformation(currentModel);
} else {
await getOutPatient(currentModel, isLocalBusy: true);
}
filterData = _outPatientService.patientList;
}
PatientInPatientService _inPatientService =
locator<PatientInPatientService>();
List<PatiantInformtion> get _inPatientList => _inPatientService.inPatientList;
List<PatiantInformtion> filteredInPatientItems = List();
Future getInPatientList(PatientSearchRequestModel requestModel,
{bool isMyInpatient = false, bool isFirstTime = true}) async {
await getDoctorProfile();
if (isFirstTime)
setState(ViewState.Busy);
else
setState(ViewState.BusyLocal);
await _inPatientService.getInPatientList(requestModel, false);
if (_inPatientService.hasError) {
error = _inPatientService.error;
setState(ViewState.Error);
} else {
filteredInPatientItems.clear();
if (_inPatientList.length > 0)
filteredInPatientItems.addAll(_inPatientList);
setState(ViewState.Idle);
}
}
void filterSearchResults(String query) {
var strExist = query.length > 0 ? true : false;
if (strExist) {
filteredInPatientItems = [];
for (var i = 0; i < _inPatientList.length; i++) {
String firstName = _inPatientList[i].firstName.toUpperCase();
String lastName = _inPatientList[i].lastName.toUpperCase();
String mobile = _inPatientList[i].mobileNumber.toUpperCase();
String patientID = _inPatientList[i].patientId.toString();
if (firstName.contains(query.toUpperCase()) ||
lastName.contains(query.toUpperCase()) ||
mobile.contains(query) ||
patientID.contains(query)) {
filteredInPatientItems.add(_inPatientList[i]);
}
}
notifyListeners();
} else {
if (_inPatientList.length > 0)
filteredInPatientItems.clear();
filteredInPatientItems.addAll(_inPatientList);
notifyListeners();
}
}
}

@ -67,7 +67,8 @@ class UcafViewModel extends BaseViewModel {
to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
} }
await _ucafService.getPatientVitalSignsHistory(patient, from, to); // await _ucafService.getPatientVitalSignsHistory(patient, from, to);
await _ucafService.getInPatientVitalSignHistory(patient, false);
await _ucafService.getPatientChiefComplaint(patient); await _ucafService.getPatientChiefComplaint(patient);
if (_ucafService.hasError) { if (_ucafService.hasError) {

@ -52,10 +52,12 @@ class VitalSignsViewModel extends BaseViewModel {
to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
} }
if (isInPatient) { if (isInPatient) {
await _vitalSignService.getInPatientVitalSignHistory(patient);
} else {
await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); await _vitalSignService.getPatientVitalSignsHistory(patient, from, to);
} else {
await _vitalSignService.getOutPatientVitalSignHistory(patient, from, to);
} }
if (_vitalSignService.hasError) { if (_vitalSignService.hasError) {

@ -59,10 +59,11 @@ class PrescriptionViewModel extends BaseViewModel {
getPrescriptionsInPatient(PatiantInformtion patient) async { getPrescriptionsInPatient(PatiantInformtion patient) async {
setState(ViewState.Busy); setState(ViewState.Busy);
error="";
await _prescriptionsService.getPrescriptionInPatient( await _prescriptionsService.getPrescriptionInPatient(
mrn: patient.patientId, adn: patient.admissionNo); mrn: patient.patientId, adn: patient.admissionNo);
if (_prescriptionsService.hasError) { if (_prescriptionsService.hasError) {
error = _prescriptionsService.error; error = "No Prescription Found";
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
_filterList(); _filterList();
@ -268,7 +269,7 @@ class PrescriptionViewModel extends BaseViewModel {
if (patientType == "7") if (patientType == "7")
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
else else
setState(ViewState.Error); setState(ViewState.ErrorLocal);
} else { } else {
_filterList(); _filterList();
await _getPrescriptionsOrders(); await _getPrescriptionsOrders();

@ -43,16 +43,15 @@ class ProcedureViewModel extends BaseViewModel {
List<FinalRadiology> get radiologyList => List<FinalRadiology> get radiologyList =>
_radiologyService.finalRadiologyList; _radiologyService.finalRadiologyList;
List<PatientLabOrders> get patientLabOrdersList => _labsService.patientLabOrdersList;
List<LabOrderResult> get labOrdersResultsList => List<LabOrderResult> get labOrdersResultsList =>
_labsService.labOrdersResultsList; _labsService.labOrdersResultsList;
List<PatientLabOrdersList> _patientLabOrdersListClinic = List(); List<PatientLabOrdersList> _patientLabOrdersListClinic = List();
List<PatientLabOrdersList> _patientLabOrdersListHospital = List(); List<PatientLabOrdersList> _patientLabOrdersListHospital = List();
List<PatientLabOrdersList> get patientLabOrdersList =>
filterType == FilterType.Clinic
? _patientLabOrdersListClinic
: _patientLabOrdersListHospital;
Future getProcedure({int mrn,String patientType}) async { Future getProcedure({int mrn,String patientType}) async {
hasError = false; hasError = false;
@ -147,7 +146,7 @@ class ProcedureViewModel extends BaseViewModel {
if(patientType=="7") if(patientType=="7")
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
else else
setState(ViewState.Error); setState(ViewState.ErrorLocal);
} else { } else {
_radiologyService.finalRadiologyList.forEach((element) { _radiologyService.finalRadiologyList.forEach((element) {
List<FinalRadiologyList> finalRadiologyListClinic = List<FinalRadiologyList> finalRadiologyListClinic =
@ -222,6 +221,8 @@ class ProcedureViewModel extends BaseViewModel {
List<LabResultList> labResultLists = List(); List<LabResultList> labResultLists = List();
List<LabResultList> get labResultListsCoustom { List<LabResultList> get labResultListsCoustom {
return labResultLists; return labResultLists;
} }
@ -233,45 +234,6 @@ class ProcedureViewModel extends BaseViewModel {
error = _labsService.error; error = _labsService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
_labsService.patientLabOrdersList.forEach((element) {
List<PatientLabOrdersList> patientLabOrdersClinic =
_patientLabOrdersListClinic
.where((elementClinic) =>
elementClinic.filterName == element.clinicDescription)
.toList();
if (patientLabOrdersClinic.length != 0) {
_patientLabOrdersListClinic[_patientLabOrdersListClinic
.indexOf(patientLabOrdersClinic[0])]
.patientLabOrdersList
.add(element);
} else {
_patientLabOrdersListClinic.add(PatientLabOrdersList(
filterName: element.clinicDescription,
patientDoctorAppointment: element));
}
// doctor list sort via project
List<PatientLabOrdersList> patientLabOrdersHospital =
_patientLabOrdersListHospital
.where(
(elementClinic) =>
elementClinic.filterName == element.projectName,
)
.toList();
if (patientLabOrdersHospital.length != 0) {
_patientLabOrdersListHospital[_patientLabOrdersListHospital
.indexOf(patientLabOrdersHospital[0])]
.patientLabOrdersList
.add(element);
} else {
_patientLabOrdersListHospital.add(PatientLabOrdersList(
filterName: element.projectName,
patientDoctorAppointment: element));
}
});
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }

@ -10,6 +10,7 @@ class SickLeaveViewModel extends BaseViewModel {
SickLeaveService _sickLeaveService = locator<SickLeaveService>(); SickLeaveService _sickLeaveService = locator<SickLeaveService>();
get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics; get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics;
get getAllSIckLeave => _sickLeaveService.getAllSickLeave; get getAllSIckLeave => _sickLeaveService.getAllSickLeave;
get getAllSIckLeavePatient => _sickLeaveService.getAllSickLeavePatient;
List get allOffTime => _sickLeaveService.getOffTimeList; List get allOffTime => _sickLeaveService.getOffTimeList;
List get allReasons => _sickLeaveService.getReasons; List get allReasons => _sickLeaveService.getReasons;
List get coveringDoctors => _sickLeaveService.coveringDoctorsList; List get coveringDoctors => _sickLeaveService.coveringDoctorsList;
@ -56,6 +57,16 @@ class SickLeaveViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getSickLeavePatient(patientMRN) async {
setState(ViewState.Busy);
await _sickLeaveService.getSickLeavePatient(patientMRN);
if (_sickLeaveService.hasError) {
error = _sickLeaveService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future getRescheduleLeave() async { Future getRescheduleLeave() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _sickLeaveService.getRescheduleLeave(); await _sickLeaveService.getRescheduleLeave();

File diff suppressed because one or more lines are too long

@ -131,7 +131,8 @@ class DoctorApp {
IconData(0xe833, fontFamily: _kFontFam, fontPackage: _kFontPkg); IconData(0xe833, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData edit = static const IconData edit =
IconData(0xe834, fontFamily: _kFontFam, fontPackage: _kFontPkg); IconData(0xe834, fontFamily: _kFontFam, fontPackage: _kFontPkg);
// static const IconData lab_results = IconData(0xe835, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData lab_results2 =
IconData(0xe835, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData leaves = static const IconData leaves =
IconData(0xe836, fontFamily: _kFontFam, fontPackage: _kFontPkg); IconData(0xe836, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData logout = static const IconData logout =
@ -260,8 +261,6 @@ class DoctorApp {
IconData(0xe874, fontFamily: _kFontFam, fontPackage: _kFontPkg); IconData(0xe874, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData ovrweight_bmi_1 = static const IconData ovrweight_bmi_1 =
IconData(0xe875, fontFamily: _kFontFam, fontPackage: _kFontPkg); IconData(0xe875, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData powered_by_cs_1 =
IconData(0xe876, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData qr_code_3 = static const IconData qr_code_3 =
IconData(0xe877, fontFamily: _kFontFam, fontPackage: _kFontPkg); IconData(0xe877, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData reschedule__1 = static const IconData reschedule__1 =
@ -360,8 +359,6 @@ class DoctorApp {
IconData(0xe8a6, fontFamily: _kFontFam, fontPackage: _kFontPkg); IconData(0xe8a6, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData obese_bmi_r_1 = static const IconData obese_bmi_r_1 =
IconData(0xe8a9, fontFamily: _kFontFam, fontPackage: _kFontPkg); IconData(0xe8a9, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData menu =
IconData(0xe8ad, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData inpatient = static const IconData inpatient =
IconData(0xe959, fontFamily: _kFontFam, fontPackage: _kFontPkg); IconData(0xe959, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData discharge = static const IconData discharge =
@ -378,4 +375,10 @@ class DoctorApp {
IconData(0xe95f, fontFamily: _kFontFam, fontPackage: _kFontPkg); IconData(0xe95f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData speechtotext = static const IconData speechtotext =
IconData(0xe960, fontFamily: _kFontFam, fontPackage: _kFontPkg); IconData(0xe960, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData search_medicines =
IconData(0xe964, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData discharge_patients =
IconData(0xe965, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData referral_discharge =
IconData(0xe966, fontFamily: _kFontFam, fontPackage: _kFontPkg);
} }

@ -27,6 +27,8 @@ import 'core/service/patient-admission-request-service.dart';
import 'core/service/patient-doctor-referral-service.dart'; import 'core/service/patient-doctor-referral-service.dart';
import 'core/service/patient-ucaf-service.dart'; import 'core/service/patient-ucaf-service.dart';
import 'core/service/patient-vital-signs-service.dart'; import 'core/service/patient-vital-signs-service.dart';
import 'core/service/patient/out_patient_service.dart';
import 'core/service/patientInPatientService.dart';
import 'core/service/prescriptions_service.dart'; import 'core/service/prescriptions_service.dart';
import 'core/service/radiology_service.dart'; import 'core/service/radiology_service.dart';
import 'core/service/referral_patient_service.dart'; import 'core/service/referral_patient_service.dart';
@ -35,6 +37,7 @@ import 'core/service/schedule_service.dart';
import 'core/viewModel/DischargedPatientViewModel.dart'; import 'core/viewModel/DischargedPatientViewModel.dart';
import 'core/viewModel/InsuranceViewModel.dart'; import 'core/viewModel/InsuranceViewModel.dart';
import 'core/viewModel/PatientMuseViewModel.dart'; import 'core/viewModel/PatientMuseViewModel.dart';
import 'core/viewModel/PatientSearchViewModel.dart';
import 'core/viewModel/SOAP_view_model.dart'; import 'core/viewModel/SOAP_view_model.dart';
import 'core/viewModel/doctor_replay_view_model.dart'; import 'core/viewModel/doctor_replay_view_model.dart';
import 'core/viewModel/labs_view_model.dart'; import 'core/viewModel/labs_view_model.dart';
@ -79,6 +82,8 @@ void setupLocator() {
locator.registerLazySingleton(() => ReferralService()); locator.registerLazySingleton(() => ReferralService());
locator.registerLazySingleton(() => MyReferralInPatientService()); locator.registerLazySingleton(() => MyReferralInPatientService());
locator.registerLazySingleton(() => DischargedPatientService()); locator.registerLazySingleton(() => DischargedPatientService());
locator.registerLazySingleton(() => PatientInPatientService());
locator.registerLazySingleton(() => OutPatientService());
/// View Model /// View Model
locator.registerFactory(() => DoctorReplayViewModel()); locator.registerFactory(() => DoctorReplayViewModel());
@ -104,4 +109,5 @@ void setupLocator() {
locator.registerFactory(() => RadiologyViewModel()); locator.registerFactory(() => RadiologyViewModel());
locator.registerFactory(() => PrescriptionsViewModel()); locator.registerFactory(() => PrescriptionsViewModel());
locator.registerFactory(() => DischargedPatientViewModel()); locator.registerFactory(() => DischargedPatientViewModel());
locator.registerFactory(() => PatientSearchViewModel());
} }

@ -64,6 +64,7 @@ class MyReferredPatientModel {
String referralClinicDescription; String referralClinicDescription;
String referringDoctorName; String referringDoctorName;
bool isReferralDoctorSameBranch; bool isReferralDoctorSameBranch;
String referralStatusDesc;
MyReferredPatientModel({ MyReferredPatientModel({
this.rowID, this.rowID,
@ -128,7 +129,7 @@ class MyReferredPatientModel {
this.referringDoctorName, this.referringDoctorName,
this.isReferralDoctorSameBranch, this.isReferralDoctorSameBranch,
this.referralDoctorName, this.referralDoctorName,
this.referralClinicDescription, this.referralClinicDescription,this.referralStatusDesc
}); });
MyReferredPatientModel.fromJson(Map<String, dynamic> json) { MyReferredPatientModel.fromJson(Map<String, dynamic> json) {
@ -194,6 +195,7 @@ class MyReferredPatientModel {
referringDoctorName = json['ReferringDoctorName']; referringDoctorName = json['ReferringDoctorName'];
referralDoctorName = json['ReferralDoctorName']; referralDoctorName = json['ReferralDoctorName'];
referralClinicDescription = json['ReferralClinicDescription']; referralClinicDescription = json['ReferralClinicDescription'];
referralStatusDesc = json['ReferralStatusDesc'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {

@ -61,6 +61,7 @@ class PatiantInformtion {
int visitTypeId; int visitTypeId;
String startTimes; String startTimes;
String dischargeDate; String dischargeDate;
int status;
PatiantInformtion( PatiantInformtion(
{this.patientDetails, {this.patientDetails,
this.projectId, this.projectId,
@ -120,7 +121,7 @@ class PatiantInformtion {
this.nationalityFlagURL, this.nationalityFlagURL,
this.patientStatusType, this.patientStatusType,
this.visitTypeId, this.visitTypeId,
this.startTimes,this.dischargeDate}); this.startTimes,this.dischargeDate,this.status});
factory PatiantInformtion.fromJson(Map<String, dynamic> json) => factory PatiantInformtion.fromJson(Map<String, dynamic> json) =>
PatiantInformtion( PatiantInformtion(
@ -173,7 +174,7 @@ class PatiantInformtion {
genderDescription: json["GenderDescription"], genderDescription: json["GenderDescription"],
nursingStationName: json["NursingStationName"], nursingStationName: json["NursingStationName"],
appointmentDate: json["AppointmentDate"] ?? '', appointmentDate: json["AppointmentDate"] ?? '',
startTime: json["startTime"], startTime: json["startTime"]??json['StartTime'],
appointmentNo: json['appointmentNo'] ?? json['AppointmentNo'], appointmentNo: json['appointmentNo'] ?? json['AppointmentNo'],
appointmentType: json['appointmentType'], appointmentType: json['appointmentType'],
appointmentTypeId: json['appointmentTypeId']?? json['appointmentTypeid'], appointmentTypeId: json['appointmentTypeId']?? json['appointmentTypeid'],
@ -197,5 +198,6 @@ class PatiantInformtion {
visitTypeId: json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'], visitTypeId: json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'],
startTimes: json['StartTime'] ?? json['StartTime'], startTimes: json['StartTime'] ?? json['StartTime'],
dischargeDate: json['DischargeDate'] , dischargeDate: json['DischargeDate'] ,
status: json['Status'] ,
); );
} }

@ -35,6 +35,7 @@ const String LOGIN = 'login';
const String VERIFICATION_METHODS = 'verification-methods'; const String VERIFICATION_METHODS = 'verification-methods';
const String PATIENTS = 'patients/patients'; const String PATIENTS = 'patients/patients';
const String PATIENTS_PROFILE = 'patients/patients-profile'; const String PATIENTS_PROFILE = 'patients/patients-profile';
const String IN_PATIENTS_PROFILE = 'inpatients/patients-profile';
const String LAB_RESULT = 'patients/lab_result'; const String LAB_RESULT = 'patients/lab_result';
const String MEDICAL_FILE = 'patients/radiology'; const String MEDICAL_FILE = 'patients/radiology';
const String PROGRESS_NOTE = 'patients/progress-note'; const String PROGRESS_NOTE = 'patients/progress-note';

@ -60,6 +60,4 @@ class HomePageCard extends StatelessWidget {
), ),
); );
} }
getDashboardWidget() {}
} }

@ -2,6 +2,8 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.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/hospital_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart';
@ -12,9 +14,13 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_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/medicine/search_medicine_patient_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart';
import 'package:doctor_app_flutter/screens/patients/DischargedPatientPage.dart'; import 'package:doctor_app_flutter/screens/patients/DischargedPatientPage.dart';
import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart';
import 'package:doctor_app_flutter/screens/patients/ReferralDischargedPatientPage.dart'; import 'package:doctor_app_flutter/screens/patients/ReferralDischargedPatientPage.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen_new.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_new.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
@ -28,6 +34,7 @@ import 'package:doctor_app_flutter/widgets/dashboard/swiper_rounded_pagination.d
import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -35,7 +42,6 @@ import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:sticky_headers/sticky_headers/widget.dart'; import 'package:sticky_headers/sticky_headers/widget.dart';
import '../../routes.dart';
import '../../widgets/shared/app_texts_widget.dart'; import '../../widgets/shared/app_texts_widget.dart';
import '../../widgets/shared/rounded_container_widget.dart'; import '../../widgets/shared/rounded_container_widget.dart';
import 'home_page_card.dart'; import 'home_page_card.dart';
@ -457,7 +463,6 @@ class _HomeScreenState extends State<HomeScreen> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
new Container( new Container(
height: 130, height: 130,
child: new ListView( child: new ListView(
@ -493,15 +498,21 @@ class _HomeScreenState extends State<HomeScreen> {
), ),
hasBorder: false, hasBorder: false,
onTap: () { onTap: () {
getRequestHeader(true); Navigator.push(
Navigator.of(context) context,
.pushNamed(PATIENTS, arguments: { FadePage(
"patientSearchForm": page: PatientInPatientScreen(),
_patientSearchFormValues, ),
"selectedType": "1", );
"arrivalType": "1", // getRequestHeader(true);
"isInpatient": true // Navigator.of(context)
}); // .pushNamed(PATIENTS, arguments: {
// "patientSearchForm":
// _patientSearchFormValues,
// "selectedType": "1",
// "arrivalType": "1",
// "isInpatient": true
// });
}, },
), ),
HomePageCard( HomePageCard(
@ -534,25 +545,36 @@ class _HomeScreenState extends State<HomeScreen> {
), ),
hasBorder: false, hasBorder: false,
onTap: () { onTap: () {
getRequestHeader(false);
Navigator.of(context) String date = DateUtils.convertDateToFormat(
.pushNamed(PATIENTS, arguments: { DateTime(DateTime.now().year, DateTime.now().month,
"patientSearchForm": DateTime.now().day ),
_patientSearchFormValues, 'yyyy-MM-dd');
"selectedType": "0",
"arrivalType": "1", Navigator.push(
"isInpatient": false context,
}); MaterialPageRoute(
builder: (context) =>
PatientsScreenNew(
isSearch: false,
isInpatient: false,
patientSearchRequestModel:
PatientSearchRequestModel(from: date, to: date,doctorID: authProvider.doctorProfile.doctorID),
selectedPatientType:
PatientType.OutPatient,
isSearchWithKeyInfo: false,
),
));
}, },
), ),
HomePageCard( HomePageCard(
color: Colors.red[800], color: Colors.black,
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.center, MainAxisAlignment.center,
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
@ -586,27 +608,27 @@ class _HomeScreenState extends State<HomeScreen> {
}, },
), ),
HomePageCard( HomePageCard(
color: Colors.grey[300], color: Colors.red[800],
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.center, MainAxisAlignment.center,
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 10, left: 10, right: 0), top: 10, left: 10, right: 0),
child: Icon( child: Icon(
DoctorApp.referral_1, DoctorApp.discharge_patients,
size: 35, size: 35,
color: Colors.black, color: Colors.white,
)), )),
Container( Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: AppText( child: AppText(
'Discharged Patients', 'Discharged Patients',
color: Colors.black, color: Colors.white,
textAlign: TextAlign.start, textAlign: TextAlign.start,
fontSize: 15, fontSize: 15,
)) ))
@ -625,27 +647,27 @@ class _HomeScreenState extends State<HomeScreen> {
}, },
), ),
HomePageCard( HomePageCard(
color: Colors.red[800], color: Colors.grey[300],
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.center, MainAxisAlignment.center,
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 10, left: 10, right: 0), top: 10, left: 10, right: 0),
child: Icon( child: Icon(
DoctorApp.referral_1, DoctorApp.referral_discharge,
size: 35, size: 35,
color: Colors.white, color: Colors.black,
)), )),
Container( Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: AppText( child: AppText(
'Referral Discharged', 'Referral Discharged',
color: Colors.white, color: Colors.black,
textAlign: TextAlign.start, textAlign: TextAlign.start,
fontSize: 15, fontSize: 15,
)) ))
@ -684,7 +706,7 @@ class _HomeScreenState extends State<HomeScreen> {
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: AppText( child: AppText(
TranslationBase.of(context) TranslationBase.of(context)
.searchmedicinepatient, .searchPatient,
color: Colors.white, color: Colors.white,
textAlign: TextAlign.start, textAlign: TextAlign.start,
fontSize: 13, fontSize: 13,
@ -697,13 +719,49 @@ class _HomeScreenState extends State<HomeScreen> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) =>
SearchMedicinePatientScreen(), PatientSearchScreenNew(),
)); ));
}, },
), ),
HomePageCard(
color: Colors.red[800],
margin: EdgeInsets.all(5),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(
top: 10, left: 10, right: 0),
child: Icon(
DoctorApp.search_medicines,
size: 32,
color: Colors.white,
)),
Container(
padding: EdgeInsets.all(10),
child: AppText(
TranslationBase.of(context)
.searchMedicine,
color: Colors.white,
textAlign: TextAlign.start,
fontSize: 13,
))
],
),
hasBorder: false,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
MedicineSearchScreen(),
));
},
)
])), ])),
Row( Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround, // mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,

@ -24,14 +24,14 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
patient = routeArgs['patient']; patient = routeArgs['patient'];
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
bool isInpatient = routeArgs['isInpatient'];
return BaseView<MedicalFileViewModel>( return BaseView<MedicalFileViewModel>(
onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId), onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId),
builder: builder:
(BuildContext context, MedicalFileViewModel model, Widget child) => (BuildContext context, MedicalFileViewModel model, Widget child) =>
AppScaffold( AppScaffold(
appBar: PatientProfileHeaderNewDesignAppBar( appBar: PatientProfileHeaderNewDesignAppBar(
patient, patientType.toString() ?? "0", arrivalType), patient, patientType.toString() ?? "0", arrivalType,isInpatient:isInpatient ,),
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(),
body: NetworkBaseView( body: NetworkBaseView(

@ -122,7 +122,7 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
myController.text = model.searchText; myController.text = model.searchText;
return AppScaffold( return AppScaffold(
// baseViewModel: model, // baseViewModel: model,
isShowAppBar: false, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).searchMedicine, appBarTitle: TranslationBase.of(context).searchMedicine,
body: SingleChildScrollView( body: SingleChildScrollView(
child: FractionallySizedBox( child: FractionallySizedBox(
@ -134,7 +134,7 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: SizeConfig.screenHeight * .16, height: 20,
), ),
FractionallySizedBox( FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
@ -157,6 +157,9 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
), ),
), ),
), ),
SizedBox(
height: 20,
),
FractionallySizedBox( FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: Container( child: Container(
@ -197,7 +200,7 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
), ),
if (myController.text != '') if (myController.text != '')
Container( Container(
height: MediaQuery.of(context).size.height * 0.5, height: MediaQuery.of(context).size.height * 0.6,
child: ListView.builder( child: ListView.builder(
padding: const EdgeInsets.only(top: 20), padding: const EdgeInsets.only(top: 20),

@ -27,10 +27,11 @@ class _DischargedPatientState extends State<DischargedPatient> {
onModelReady: (model) => model.getDischargedPatient(), onModelReady: (model) => model.getDischargedPatient(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
appBarTitle: 'Discharged Patient', appBarTitle: 'Discharged Patient',
subtitle: "Last Three Months",
backgroundColor: Colors.grey[200], backgroundColor: Colors.grey[200],
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
body: model.filterData.isEmpty?Center( body: model.myDischargedPatient.isEmpty?Center(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
@ -309,7 +310,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
fontSize: 14,fontWeight: FontWeight.w300, fontSize: 14,fontWeight: FontWeight.w300,
), ),
AppText( AppText(
"${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}", "${DateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(DateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}",
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.w700), fontWeight: FontWeight.w700),
], ],

@ -0,0 +1,239 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/material.dart';
import '../../routes.dart';
class PatientInPatientScreen extends StatefulWidget {
@override
_PatientInPatientScreenState createState() => _PatientInPatientScreenState();
}
class _PatientInPatientScreenState extends State<PatientInPatientScreen> {
PatientSearchRequestModel requestModel = PatientSearchRequestModel();
int _activeTab = 0;
TextEditingController _searchController = TextEditingController();
@override
void dispose() {
_searchController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<PatientSearchViewModel>(
onModelReady: (model) => model.getInPatientList(requestModel),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
color: Colors.white,
),
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50),
child: Row(children: [
IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context),
),
Expanded(
child: AppText(
TranslationBase.of(context).inPatient,
fontSize: SizeConfig.textMultiplier * 2.8,
fontWeight: FontWeight.bold,
color: Color(0xFF2B353E),
fontFamily: 'Poppins',
),
),
]),
),
),
tabsBar(context, screenSize, model),
Container(
margin: EdgeInsets.all(16.0),
child: AppTextFieldCustom(
hintText: TranslationBase.of(context)
.searchPatientName,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Colors.black,
),
onPressed: () {},
),
controller: _searchController,
onChanged: (value) {
model.filterSearchResults(value);
}),
),
model.filteredInPatientItems.length > 0
? Expanded(
child: Container(
margin: EdgeInsets.symmetric(horizontal: 16.0),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// const SizedBox(
// height: 16,
// ),
...List.generate(model.filteredInPatientItems.length, (index) {
if(_activeTab == 0)
return PatientCard(
patientInfo: model.filteredInPatientItems[index],
patientType: "1",
arrivalType: "1",
isInpatient: true,
isMyPatient: model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID,
onTap: () {
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
"patient": model.filteredInPatientItems[index],
"patientType": "1",
"from": "0",
"to": "0",
"isSearch": false,
"isInpatient": true,
"arrivalType": "1",
});
},
);
else if(model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID && _activeTab==1)
return PatientCard(
patientInfo: model.filteredInPatientItems[index],
patientType: "1",
arrivalType: "1",
isInpatient: true,
isMyPatient: model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID,
onTap: () {
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
"patient": model.filteredInPatientItems[index],
"patientType": "1",
"from": "0",
"to": "0",
"isSearch": false,
"isInpatient": true,
"arrivalType": "1",
});
},
);
else return SizedBox();
}),
SizedBox(height: 15,)
],
),
),
),
)
: Expanded(
child: SingleChildScrollView(
child: Container(
child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable)),
),
),
],
),
),
);
}
Widget tabsBar(
BuildContext context, Size screenSize, PatientSearchViewModel model) {
List<String> _tabs = [
TranslationBase.of(context).inPatientAll.toUpperCase(),
TranslationBase.of(context).inPatient.toUpperCase(),
];
return Container(
height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC),
borderRadius: 4, borderWidth: 0),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _tabs.map((item) {
bool _isActive = _tabs[_activeTab] == item ? true : false;
return Expanded(
child: InkWell(
onTap: () async {
setState(() {
_activeTab = _tabs.indexOf(item);
});
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
if (_activeTab==0) {
GifLoaderDialogUtils.showMyDialog(
context);
await model.getInPatientList(requestModel,
isMyInpatient: _activeTab == 1, isFirstTime: false);
GifLoaderDialogUtils.hideDialog(
context);
}
},
child: Center(
child: Container(
height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
_isActive
? Color(0xFFD02127 /*B8382B*/)
: Color(0xFFEAEAEA),
_isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4,
borderWidth: 0),
child: Center(
child: AppText(
item,
fontSize: SizeConfig.textMultiplier * 1.8,
color: _isActive ? Colors.white : Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
),
),
),
),
);
}).toList(),
),
);
}
}

@ -75,6 +75,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
"patientType": "1", "patientType": "1",
"isInpatient": true, "isInpatient": true,
"arrivalType": "1", "arrivalType": "1",
"isDischargedPatient":true,
"from": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), "from": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
"to": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), "to": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
}); });
@ -195,9 +196,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
DateUtils.convertDateFromServerFormat( "${DateUtils.convertStringToDate(referredPatient.dischargeDate).difference(DateUtils.convertStringToDate(referredPatient.admissionDate)).inDays+1}",
referredPatient.dischargeDate,
"dd MMM,yyyy"),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: fontSize:

@ -33,7 +33,7 @@ class _InsuranceApprovalScreenNewState
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
patient = routeArgs['patient']; patient = routeArgs['patient'];
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
bool isInpatient = routeArgs['isInpatient'];
return BaseView<InsuranceViewModel>( return BaseView<InsuranceViewModel>(
onModelReady: patient.admissionNo != null onModelReady: patient.admissionNo != null
? (model) => model.getInsuranceInPatient(mrn: patient.patientId) ? (model) => model.getInsuranceInPatient(mrn: patient.patientId)
@ -45,7 +45,7 @@ class _InsuranceApprovalScreenNewState
builder: (BuildContext context, InsuranceViewModel model, Widget child) => builder: (BuildContext context, InsuranceViewModel model, Widget child) =>
AppScaffold( AppScaffold(
appBar: PatientProfileHeaderNewDesignAppBar( appBar: PatientProfileHeaderNewDesignAppBar(
patient, patientType.toString() ?? "0", patientType), patient, patientType.toString() ?? "0", patientType,isInpatient: isInpatient,),
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).approvals, appBarTitle: TranslationBase.of(context).approvals,

@ -0,0 +1,43 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class HeaderInSearch extends StatelessWidget with PreferredSizeWidget {
final String title;
const HeaderInSearch({Key key, this.title}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
color: Colors.white,
),
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 35),
child: Row(children: [
IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context),
),
Expanded(
child: AppText(
title,
fontSize: SizeConfig.textMultiplier * 2.8,
fontWeight: FontWeight.bold,
color: Color(0xFF2B353E),
fontFamily: 'Poppins',
),
),
]),
),
);
}
@override
Size get preferredSize => Size(double.maxFinite,65);
}

@ -0,0 +1,310 @@
import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_new.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/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/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class PatientSearchScreenNew extends StatefulWidget {
@override
_PatientSearchScreenNewState createState() => _PatientSearchScreenNewState();
}
class _PatientSearchScreenNewState extends State<PatientSearchScreenNew> {
bool showOther = false;
bool isFormSubmitted = false;
TextEditingController patientFileInfoController = TextEditingController();
TextEditingController firstNameInfoController = TextEditingController();
TextEditingController middleNameInfoController = TextEditingController();
TextEditingController lastNameFileInfoController = TextEditingController();
PatientType selectedPatientType = PatientType.inPatient;
AuthViewModel authProvider;
@override
Widget build(BuildContext context) {
authProvider =Provider.of(context);
return BaseView<PatientSearchViewModel>(
onModelReady: (model) async {},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView(
child: Center(
child: Column(
children: [
BottomSheetTitle(
title: TranslationBase.of(context).searchPatient),
FractionallySizedBox(
widthFactor: 0.9,
child: Container(
color: Theme.of(context).scaffoldBackgroundColor,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
// AppText(
// 'Patient Type',
// fontWeight: FontWeight.w600,
// ),
// Row(
// children: [
// Row(
// children: [
// Radio(
// activeColor: Color(0xFFB9382C),
// value: PatientType.inPatient,
// groupValue: selectedPatientType,
// onChanged: (value) {
// setState(() {
// selectedPatientType =
// PatientType.inPatient;
// });
// },
// ),
// Text('InPatient'),
// ],
// ),
// Row(
// children: [
// Radio(
// activeColor: Color(0xFFB9382C),
// value: PatientType.OutPatient,
// groupValue: selectedPatientType,
// onChanged: (value) {
// setState(() {
// selectedPatientType =
// PatientType.OutPatient;
// });
// },
// ),
// Text('OutPatient'),
// ],
// ),
// ],
// ),
SizedBox(
height: 10,
),
Container(
margin:
EdgeInsets.only(left: 0, right: 0, top: 15),
child: AppTextFieldCustom(
hintText: TranslationBase.of(context)
.patpatientIDMobilenationalientID,
isTextFieldHasSuffix: false,
maxLines: 1,
minLines: 1,
hasBorder: true,
controller: patientFileInfoController,
validationError: (isFormSubmitted && (
patientFileInfoController
.text.isEmpty &&
firstNameInfoController
.text.isEmpty &&
middleNameInfoController
.text.isEmpty &&
lastNameFileInfoController
.text.isEmpty))
? TranslationBase.of(context).emptyMessage
: null,
),
),
SizedBox(
height: 5,
),
// Row(
// mainAxisAlignment: MainAxisAlignment.end,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// InkWell(
// child: this.showOther == false
// ? AppText(
// TranslationBase.of(context)
// .searchWithOther,
// color: Colors.red,
// fontWeight: FontWeight.bold,
// )
// : AppText(
// TranslationBase.of(context)
// .hideOtherCriteria,
// color: Colors.red,
// fontWeight: FontWeight.bold),
// onTap: () {
// setState(() {
// this.showOther = !this.showOther;
// });
// },
// )
// ],
// ),
// SizedBox(
// height: 30,
// ),
// if (showOther)
// Column(
// children: [
// AppTextFieldCustom(
// hintText:
// TranslationBase.of(context).firstName,
// controller: firstNameInfoController,
// maxLines: 1,
// minLines: 1,
// hasBorder: true,
// onChanged: (_) {},
// // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null ,
// ),
// SizedBox(
// height: 10,
// ),
// AppTextFieldCustom(
// hintText:
// TranslationBase.of(context).middleName,
// controller: middleNameInfoController,
// maxLines: 1,
// minLines: 1,
// onChanged: (_) {},
// hasBorder: true,
// // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null ,
// ),
// SizedBox(
// height: 10,
// ),
// AppTextFieldCustom(
// hintText:
// TranslationBase.of(context).lastName,
// controller: lastNameFileInfoController,
// maxLines: 1,
// minLines: 1,
// onChanged: (_) {},
// hasBorder: true,
// // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null ,
// ),
// SizedBox(
// height: 10,
// ),
// ],
// ),
SizedBox(
height: MediaQuery.of(context).size.height * 0.12,
),
])),
),
],
),
),
),
bottomSheet: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
),
border: Border.all(color: HexColor('#707070'), width: 0),
),
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
fontWeight: FontWeight.w700,
title: TranslationBase.of(context).search,
onPressed: () {
onSubmitSearch();
},
color: Colors.red[800],
),
),
),
),
SizedBox(
height: 5,
),
],
),
),
),
);
}
onSubmitSearch() {
GifLoaderDialogUtils.showMyDialog(context);
setState(() {
isFormSubmitted = true;
});
PatientSearchRequestModel patientSearchRequestModel =
PatientSearchRequestModel(doctorID: authProvider.doctorProfile.doctorID);
if (showOther) {
patientSearchRequestModel.firstName = firstNameInfoController.text.trim().isEmpty?"0":firstNameInfoController.text.trim();
patientSearchRequestModel.middleName = middleNameInfoController.text.trim().isEmpty?"0":middleNameInfoController.text.trim();
patientSearchRequestModel.lastName = lastNameFileInfoController.text.isEmpty?"0":lastNameFileInfoController.text.trim();
}
if (patientFileInfoController.text.isNotEmpty) {
if (patientFileInfoController.text.length == 10 &&
(patientFileInfoController.text[0] == '2' ||
patientFileInfoController.text[0] == '1')) {
patientSearchRequestModel.identificationNo =
patientFileInfoController.text;
patientSearchRequestModel.searchType = 2;
patientSearchRequestModel.patientID = 0;
} else if ((patientFileInfoController.text.length == 10 ||
patientFileInfoController.text.length == 9) &&
((patientFileInfoController.text[0] == '0' &&
patientFileInfoController.text[1] == '5') ||
patientFileInfoController.text[0] == '5')) {
patientSearchRequestModel.mobileNo = patientFileInfoController.text;
patientSearchRequestModel.searchType = 0;
} else {
patientSearchRequestModel.patientID =
int.parse(patientFileInfoController.text);
patientSearchRequestModel.searchType = 1;
}
}
GifLoaderDialogUtils.hideDialog(context);
if (patientFileInfoController.text.isNotEmpty ||
firstNameInfoController.text.isNotEmpty ||
middleNameInfoController.text.isNotEmpty ||
lastNameFileInfoController.text.isNotEmpty) {
setState(() {
isFormSubmitted = false;
});
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => PatientsScreenNew(
selectedPatientType: selectedPatientType,
patientSearchRequestModel: patientSearchRequestModel,
isSearchWithKeyInfo:
patientFileInfoController.text.isNotEmpty ? true : false,
isSearch: true,
isSearchAndOut:true,
searchKey: patientFileInfoController.text,
isInpatient: false,
),
),
);
}
}
}

@ -0,0 +1,259 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/header.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
// ignore: must_be_immutable
class PatientsScreenNew extends StatefulWidget {
final patientSearchForm;
final selectedType;
final isAppbar;
final arrivalType;
final isView;
final PatientType selectedPatientType;
final PatientSearchRequestModel patientSearchRequestModel;
final bool isSearchWithKeyInfo;
final bool isSearch;
final bool isInpatient;
final bool isSearchAndOut;
final String searchKey;
PatientsScreenNew(
{this.patientSearchForm,
this.selectedType,
this.isAppbar = true,
this.arrivalType,
this.isView,
this.selectedPatientType,
this.patientSearchRequestModel,
this.isSearchWithKeyInfo = true,
this.isSearch = false,
this.isInpatient = false, this.searchKey, this.isSearchAndOut=false});
@override
_PatientsScreenNewState createState() => _PatientsScreenNewState();
}
class _PatientsScreenNewState extends State<PatientsScreenNew> {
int clinicId;
AuthViewModel authProvider;
List<String> _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week'];
int _activeLocation = 0;
String patientType;
String patientTypeTitle;
var selectedFilter = 1;
String arrivalType;
ProjectViewModel projectsProvider;
var isView;
final _controller = TextEditingController();
PatientModel patient;
@override
Widget build(BuildContext context) {
authProvider = Provider.of(context);
_locations = [
TranslationBase.of(context).today,
TranslationBase.of(context).tomorrow,
TranslationBase.of(context).nextWeek,
];
final screenSize = MediaQuery.of(context).size;
return BaseView<PatientSearchViewModel>(
onModelReady: (model) async {
if(!widget.isSearchWithKeyInfo && widget.selectedPatientType == PatientType.OutPatient) {
await model.getOutPatient(widget.patientSearchRequestModel);
} else {
await model.getPatientFileInformation(widget.patientSearchRequestModel);
}
},
builder: (_, model, w) => AppScaffold(
appBarTitle: "Search Patient",
isShowAppBar: true,
appBar: !widget.isSearch && !widget.isInpatient?HeaderInSearch(
title: "My Out patient",
):HeaderInSearch(
title: "Search for ${widget.searchKey}",
),
baseViewModel: model,
body: Column(
children: [
if(!widget.isInpatient && !widget.isSearch)
Container(
// color: Colors.red,
height: screenSize.height * 0.070,
decoration: TextFieldsUtils
.containerBorderDecoration(
Color(0Xffffffff),
Color(0xFFCCCCCC),
borderRadius: 4,
borderWidth: 0),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _locations.map((item) {
bool _isActive = _locations[_activeLocation] == item
? true
: false;
return Expanded(
child: InkWell(
onTap: () async {
setState(() {
_activeLocation = _locations.indexOf(item);
});
GifLoaderDialogUtils.showMyDialog(context);
await model.getPatientBasedOnDate(item: item,
selectedPatientType: widget.selectedPatientType,
patientSearchRequestModel: widget
.patientSearchRequestModel,
isSearchWithKeyInfo: widget.isSearchWithKeyInfo);
GifLoaderDialogUtils.hideDialog(context);
},
child: Center(
child: Container(
height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
_isActive
? Color(0xFFD02127 /*B8382B*/)
: Color(0xFFEAEAEA),
_isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4,
borderWidth: 0),
child: Center(
child: AppText(
item,
fontSize: SizeConfig.textMultiplier * 1.8,
color: _isActive ? Colors.white : Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
),
),
),
),
);
}).toList(),
),
),
SizedBox(height: 18.5),
Container(
width: SizeConfig.screenWidth * 0.9,
height: 75,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"),
),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(
left: 10, top: 10),
child: AppText(
TranslationBase.of(
context)
.searchPatientName,
fontSize: 13,
)),
AppTextFormField(
// focusNode: focusProject,
controller: _controller,
borderColor: Colors.white,
prefix: IconButton(
icon: Icon(
DoctorApp.filter_1,
color: Colors.black,
),
iconSize: 20,
padding:
EdgeInsets.only(
bottom: 30),
),
onChanged: (String str) {
model.searchData(str);
}),
])),
SizedBox(
height: 10.0,
),
Expanded(
child: Container(
child: model.filterData.isEmpty
? Center(
child: ErrorMessage(
error: TranslationBase.of(context)
.youDontHaveAnyPatient,
),
)
: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.filterData.length,
itemBuilder: (BuildContext ctxt, int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: PatientCard(
patientInfo: model.filterData[index],
patientType: patientType,
arrivalType: arrivalType,
isFromSearch:widget.isSearchAndOut,
isInpatient: widget.isInpatient,
onTap: () {
// TODO change the parameter to daynamic
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": model.filterData[index],
"patientType": "1",
"from": widget
.patientSearchRequestModel.from,
"to": widget
.patientSearchRequestModel.from,
"isSearch": widget.isSearch,
"isInpatient": widget.isInpatient,
"arrivalType": "7",
"isSearchAndOut": widget.isSearchAndOut,
});
},
// isFromSearch: widget.isSearch,
),
);
})),
),
],
)
),
);
}
}

@ -0,0 +1,102 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class TimeBar extends StatefulWidget {
final PatientSearchViewModel model;
final PatientType selectedPatientType;
final PatientSearchRequestModel patientSearchRequestModel;
final bool isSearchWithKeyInfo;
const TimeBar({Key key, this.model, this.selectedPatientType, this.patientSearchRequestModel, this.isSearchWithKeyInfo}) : super(key: key);
@override
_TimeBarState createState() => _TimeBarState();
}
class _TimeBarState extends State<TimeBar> {
@override
Widget build(BuildContext context) {
List _locations = [
TranslationBase.of(context).today,
TranslationBase.of(context).tomorrow,
TranslationBase.of(context).nextWeek,
];
int _activeLocation = 0;
return Container(
height: MediaQuery.of(context).size.height * 0.0619,
width: SizeConfig.screenWidth * 0.94,
decoration: BoxDecoration(
color: Color(0Xffffffff),
borderRadius: BorderRadius.circular(12.5),
// border: Border.all(
// width: 0.5,
// ),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _locations.map((item) {
bool _isActive = _locations[_activeLocation] == item ? true : false;
return Column(mainAxisSize: MainAxisSize.min, children: <Widget>[
InkWell(
child: Center(
child: Container(
height: MediaQuery.of(context).size.height * 0.058,
width: SizeConfig.screenWidth * 0.2334,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(12.5),
topRight: Radius.circular(12.5),
topLeft: Radius.circular(9.5),
bottomLeft: Radius.circular(9.5)),
color: _isActive ? HexColor("#B8382B") : Colors.white,
),
child: Center(
child: Text(
item,
style: TextStyle(
fontSize: 12,
color: _isActive
? Colors.white
: Colors.black, //Colors.black,
fontWeight: FontWeight.normal,
),
),
)),
),
onTap: () async{
setState(() {
_activeLocation = _locations.indexOf(item);
});
GifLoaderDialogUtils.showMyDialog(context);
await widget.model.getPatientBasedOnDate(item:item,selectedPatientType:widget.selectedPatientType, patientSearchRequestModel:widget.patientSearchRequestModel, isSearchWithKeyInfo:widget.isSearchWithKeyInfo);
GifLoaderDialogUtils.hideDialog(context);
}),
_isActive
? Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(10),
topRight: Radius.circular(10)),
color: Colors.white),
alignment: Alignment.center,
height: 1,
width: SizeConfig.screenWidth * 0.23,
)
: Container()
]);
}).toList(),
),
);
}
}

@ -124,260 +124,240 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
}, },
child: AppScaffold( child: AppScaffold(
appBarTitle: TranslationBase.of(context).searchPatient, appBarTitle: TranslationBase.of(context).searchPatient,
isShowAppBar: false, isShowAppBar: true,
body: ListView( body: Column(
children: <Widget>[ mainAxisAlignment: MainAxisAlignment.spaceBetween,
RoundedContainer( children: [
child: Column( RoundedContainer(
children: <Widget>[ showBorder: false,
Column( child: Column(
children: <Widget>[ children: <Widget>[
// Container( Column(
// child: Icon( children: <Widget>[
// DoctorApp.search_patient_1, // Container(
// size: 100, // child: Icon(
// color: Colors.black, // DoctorApp.search_patient_1,
// ), // size: 100,
// margin: EdgeInsets.only(top: 10), // color: Colors.black,
// ), // ),
// Padding( // margin: EdgeInsets.only(top: 10),
// padding: const EdgeInsets.only(top: 12.0), // ),
// child: AppText( // Padding(
// TranslationBase.of(context) // padding: const EdgeInsets.only(top: 12.0),
// .searchPatientImageCaptionTitle // child: AppText(
// .toUpperCase(), // TranslationBase.of(context)
// fontWeight: FontWeight.bold, // .searchPatientImageCaptionTitle
// fontSize: SizeConfig.heightMultiplier * 2.5, // .toUpperCase(),
// ), // fontWeight: FontWeight.bold,
// ), // fontSize: SizeConfig.heightMultiplier * 2.5,
// Padding( // ),
// padding: const EdgeInsets.only(top: 5.0), // ),
// child: AppText( // Padding(
// TranslationBase.of(context) // padding: const EdgeInsets.only(top: 5.0),
// .searchPatientImageCaptionBody, // child: AppText(
// fontSize: SizeConfig.heightMultiplier * 2, // TranslationBase.of(context)
// ), // .searchPatientImageCaptionBody,
// ) // fontSize: SizeConfig.heightMultiplier * 2,
], // ),
), // )
Container( ],
padding: EdgeInsets.all(15), ),
width: SizeConfig.screenWidth * 1, Container(
child: Form( padding: EdgeInsets.all(15),
key: _formKey, width: SizeConfig.screenWidth * 1,
autovalidate: _autoValidate, child: Form(
child: Column( key: _formKey,
crossAxisAlignment: CrossAxisAlignment.start, autovalidate: _autoValidate,
children: <Widget>[ child: Column(
SizedBox( crossAxisAlignment: CrossAxisAlignment.start,
height: 15, children: <Widget>[
), SizedBox(
if (_selectedType != '7') height: 15,
Container( ),
decoration: BoxDecoration( if (_selectedType != '7')
borderRadius: Container(
BorderRadius.all(Radius.circular(6.0)), decoration: BoxDecoration(
border: Border.all( borderRadius:
width: 1.0, color: HexColor("#CCCCCC"))), BorderRadius.all(Radius.circular(6.0)),
padding: EdgeInsets.all(10), border: Border.all(
child: AppTextFormField( width: 1.0,
labelText: TranslationBase.of(context) color: HexColor("#CCCCCC"))),
.patpatientIDMobilenationalientID, padding: EdgeInsets.all(10),
borderColor: Colors.white, child: AppTextFormField(
textInputType: TextInputType.number, labelText: TranslationBase.of(context)
textInputAction: TextInputAction.done, .patpatientIDMobilenationalientID,
inputFormatter: ONLY_NUMBERS, borderColor: Colors.white,
focusNode: _nodeText1, textInputType: TextInputType.number,
onSaved: (value) { textInputAction: TextInputAction.done,
if (value != null && value != '') { inputFormatter: ONLY_NUMBERS,
if (value.length == 10 && focusNode: _nodeText1,
(value[0] == '2' || value[0] == '1')) { onSaved: (value) {
_patientSearchFormValues if (value != null && value != '') {
.IdentificationNo = value; if (value.length == 10 &&
_patientSearchFormValues.Searchtype = 2; (value[0] == '2' ||
_patientSearchFormValues.setPatientID = 0; value[0] == '1')) {
} else if ((value.length == 10 || _patientSearchFormValues
value.length == 9) && .IdentificationNo = value;
((value[0] == '0' && value[1] == '5') || _patientSearchFormValues.Searchtype = 2;
value[0] == '5')) { _patientSearchFormValues.setPatientID =
_patientSearchFormValues.MobileNo = value; 0;
_patientSearchFormValues.Searchtype = 0; } else if ((value.length == 10 ||
} else { value.length == 9) &&
_patientSearchFormValues.setPatientID = ((value[0] == '0' &&
int.parse(value); value[1] == '5') ||
_patientSearchFormValues.Searchtype = 1; value[0] == '5')) {
_patientSearchFormValues.MobileNo =
value;
_patientSearchFormValues.Searchtype = 0;
} else {
_patientSearchFormValues.setPatientID =
int.parse(value);
_patientSearchFormValues.Searchtype = 1;
}
} }
}
// else{ // else{
// } // }
// value == null || value == '' // value == null || value == ''
// ? _patientSearchFormValues.setPatientID = // ? _patientSearchFormValues.setPatientID =
// 0 // 0
// : _patientSearchFormValues.setPatientID = // : _patientSearchFormValues.setPatientID =
// int.parse(value); // int.parse(value);
// if (value != null && // if (value != null &&
// value.toString().trim().isEmpty) { // value.toString().trim().isEmpty) {
// _patientSearchFormValues.setPatientID = 0; // _patientSearchFormValues.setPatientID = 0;
// } // }
}, },
),
), ),
SizedBox(
height: 10,
), ),
SizedBox( // Row(
height: 10, // mainAxisAlignment: MainAxisAlignment.end,
), // children: [
// Row( // InkWell(
// mainAxisAlignment: MainAxisAlignment.end, // child: this.isView == false
// children: [ // ? AppText(
// InkWell( // TranslationBase.of(context)
// child: this.isView == false // .searchWithOther,
// ? AppText( // color: Colors.red,
// TranslationBase.of(context) // fontWeight: FontWeight.bold,
// .searchWithOther, // )
// color: Colors.red, // : AppText(
// fontWeight: FontWeight.bold, // TranslationBase.of(context)
// ) // .hideOtherCriteria,
// : AppText( // color: Colors.red,
// TranslationBase.of(context) // fontWeight: FontWeight.bold),
// .hideOtherCriteria, // onTap: () {
// color: Colors.red, // setState(() {
// fontWeight: FontWeight.bold), // this.isView = !this.isView;
// onTap: () { // });
// setState(() { // },
// this.isView = !this.isView; // )
// }); // ],
// }, // ),
// ) isView == true
// ], ? Column(children: [
// ), SizedBox(
isView == true height: 10,
? Column(children: [
SizedBox(
height: 10,
),
Container(
height: 65.0,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1.0,
style: BorderStyle.solid,
color: HexColor("#CCCCCC")),
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
),
), ),
width: double.infinity, Container(
child: Padding( height: 65.0,
padding: EdgeInsets.only( decoration: ShapeDecoration(
top: SizeConfig.widthMultiplier * 0.9, shape: RoundedRectangleBorder(
bottom: side: BorderSide(
SizeConfig.widthMultiplier * 0.9, width: 1.0,
right: SizeConfig.widthMultiplier * 3, style: BorderStyle.solid,
left: SizeConfig.widthMultiplier * 3), color: HexColor("#CCCCCC")),
child: Row( borderRadius: BorderRadius.all(
mainAxisSize: MainAxisSize.max, Radius.circular(6.0)),
children: <Widget>[ ),
Expanded( ),
// add Expanded to have your dropdown button fill remaining space width: double.infinity,
child: DropdownButtonHideUnderline( child: Padding(
child: DropdownButton( padding: EdgeInsets.only(
isExpanded: true, top: SizeConfig.widthMultiplier *
value: _selectedType, 0.9,
iconSize: 25, bottom: SizeConfig.widthMultiplier *
elevation: 16, 0.9,
selectedItemBuilder: right:
(BuildContext context) { SizeConfig.widthMultiplier * 3,
return PATIENT_TYPE_Des.map( left:
SizeConfig.widthMultiplier * 3),
child: Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
// add Expanded to have your dropdown button fill remaining space
child:
DropdownButtonHideUnderline(
child: DropdownButton(
isExpanded: true,
value: _selectedType,
iconSize: 25,
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return PATIENT_TYPE_Des.map(
(item) {
return Row(
mainAxisSize:
MainAxisSize.max,
children: <Widget>[
!projectsProvider
.isArabic
? AppText(
item['text'],
fontSize: SizeConfig
.textMultiplier *
2.1,
)
: AppText(
item['text_ar'],
fontSize: SizeConfig
.textMultiplier *
2.1,
),
],
);
}).toList();
},
onChanged: (String newValue) =>
{
setState(() {
_selectedType = newValue;
selectedPatientType =
int.parse(
_selectedType);
})
},
items: PATIENT_TYPE_Des.map(
(item) { (item) {
return Row( !projectsProvider.isArabic
mainAxisSize: ? itemText = item['text']
MainAxisSize.max, : itemText =
children: <Widget>[ item['text_ar'];
!projectsProvider.isArabic return DropdownMenuItem(
? AppText( child: Text(
item['text'], itemText,
fontSize: SizeConfig textAlign: TextAlign.end,
.textMultiplier * ),
2.1, value: item['val'],
)
: AppText(
item['text_ar'],
fontSize: SizeConfig
.textMultiplier *
2.1,
),
],
); );
}).toList(); }).toList(),
}, )),
onChanged: (String newValue) => { ),
setState(() { ],
_selectedType = newValue; ),
selectedPatientType =
int.parse(_selectedType);
})
},
items:
PATIENT_TYPE_Des.map((item) {
!projectsProvider.isArabic
? itemText = item['text']
: itemText =
item['text_ar'];
return DropdownMenuItem(
child: Text(
itemText,
textAlign: TextAlign.end,
),
value: item['val'],
);
}).toList(),
)),
),
],
), ),
), ),
), SizedBox(
SizedBox( height: 10,
height: 10, ),
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(10),
child: AppTextFormField(
labelText: TranslationBase.of(context)
.firstName,
borderColor: Colors.white,
onSaved: (value) {
value == null || value == ''
? _patientSearchFormValues
.setFirstName = "0"
: _patientSearchFormValues
.setFirstName = value;
if (value != null &&
value.toString().trim().isEmpty) {
_patientSearchFormValues
.setFirstName = "0";
}
},
// validator: (value) {
// return TextValidator().validateName(value);
// },
inputFormatter: ONLY_LETTERS),
),
SizedBox(
height: 10,
),
if (_selectedType != '7')
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
@ -387,223 +367,274 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
color: HexColor("#CCCCCC"))), color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: AppTextFormField( child: AppTextFormField(
labelText: TranslationBase.of(context) labelText: TranslationBase.of(context)
.phoneNumber, .firstName,
borderColor: Colors.white, borderColor: Colors.white,
textInputType: TextInputType.number, onSaved: (value) {
textInputAction: TextInputAction.done, value == null || value == ''
inputFormatter: ONLY_NUMBERS, ? _patientSearchFormValues
focusNode: _nodeText1, .setFirstName = "0"
onSaved: (value) { : _patientSearchFormValues
value == null || value == '' .setFirstName = value;
? _patientSearchFormValues
.setPatientMobileNumber = "0" if (value != null &&
: _patientSearchFormValues value
.setPatientMobileNumber = .toString()
value; .trim()
.isEmpty) {
_patientSearchFormValues
.setFirstName = "0";
}
},
// validator: (value) {
// return TextValidator().validateName(value);
// },
inputFormatter: ONLY_LETTERS),
),
SizedBox(
height: 10,
),
if (_selectedType != '7')
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(10),
child: AppTextFormField(
labelText: TranslationBase.of(context)
.phoneNumber,
borderColor: Colors.white,
textInputType: TextInputType.number,
textInputAction: TextInputAction.done,
inputFormatter: ONLY_NUMBERS,
focusNode: _nodeText1,
onSaved: (value) {
value == null || value == ''
? _patientSearchFormValues
.setPatientMobileNumber =
"0"
: _patientSearchFormValues
.setPatientMobileNumber =
value;
if (value != null && if (value != null &&
value.toString().trim().isEmpty) { value
_patientSearchFormValues .toString()
.setPatientMobileNumber = "0"; .trim()
} .isEmpty) {
}, _patientSearchFormValues
.setPatientMobileNumber = "0";
}
},
),
), ),
SizedBox(
height: 10,
), ),
SizedBox( Container(
height: 10, decoration: BoxDecoration(
), borderRadius: BorderRadius.all(
Container( Radius.circular(6.0)),
decoration: BoxDecoration( border: Border.all(
borderRadius: BorderRadius.all( width: 1.0,
Radius.circular(6.0)), color: HexColor("#CCCCCC"))),
border: Border.all( padding: EdgeInsets.all(10),
width: 1.0, child: AppTextFormField(
color: HexColor("#CCCCCC"))), labelText: TranslationBase.of(context)
padding: EdgeInsets.all(10), .middleName,
child: AppTextFormField( borderColor: Colors.white,
labelText: TranslationBase.of(context) onSaved: (value) {
.middleName, value == null || value == ''
borderColor: Colors.white, ? _patientSearchFormValues
onSaved: (value) { .setMiddleName = "0"
value == null || value == '' : _patientSearchFormValues
? _patientSearchFormValues .setMiddleName = value;
.setMiddleName = "0" if (value != null &&
: _patientSearchFormValues value
.setMiddleName = value; .toString()
if (value != null && .trim()
value.toString().trim().isEmpty) { .isEmpty) {
_patientSearchFormValues _patientSearchFormValues
.setMiddleName = "0"; .setMiddleName = "0";
} }
}, },
// validator: (value) { // validator: (value) {
// return TextValidator().validateName(value); // return TextValidator().validateName(value);
// }, // },
inputFormatter: ONLY_LETTERS), inputFormatter: ONLY_LETTERS),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(6.0)), Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0,
color: HexColor("#CCCCCC"))), color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: AppTextFormField( child: AppTextFormField(
labelText: TranslationBase.of(context) labelText: TranslationBase.of(context)
.lastName, .lastName,
borderColor: Colors.white, borderColor: Colors.white,
onSaved: (value) { onSaved: (value) {
value == null || value == '' value == null || value == ''
? _patientSearchFormValues ? _patientSearchFormValues
.setLastName = "0" .setLastName = "0"
: _patientSearchFormValues : _patientSearchFormValues
.setLastName = value; .setLastName = value;
if (value != null && if (value != null &&
value.toString().trim().isEmpty) { value
_patientSearchFormValues .toString()
.setLastName = "0"; .trim()
} .isEmpty) {
}, _patientSearchFormValues
inputFormatter: ONLY_LETTERS), .setLastName = "0";
), }
SizedBox( },
height: 10, inputFormatter: ONLY_LETTERS),
), ),
Container( SizedBox(
decoration: BoxDecoration( height: 10,
borderRadius: BorderRadius.all( ),
Radius.circular(6.0)), Container(
border: Border.all( decoration: BoxDecoration(
width: 1.0, borderRadius: BorderRadius.all(
color: HexColor("#CCCCCC"))), Radius.circular(6.0)),
padding: EdgeInsets.all(10), border: Border.all(
child: AppTextFormField( width: 1.0,
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(10),
child: AppTextFormField(
labelText: TranslationBase.of(context)
.patientID,
borderColor: Colors.white,
textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS,
focusNode: _nodeText2,
onSaved: (value) {
value == null || value == ''
? _patientSearchFormValues
.setPatientID = 0
: _patientSearchFormValues
.setPatientID =
int.parse(value);
if (value != null &&
value
.trim()
.toString()
.isEmpty) {
_patientSearchFormValues
.setPatientID = 0;
}
}),
),
SizedBox(
height: 10,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(10),
child: AppTextFormField(
labelText: TranslationBase.of(context) labelText: TranslationBase.of(context)
.patientID, .patientFile,
borderColor: Colors.white, borderColor: Colors.white,
textInputType: TextInputType.number, textInputType: TextInputType.number,
focusNode: _nodeText3,
inputFormatter: ONLY_NUMBERS, inputFormatter: ONLY_NUMBERS,
focusNode: _nodeText2, onSaved: (value) {},
onSaved: (value) { ),
value == null || value == ''
? _patientSearchFormValues
.setPatientID = 0
: _patientSearchFormValues
.setPatientID =
int.parse(value);
if (value != null &&
value.trim().toString().isEmpty) {
_patientSearchFormValues
.setPatientID = 0;
}
}),
),
SizedBox(
height: 10,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(10),
child: AppTextFormField(
labelText: TranslationBase.of(context)
.patientFile,
borderColor: Colors.white,
textInputType: TextInputType.number,
focusNode: _nodeText3,
inputFormatter: ONLY_NUMBERS,
onSaved: (value) {},
), ),
(!(_selectedType == '2' ||
_selectedType == '4'))
? DynamicElements(
_patientSearchFormValues,
isFormSubmitted)
: SizedBox(
height: 0,
),
SizedBox(
height: 10,
),
Container(
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color:
HexColor("#CCCCCC"))),
height: 25,
width: 25,
child: Checkbox(
value: onlyArrived,
checkColor: HexColor("#2A930A"),
activeColor: Colors.white,
onChanged: (bool newValue) {
setState(() {
onlyArrived = newValue;
});
}),
),
SizedBox(
width: 12,
),
AppText(
TranslationBase.of(context)
.onlyArrivedPatient,
fontSize:
SizeConfig.textMultiplier *
2),
])),
SizedBox(
height: 10,
),
])
: SizedBox(
height: 0,
), ),
(!(_selectedType == '2' || ],
_selectedType == '4')) ),
? DynamicElements(
_patientSearchFormValues,
isFormSubmitted)
: SizedBox(
height: 0,
),
SizedBox(
height: 10,
),
Container(
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
height: 25,
width: 25,
child: Checkbox(
value: onlyArrived,
checkColor: HexColor("#2A930A"),
activeColor: Colors.white,
onChanged: (bool newValue) {
setState(() {
onlyArrived = newValue;
});
}),
),
SizedBox(
width: 12,
),
AppText(
TranslationBase.of(context)
.onlyArrivedPatient,
fontSize:
SizeConfig.textMultiplier * 2),
])),
SizedBox(
height: 10,
),
])
: SizedBox(
height: SizeConfig.screenHeight * .45,
),
],
), ),
), ),
],
),
),
Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context).search,
color: Colors.red[800],
onPressed: () {
_validateInputs();
},
),
],
),
), ),
], ],
), ),
), ]),
Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context).search,
color: Colors.red[800],
onPressed: () {
_validateInputs();
},
),
],
),
),
],
),
],
),
), ),
); );
} }

@ -386,7 +386,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
}); });
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
appBarTitle: patientTypeTitle, appBarTitle: isSearch? "Search Patient": patientTypeTitle,
isShowAppBar: widget.isAppbar, isShowAppBar: widget.isAppbar,
isLoading: _isLoading, isLoading: _isLoading,
body: _isLoading body: _isLoading

@ -0,0 +1,227 @@
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import '../../../routes.dart';
class InPatientProfileScreen extends StatefulWidget {
@override
_InPatientProfileScreenState createState() => _InPatientProfileScreenState();
}
class _InPatientProfileScreenState extends State<InPatientProfileScreen>with SingleTickerProviderStateMixin {
PatiantInformtion patient;
bool isFromSearch = false;
bool isInpatient = false;
bool isDischargedPatient = false;
String patientType;
String arrivalType;
String from;
String to;
@override
void didChangeDependencies() {
super.didChangeDependencies();
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient'];
patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType'];
from = routeArgs['from'];
to = routeArgs['to'];
if (routeArgs.containsKey("isSearch")) {
isFromSearch = routeArgs['isSearch'];
}
if (routeArgs.containsKey("isInpatient")) {
isInpatient = routeArgs['isInpatient'];
}
if (routeArgs.containsKey("isDischargedPatient")) {
isDischargedPatient = routeArgs['isDischargedPatient'];
}
}
@override
Widget build(BuildContext context) {
return BaseView<PatientViewModel>(
builder: (_, patientViewModel, w) => AppScaffold(
baseViewModel: patientViewModel,
appBarTitle: TranslationBase.of(context).patientProfile,
isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType),
body: SingleChildScrollView(
child: Container(
margin: EdgeInsets.only(top: 10),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15),
child: GridView.count(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
crossAxisSpacing: 10,
mainAxisSpacing: 10,
childAspectRatio: 1 / 1.0,
crossAxisCount: 3,
children: [
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
from: from,
to: to,
nameLine1: TranslationBase.of(context).vital,
nameLine2: TranslationBase.of(context).signs,
route: VITAL_SIGN_DETAILS,
isInPatient: true,
icon: 'patient/vital_signs.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: LAB_RESULT,
isInPatient: true,
nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).result,
icon: 'patient/lab_results.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isInPatient: isInpatient,
route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).result,
icon: 'patient/health_summary.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_PRESCRIPTION_NEW,
nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).prescription,
icon: 'patient/order_prescription.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PROGRESS_NOTE,
isDischargedPatient: isDischargedPatient,
nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note,
icon: 'patient/Progress_notes.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_NOTE,
isDischargedPatient: isDischargedPatient,
nameLine1: "Order", //"Text",
nameLine2:
"Sheet", //TranslationBase.of(context).orders,
icon: 'patient/Progress_notes.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_PROCEDURE,
nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).procedures,
icon: 'patient/Order_Procedures.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: MEDICAL_FILE,
nameLine1: "Health",
//TranslationBase.of(context).medicalReport,
nameLine2: "Summary",
//TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isDisable: true,
route: MEDICAL_FILE,
nameLine1: "Medical", //Health
//TranslationBase.of(context).medicalReport,
nameLine2: "Report", //Report
//TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: REFER_IN_PATIENT_TO_DOCTOR,
isInPatient: true,
nameLine1: TranslationBase.of(context).referral,
nameLine2: TranslationBase.of(context).patient,
icon: 'patient/refer_patient.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).approvals,
icon: 'patient/vital_signs.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isDisable: true,
route: null,
nameLine1: "Discharge",
nameLine2: "Summery",
icon: 'patient/patient_sick_leave.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ADD_SICKLEAVE,
nameLine1: TranslationBase.of(context).patientSick,
nameLine2: TranslationBase.of(context).leave,
icon: 'patient/patient_sick_leave.png'),
],
),
),
),
),
));
}
}
class AvatarWidget extends StatelessWidget {
final Widget avatarIcon;
AvatarWidget(this.avatarIcon);
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Color.fromRGBO(0, 0, 0, 0.08),
offset: Offset(0.0, 5.0),
blurRadius: 16.0)
],
borderRadius: BorderRadius.all(Radius.circular(35.0)),
color: Color(0xffCCCCCC),
),
child: avatarIcon,
);
}
}

@ -16,8 +16,9 @@ class FlowChartPage extends StatelessWidget {
final PatientLabOrders patientLabOrder; final PatientLabOrders patientLabOrder;
final String filterName; final String filterName;
final PatiantInformtion patient; final PatiantInformtion patient;
final bool isInpatient;
FlowChartPage({this.patientLabOrder, this.filterName, this.patient}); FlowChartPage({this.patientLabOrder, this.filterName, this.patient, this.isInpatient});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -36,7 +36,7 @@ class LabResultWidget extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
if (!isInpatient) // if (!isInpatient)
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -50,6 +50,7 @@ class LabResultWidget extends StatelessWidget {
filterName: filterName, filterName: filterName,
patientLabOrder: patientLabOrder, patientLabOrder: patientLabOrder,
patient: patient, patient: patient,
isInpatient: isInpatient,
), ),
), ),
); );

@ -160,7 +160,7 @@ class LineChartCurvedState extends State<LineChartCurved> {
), ),
minX: 0, minX: 0,
maxX: (widget.labResult.length - 1).toDouble(), maxX: (widget.labResult.length - 1).toDouble(),
maxY: getMaxY(), maxY: getMaxY()+2,
minY: getMinY(), minY: getMinY(),
lineBarsData: getData(), lineBarsData: getData(),
); );

@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result_page.dart';
import 'package:doctor_app_flutter/screens/procedures/add_lab_orders.dart'; import 'package:doctor_app_flutter/screens/procedures/add_lab_orders.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -12,26 +13,38 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class LabsHomePage extends StatelessWidget { class LabsHomePage extends StatefulWidget {
@override
_LabsHomePageState createState() => _LabsHomePageState();
}
class _LabsHomePageState extends State<LabsHomePage> {
String patientType; String patientType;
String arrivalType; String arrivalType;
PatiantInformtion patient;
bool isInpatient;
@override @override
Widget build(BuildContext context) { void didChangeDependencies() {
super.didChangeDependencies();
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient'];
PatiantInformtion patient = routeArgs['patient'];
patientType = routeArgs['patientType']; patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType']; arrivalType = routeArgs['arrivalType'];
bool isInpatient = routeArgs['isInpatient']; isInpatient = routeArgs['isInpatient'];
print(arrivalType); print(arrivalType);
}
@override
Widget build(BuildContext context) {
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getLabs(patient, isInpatient: isInpatient), onModelReady: (model) => model.getLabs(patient, isInpatient: false),
builder: (context, ProcedureViewModel model, widget) => AppScaffold( builder: (context, ProcedureViewModel model, widget) => AppScaffold(
baseViewModel: model, baseViewModel: model,
backgroundColor: Colors.grey[100], backgroundColor: Colors.grey[100],
isShowAppBar: true, isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar( appBar: PatientProfileHeaderNewDesignAppBar(
patient, patient.patientType.toString() ?? '0', patientType), patient, patient.patientType.toString() ?? '0', patientType,isInpatient: isInpatient,),
body: SingleChildScrollView( body: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: FractionallySizedBox( child: FractionallySizedBox(
@ -42,27 +55,29 @@ class LabsHomePage extends StatelessWidget {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
if(model.patientLabOrdersList.isNotEmpty && patient.patientStatusType != 43) if (model.patientLabOrdersList.isNotEmpty &&
Padding( patient.patientStatusType != 43)
padding: const EdgeInsets.all(8.0), Padding(
child: Column( padding: const EdgeInsets.all(8.0),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
AppText( children: [
'Lab', AppText(
style: "caption2", 'Lab',
color: Colors.black, style: "caption2",
fontSize: 13, color: Colors.black,
), fontSize: 13,
AppText( ),
'Result', AppText(
bold: true, 'Result',
fontSize: 22, bold: true,
), fontSize: 22,
], ),
],
),
), ),
), if (patient.patientStatusType != null &&
if ( patient.patientStatusType!=null && patient.patientStatusType == 43) patient.patientStatusType == 43)
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
@ -82,60 +97,112 @@ class LabsHomePage extends StatelessWidget {
], ],
), ),
), ),
if ( patient.patientStatusType!=null && patient.patientStatusType == 43) if (patient.patientStatusType != null &&
AddNewOrder( onTap: () { patient.patientStatusType == 43)
Navigator.push( AddNewOrder(
context, onTap: () {
MaterialPageRoute( Navigator.push(
builder: (context) => AddSelectedLabOrder( context,
patient: patient, MaterialPageRoute(
model: model, builder: (context) => AddSelectedLabOrder(
)), patient: patient,
); model: model,
},label: 'Apply for New Lab Order',), )),
);
},
label: 'Apply for New Lab Order',
),
...List.generate( ...List.generate(
model.patientLabOrdersList.length, model.patientLabOrdersList.length,
(index) => Column( (index) => Container(
crossAxisAlignment: CrossAxisAlignment.start, margin: EdgeInsets.all(10),
mainAxisAlignment: MainAxisAlignment.spaceBetween, decoration: BoxDecoration(
children: model border: Border.all(
.patientLabOrdersList[index].patientLabOrdersList width: 0.5,
.map((labOrder) { color: Colors.white,
return DoctorCard( ),
onTap: () => Navigator.push( borderRadius: BorderRadius.all(
context, Radius.circular(8.0),
FadePage( ),
page: LaboratoryResultPage( color: Colors.white),
patientLabOrders: labOrder, child: Row(
patient: patient, children: [
arrivalType: arrivalType, Container(
patientType: patientType, width: 20,
height: 160,
decoration: BoxDecoration(
//Colors.red[900] Color(0xff404545)
color: model.patientLabOrdersList[index].isLiveCareAppointment
? Colors.red[900]
: !model.patientLabOrdersList[index].isInOutPatient
? Colors.black
: Color(0xffa9a089),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
bottomLeft: Radius.circular(8),
), ),
), ),
child: RotatedBox(
quarterTurns: 3,
child: Center(
child: Text(
model.patientLabOrdersList[index].isLiveCareAppointment
? TranslationBase.of(context)
.liveCare
.toUpperCase()
: !model.patientLabOrdersList[index].isInOutPatient
? TranslationBase.of(context)
.inPatientLabel
.toUpperCase()
: TranslationBase.of(context)
.outpatient
.toUpperCase(),
style: TextStyle(color: Colors.white),
),
)),
), ),
doctorName: labOrder.doctorName, Expanded(
invoiceNO: ' ${labOrder.invoiceNo}', child: DoctorCard(
profileUrl: labOrder.doctorImageURL, isNoMargin: true,
branch: labOrder.projectName, onTap: () => Navigator.push(
clinic: labOrder.clinicDescription, context,
appointmentDate: labOrder.orderDate, FadePage(
orderNo: labOrder.orderNo, page: LaboratoryResultPage(
); patientLabOrders: model.patientLabOrdersList[index],
}).toList(), patient: patient,
arrivalType: arrivalType,
patientType: patientType,
),
),
),
doctorName: model.patientLabOrdersList[index].doctorName,
invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}',
profileUrl: model.patientLabOrdersList[index].doctorImageURL,
branch: model.patientLabOrdersList[index].projectName,
clinic: model.patientLabOrdersList[index].clinicDescription,
appointmentDate: model.patientLabOrdersList[index].orderDate,
orderNo: model.patientLabOrdersList[index].orderNo,
isShowTime: false,
),
),
],
),
), ),
), ),
if(model.patientLabOrdersList.isEmpty && patient.patientStatusType != 43) if (model.patientLabOrdersList.isEmpty &&
patient.patientStatusType != 43)
Center( Center(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
SizedBox(height: 100,), SizedBox(
height: 100,
),
Image.asset('assets/images/no-data.png'), Image.asset('assets/images/no-data.png'),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: AppText('No Lab Result Found'), child: AppText('No Lab Result Found'),
) )
], ],
), ),
) )

@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/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/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.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';
@ -78,7 +79,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
// appBarTitle: TranslationBase.of(context).progressNote, // appBarTitle: TranslationBase.of(context).progressNote,
appBar: PatientProfileHeaderNewDesignAppBar( appBar: PatientProfileHeaderNewDesignAppBar(
patient, patient.patientType.toString() ?? '0', arrivalType), patient, patient.patientType.toString() ?? '0', arrivalType,isInpatient: true,),
body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0 body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0
? DrAppEmbeddedError( ? DrAppEmbeddedError(
error: TranslationBase.of(context).errorNoProgressNote) error: TranslationBase.of(context).errorNoProgressNote)
@ -105,318 +106,416 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
child: ListView.builder( child: ListView.builder(
itemCount: model.patientProgressNoteList.length, itemCount: model.patientProgressNoteList.length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return Column( return FractionallySizedBox(
children: [ widthFactor: 0.95,
Container( child: CardWithBgWidget(
margin: EdgeInsets.only( hasBorder: false,
left: 10, bgColor: model.patientProgressNoteList[index]
right: 10, .status ==
), 1 &&
decoration: BoxDecoration( authProvider.doctorProfile.doctorID !=
color: Colors.white, model
borderRadius: BorderRadius.circular(10), .patientProgressNoteList[
), index]
padding: EdgeInsets.all(15), .createdBy
child: Column( ? Color(0xFFCC9B14):model
crossAxisAlignment: .patientProgressNoteList[
CrossAxisAlignment.start, index]
children: [ .status ==
4?Colors.red.shade700
: model
.patientProgressNoteList[
index]
.status ==
2?Colors.green[600]:Color(0xFFCC9B14),
widget: Column(
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
if (model
.patientProgressNoteList[
index]
.status ==
1 &&
authProvider
.doctorProfile.doctorID !=
model
.patientProgressNoteList[
index]
.createdBy)
AppText(
'Pending',
fontWeight: FontWeight.bold,
color: Color(0xFFCC9B14),
fontSize: 12,
),
if (model
.patientProgressNoteList[
index]
.status ==
4)
AppText(
'Canceled',
fontWeight: FontWeight.bold,
color: Colors.red.shade700,
fontSize: 12,
),
if (model
.patientProgressNoteList[
index]
.status ==
2)
AppText(
'Verified',
fontWeight: FontWeight.bold,
color: Colors.green[600],
fontSize: 12,
),
if (model.patientProgressNoteList[index].status != 2 &&
model
.patientProgressNoteList[
index]
.status !=
4 &&
authProvider
.doctorProfile.doctorID ==
model
.patientProgressNoteList[
index]
.createdBy)
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
UpdateNoteOrder(
note: model
.patientProgressNoteList[
index],
patientModel:
model,
patient:
patient,
visitType: widget
.visitType,
isUpdate: true,
)),
);
},
child: Container(
decoration: BoxDecoration(
color: Colors.grey[600],
borderRadius:
BorderRadius.circular(
10),
),
// color:Colors.red[600],
if(model.patientProgressNoteList[index].status == 1 && authProvider.doctorProfile.doctorID != model.patientProgressNoteList[index].createdBy) child: Row(
AppText( children: [
'In Progress',fontWeight: FontWeight.bold, color: Color(0xFFCC9B14),fontSize: 16,), Icon(
if(model.patientProgressNoteList[index].status == 4) DoctorApp.edit_1,
AppText( size: 12,
'Canceled',fontWeight: FontWeight.bold, color: Colors.red.shade700,fontSize: 16,), color: Colors.white,
if(model.patientProgressNoteList[index].status == 2) ),
AppText( SizedBox(
'Verified',fontWeight: FontWeight.bold, color: Colors.grey.shade700,fontSize: 16,), width: 2,
if (model.patientProgressNoteList[index].status != 2 && ),
model.patientProgressNoteList[index].status != 4 && authProvider.doctorProfile.doctorID == model.patientProgressNoteList[index].createdBy) AppText(
Row( 'Update',
crossAxisAlignment: fontSize: 10,
CrossAxisAlignment.start, color: Colors.white,
children: [ ),
InkWell( ],
onTap: () { ),
Navigator.push( padding: EdgeInsets.all(6),
context,
MaterialPageRoute(
builder: (context) =>
UpdateNoteOrder(
note: model.patientProgressNoteList[
index],
patientModel:
model,
patient: patient,
visitType: widget
.visitType,
isUpdate: true,
)),
);
},
child: Container(
decoration: BoxDecoration(
color: Colors.green[600],
borderRadius:
BorderRadius.circular(
10),
), ),
// color:Colors.red[600], ),
SizedBox(
width: 10,
),
InkWell(
onTap: () async {
showMyDialog(
context: context,
actionName: "verify",
confirmFun: () async {
GifLoaderDialogUtils
.showMyDialog(
context);
UpdateNoteReqModel
reqModel =
UpdateNoteReqModel(
admissionNo: int
.parse(patient
.admissionNo),
cancelledNote:
false,
lineItemNo: model
.patientProgressNoteList[
index]
.lineItemNo,
createdBy: model
.patientProgressNoteList[
index]
.createdBy,
notes: model
.patientProgressNoteList[
index]
.notes,
verifiedNote: true,
patientTypeID:
patient
.patientType,
patientOutSA: false,
);
await model
.updatePatientProgressNote(
reqModel);
await getProgressNoteList(
context, model,
isLocalBusy:
true);
GifLoaderDialogUtils
.hideDialog(
context);
});
},
child: Container(
decoration: BoxDecoration(
color: Colors.green[600],
borderRadius:
BorderRadius.circular(
10),
),
// color:Colors.red[600],
child: Row( child: Row(
children: [ children: [
Icon( Icon(
DoctorApp.edit_1, FontAwesomeIcons
size: 12, .check,
color: Colors.white, size: 12,
), color: Colors.white,
SizedBox( ),
width: 2, SizedBox(
), width: 2,
AppText( ),
'Update', AppText(
fontSize: 10, 'Verify',
color: Colors.white, fontSize: 10,
), color: Colors.white,
], ),
],
),
padding: EdgeInsets.all(6),
), ),
padding: EdgeInsets.all(6),
), ),
), SizedBox(
SizedBox( width: 10,
width: 10, ),
), InkWell(
InkWell( onTap: () async {
onTap: () async { showMyDialog(
showMyDialog( context: context,
context: context, actionName: "cancel",
actionName: "cancel", confirmFun: () async {
confirmFun: () async { GifLoaderDialogUtils
GifLoaderDialogUtils .showMyDialog(
.showMyDialog( context,
context, );
); UpdateNoteReqModel
UpdateNoteReqModel reqModel =
reqModel = UpdateNoteReqModel(
UpdateNoteReqModel( admissionNo: int
admissionNo: .parse(patient
int.parse(patient .admissionNo),
.admissionNo), cancelledNote: true,
cancelledNote: true, lineItemNo: model
lineItemNo: .patientProgressNoteList[
model.patientProgressNoteList[index] index]
.lineItemNo, .lineItemNo,
createdBy: createdBy: model
model.patientProgressNoteList[index] .patientProgressNoteList[
.createdBy, index]
notes: .createdBy,
model.patientProgressNoteList[index] notes: model
.notes, .patientProgressNoteList[
verifiedNote: false, index]
patientTypeID: patient .notes,
.patientType, verifiedNote: false,
patientOutSA: false, patientTypeID:
); patient
await model .patientType,
.updatePatientProgressNote( patientOutSA: false,
reqModel); );
await getProgressNoteList( await model
context, model, isLocalBusy: true); .updatePatientProgressNote(
GifLoaderDialogUtils reqModel);
.hideDialog( await getProgressNoteList(
context); context, model,
}); isLocalBusy:
}, true);
child: Container( GifLoaderDialogUtils
decoration: BoxDecoration( .hideDialog(
color: Colors.red[600], context);
borderRadius: });
BorderRadius.circular( },
10), child: Container(
), decoration: BoxDecoration(
// color:Colors.red[600], color: Colors.red[600],
borderRadius:
BorderRadius.circular(
10),
),
// color:Colors.red[600],
child: Row( child: Row(
children: [ children: [
Icon( Icon(
FontAwesomeIcons.trash, FontAwesomeIcons
size: 12, .trash,
color: Colors.white, size: 12,
), color: Colors.white,
SizedBox( ),
width: 2, SizedBox(
), width: 2,
AppText( ),
'Cancel', AppText(
fontSize: 10, 'Cancel',
color: Colors.white, fontSize: 10,
), color: Colors.white,
], ),
],
),
padding: EdgeInsets.all(6),
), ),
padding: EdgeInsets.all(6),
), ),
),
SizedBox(
width: 10,
),
InkWell(
onTap: () async {
showMyDialog(context: context, actionName: "verify",confirmFun: () async{
GifLoaderDialogUtils
.showMyDialog(context);
UpdateNoteReqModel reqModel =
UpdateNoteReqModel(
admissionNo: int.parse(
patient.admissionNo),
cancelledNote: false,
lineItemNo: model.patientProgressNoteList[index]
.lineItemNo,
createdBy: model.patientProgressNoteList[index]
.createdBy,
notes:
model.patientProgressNoteList[index].notes,
verifiedNote: true,
patientTypeID:
patient.patientType,
patientOutSA: false,
);
await model
.updatePatientProgressNote(
reqModel);
await getProgressNoteList(
context, model, isLocalBusy: true);
GifLoaderDialogUtils
.hideDialog(context);
});
},
child: Container(
decoration: BoxDecoration(
color: Colors.grey[600],
borderRadius:
BorderRadius.circular(
10),
),
// color:Colors.red[600],
child: Row( SizedBox(
children: [ width: 10,
Icon( )
FontAwesomeIcons.check, ],
size: 12, ),
color: Colors.white, SizedBox(
), height: 10,
SizedBox( ),
width: 2, Row(
), mainAxisAlignment:
AppText( MainAxisAlignment.spaceBetween,
'Verify', crossAxisAlignment:
fontSize: 10, CrossAxisAlignment.start,
color: Colors.white, children: [
), Container(
], width: MediaQuery.of(context)
), .size
padding: EdgeInsets.all(6), .width *
0.60,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
AppText(
'Created By: ',
fontSize: 10,
),
Expanded(
child: AppText(
model
.patientProgressNoteList[
index]
.doctorName ??
'',
fontWeight:
FontWeight.w600,
fontSize: 12,
),
),
],
),
],
), ),
), ),
SizedBox( Column(
width: 10,
)
],
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Container(
width: MediaQuery.of(context)
.size
.width *
0.65,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Row( AppText(
crossAxisAlignment: model
CrossAxisAlignment .patientProgressNoteList[
.start, index]
children: [ .createdOn !=
AppText( null
'Created By: ', ? DateUtils.getDayMonthYearDateFormatted(
fontSize: 10, DateUtils.getDateTimeFromServerFormat(
), model
Expanded( .patientProgressNoteList[
child: AppText( index]
model.patientProgressNoteList[index].doctorName??'',fontWeight: FontWeight.w600,fontSize: 12,), .createdOn))
), : DateUtils
], .getDayMonthYearDateFormatted(
DateTime.now()),
fontWeight: FontWeight.w600,
fontSize: 14,
),
AppText(
model
.patientProgressNoteList[
index]
.createdOn !=
null
? DateUtils.getHour(DateUtils
.getDateTimeFromServerFormat(
model
.patientProgressNoteList[
index]
.createdOn))
: DateUtils.getHour(
DateTime.now()),
fontWeight: FontWeight.w600,
fontSize: 14,
), ),
], ],
), crossAxisAlignment:
), CrossAxisAlignment.end,
Column( )
],
),
SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
AppText( Expanded(
model.patientProgressNoteList[index] child: AppText(
.createdOn != model
null .patientProgressNoteList[
? DateUtils index]
.getDayMonthYearDateFormatted( .notes,
DateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn)) fontSize: 10,
: DateUtils ),
.getDayMonthYearDateFormatted(
DateTime.now()),
fontWeight: FontWeight.w600,
fontSize: 14,
),
AppText(
model.patientProgressNoteList[index]
.createdOn !=
null
? DateUtils
.getHour(
DateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn ))
: DateUtils
.getHour(
DateTime.now()),
fontWeight: FontWeight.w600,
fontSize: 14,
),
],
crossAxisAlignment:
CrossAxisAlignment.end,
)
],
),
SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Expanded(
child: AppText(
model.patientProgressNoteList[index].notes,
fontSize: 10,
), ),
), ])
]) ],
], ),
), SizedBox(
), height: 20,
SizedBox( ),
height: 20, ],
), ),
], ),
); );
}), }),
), ),

@ -65,7 +65,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
event.controller.stream.listen((p) { event.controller.stream.listen((p) {
if (p['startPopUp'] == 'true') { if (p['startPopUp'] == 'true') {
if (this.mounted) { if (this.mounted) {
onVoiceText(); initSpeechState().then((value) => {onVoiceText()});
} }
} }
}); });
@ -118,13 +118,13 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: validationError:
progressNoteController.text.isEmpty && isSubmitted progressNoteController.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage ? TranslationBase.of(context).emptyMessage
: null, : null,
), ),
Positioned( Positioned(
top: 0,//MediaQuery.of(context).size.height * 0, top: 0, //MediaQuery.of(context).size.height * 0,
right: 15, right: 15,
child: IconButton( child: IconButton(
icon: Icon( icon: Icon(
@ -132,7 +132,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
color: Colors.black, color: Colors.black,
), ),
onPressed: () { onPressed: () {
onVoiceText(); initSpeechState()
.then((value) => {onVoiceText()});
}, },
), ),
) )
@ -235,7 +236,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
if (available) { if (available) {
speech.listen( speech.listen(
onResult: resultListener, onResult: resultListener,
// listenMode: ListenMode.confirmation, listenMode: stt.ListenMode.confirmation,
localeId: lang == 'en' ? 'en-US' : 'ar-SA', localeId: lang == 'en' ? 'en-US' : 'ar-SA',
); );
} else { } else {
@ -266,10 +267,18 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
if (result.finalResult == true) { if (result.finalResult == true) {
setState(() { setState(() {
SpeechToText.closeAlertDialog(context); SpeechToText.closeAlertDialog(context);
speech.stop();
progressNoteController.text = reconizedWord; progressNoteController.text = reconizedWord;
}); });
} else { } else {
print(result.finalResult); print(result.finalResult);
} }
} }
Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(
onError: errorListener, onStatus: statusListener);
print(hasSpeech);
if (!mounted) return;
}
} }

File diff suppressed because it is too large Load Diff

@ -64,17 +64,18 @@ class RadiologyDetailsPage extends StatelessWidget {
SizedBox( SizedBox(
height: 5, height: 5,
), ),
AppText(TranslationBase.of(context).generalResult), Padding(
SizedBox( padding: const EdgeInsets.all(8.0),
height: 5, child: AppText(TranslationBase.of(context).generalResult,color: Color(0xff2E303A),),
), ),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: AppText( child: AppText(
'${finalRadiology.reportData.trim()}', '${finalRadiology.reportData.trim()}',
textAlign: TextAlign.start, textAlign: TextAlign.start,
fontSize: 17, fontSize: 17,
color: Colors.grey, color: Color(0xff575757),
), ),
), ),
SizedBox( SizedBox(
@ -94,8 +95,9 @@ class RadiologyDetailsPage extends StatelessWidget {
margin: margin:
EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12), EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12),
child: SecondaryButton( child: SecondaryButton(
color: Colors.red[600], color: Color(0xffD02127),
disabled: finalRadiology.dIAPACSURL == "", disabled: finalRadiology.dIAPACSURL == "",
textColor: Color(0xffFFFFFF),
onTap: () { onTap: () {
launch(model.radImageURL); launch(model.radImageURL);
}, },

@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.dart';
import 'package:doctor_app_flutter/screens/procedures/add_radiology_order.dart'; import 'package:doctor_app_flutter/screens/procedures/add_radiology_order.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -14,25 +15,39 @@ 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';
class RadiologyHomePage extends StatelessWidget { class RadiologyHomePage extends StatefulWidget {
@override @override
Widget build(BuildContext context) { _RadiologyHomePageState createState() => _RadiologyHomePageState();
ProjectViewModel projectViewModel = Provider.of(context); }
class _RadiologyHomePageState extends State<RadiologyHomePage> {
String patientType;
PatiantInformtion patient;
String arrivalType;
bool isInpatient;
@override
void didChangeDependencies() {
super.didChangeDependencies();
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; patient = routeArgs['patient'];
String patientType = routeArgs['patientType']; patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType']; arrivalType = routeArgs['arrivalType'];
bool isInpatient = routeArgs['isInpatient']; isInpatient = routeArgs['isInpatient'];
print(arrivalType);
}
@override
Widget build(BuildContext context) {
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => onModelReady: (model) => model.getPatientRadOrders(patient,
model.getPatientRadOrders(patient, patientType: patientType, isInPatient: isInpatient), patientType: patientType, isInPatient: false),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.grey[100], backgroundColor: Colors.grey[100],
// appBarTitle: TranslationBase.of(context).radiology, // appBarTitle: TranslationBase.of(context).radiology,
appBar: PatientProfileHeaderNewDesignAppBar( appBar: PatientProfileHeaderNewDesignAppBar(
patient, patient.patientType.toString() ?? '0', arrivalType), patient, patient.patientType.toString() ?? '0', arrivalType,isInpatient: isInpatient,),
baseViewModel: model, baseViewModel: model,
body: FractionallySizedBox( body: FractionallySizedBox(
widthFactor: 1.0, widthFactor: 1.0,
@ -101,25 +116,78 @@ class RadiologyHomePage extends StatelessWidget {
), ),
...List.generate( ...List.generate(
model.radiologyList.length, model.radiologyList.length,
(index) => InkWell( (index) => Container(
onTap: () => Navigator.push( margin: EdgeInsets.all(10),
context, decoration: BoxDecoration(
FadePage( border: Border.all(
page: RadiologyDetailsPage( width: 0.5,
finalRadiology: model.radiologyList[index], color: Colors.white,
patient: patient,
), ),
), borderRadius: BorderRadius.all(
), Radius.circular(8.0),
child: DoctorCard( ),
doctorName: model.radiologyList[index].doctorName, color: Colors.white),
profileUrl: model.radiologyList[index].doctorImageURL, child: Row(
invoiceNO: '${model.radiologyList[index].invoiceNo}', children: [
branch: '${model.radiologyList[index].projectName}', Container(
clinic: model.radiologyList[index].clinicDescription, width: 20,
appointmentDate: height: 160,
!isInpatient?model.radiologyList[index].orderDate : decoration: BoxDecoration(
model.radiologyList[index].reportDate, //Colors.red[900] Color(0xff404545)
color: model.radiologyList[index].isLiveCareAppodynamicment
? Colors.red[900]
: !model.radiologyList[index].isInOutPatient
? Colors.black
: Color(0xffa9a089),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
bottomLeft: Radius.circular(8),
),
),
child: RotatedBox(
quarterTurns: 3,
child: Center(
child: Text(
model.radiologyList[index].isLiveCareAppodynamicment
? TranslationBase.of(context)
.liveCare
.toUpperCase()
: !model.radiologyList[index].isInOutPatient
? TranslationBase.of(context)
.inPatientLabel
.toUpperCase()
: TranslationBase.of(context)
.outpatient
.toUpperCase(),
style: TextStyle(color: Colors.white),
),
)),
),
Expanded(
child: DoctorCard(
isNoMargin: true,
doctorName: model.radiologyList[index].doctorName,
profileUrl: model.radiologyList[index].doctorImageURL,
invoiceNO: '${model.radiologyList[index].invoiceNo}',
branch: '${model.radiologyList[index].projectName}',
clinic: model.radiologyList[index].clinicDescription,
appointmentDate: model.radiologyList[index].orderDate??
model.radiologyList[index].reportDate,
onTap: () {
Navigator.push(
context,
FadePage(
page: RadiologyDetailsPage(
finalRadiology: model.radiologyList[index],
patient: patient,
),
),
);
},
),
),
],
), ),
)), )),
if (model.radiologyList.isEmpty && if (model.radiologyList.isEmpty &&

@ -1,6 +1,9 @@
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/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
@ -11,11 +14,14 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.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/speech-text-popup.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt;
class PatientMakeInPatientReferralScreen extends StatefulWidget { class PatientMakeInPatientReferralScreen extends StatefulWidget {
@override @override
_PatientMakeInPatientReferralScreenState createState() => _PatientMakeInPatientReferralScreenState createState() =>
@ -41,6 +47,76 @@ class _PatientMakeInPatientReferralScreenState
String clinicError; String clinicError;
String doctorError; String doctorError;
String frequencyError; String frequencyError;
stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord;
var event = RobotProvider();
@override
void initState() {
requestPermissions();
event.controller.stream.listen((p) {
if (p['startPopUp'] == 'true') {
if (this.mounted) {
initSpeechState().then((value) => {onVoiceText()});
}
}
});
super.initState();
}
onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
bool available = await speech.initialize(
onStatus: statusListener, onError: errorListener);
if (available) {
speech.listen(
onResult: resultListener,
listenMode: stt.ListenMode.confirmation,
localeId: lang == 'en' ? 'en-US' : 'ar-SA',
);
} else {
print("The user has denied the use of speech recognition.");
}
}
void errorListener(SpeechRecognitionError error) {
event.setValue({"searchText": 'null'});
//SpeechToText.closeAlertDialog(context);
print(error);
}
void statusListener(String status) {
reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....';
}
void requestPermissions() async {
Map<Permission, PermissionStatus> statuses = await [
Permission.microphone,
].request();
}
void resultListener(result) {
reconizedWord = result.recognizedWords;
event.setValue({"searchText": reconizedWord});
if (result.finalResult == true) {
setState(() {
SpeechToText.closeAlertDialog(context);
speech.stop();
_remarksController.text = reconizedWord;
});
} else {
print(result.finalResult);
}
}
Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(
onError: errorListener, onStatus: statusListener);
print(hasSpeech);
if (!mounted) return;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -48,7 +124,7 @@ class _PatientMakeInPatientReferralScreenState
patient = routeArgs['patient']; patient = routeArgs['patient'];
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
bool isInpatient = routeArgs['isInpatient'];
referToList = List(); referToList = List();
dynamic sameBranch = { dynamic sameBranch = {
"id": 1, "id": 1,
@ -70,7 +146,7 @@ class _PatientMakeInPatientReferralScreenState
appBarTitle: TranslationBase.of(context).referPatient, appBarTitle: TranslationBase.of(context).referPatient,
isShowAppBar: true, isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar( appBar: PatientProfileHeaderNewDesignAppBar(
patient, patientType, arrivalType), patient, patientType, arrivalType,isInpatient: isInpatient,),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
child: Column( child: Column(
@ -387,13 +463,30 @@ class _PatientMakeInPatientReferralScreenState
SizedBox( SizedBox(
height: 10, height: 10,
), ),
AppTextFieldCustom( Stack(
hintText: children: [
TranslationBase.of(context).dietTypeRemarks, AppTextFieldCustom(
controller: _remarksController, hintText:"Remarks",
inputType: TextInputType.multiline, controller: _remarksController,
minLines: 4, inputType: TextInputType.multiline,
maxLines: 6, minLines: 4,
maxLines: 6,
),
Positioned(
top: 0, //MediaQuery.of(context).size.height * 0,
right: 15,
child: IconButton(
icon: Icon(
DoctorApp.speechtotext,
color: Colors.black,
),
onPressed: () {
initSpeechState()
.then((value) => {onVoiceText()});
},
),
),
],
), ),
], ],
), ),

@ -90,15 +90,46 @@ class ReferralPatientDetailScreen extends StatelessWidget {
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Column(
padding: EdgeInsets.only(left: 12.0), children: [
child: Container( InkWell(
width: 60, onTap: () {
height: 60, PatiantInformtion patient =
child: Image.network( model.getPatientFromReferralO(referredPatient);
referredPatient.doctorImageURL Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patient,
"patientType": "1",
"isInpatient": true,
"arrivalType": "1",
"from": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
"to": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
});
},
child: Padding(
padding: EdgeInsets.only(left: 12.0),
child: Container(
width: 60,
height: 60,
child: Image.asset(
referredPatient.gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
),
), ),
), SizedBox(
height: 20,
),
AppText(
TranslationBase.of(context).viewProfile,
fontWeight: FontWeight.w700,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Colors.red[700],
)
],
), ),
SizedBox( SizedBox(
width: 10, width: 10,
@ -321,7 +352,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
margin: margin:
EdgeInsets.only(left: 10, right: 0), EdgeInsets.only(left: 10, right: 0),
child: Image.asset( child: Image.asset(
'assets/images/patient/ic_ref_arrow_left.png', 'assets/images/patient/ic_ref_arrow_up.png',
height: 50, height: 50,
width: 30, width: 30,
), ),

@ -66,8 +66,7 @@ class ReferredPatientScreen extends StatelessWidget {
); );
}, },
child: PatientReferralItemWidget( child: PatientReferralItemWidget(
referralStatus: referralStatus:model.getReferredPatientItem(index).referralStatusDesc,
"${model.getReferralStatusNameByCode(model.getReferredPatientItem(index).referralStatus, context)}",
referralStatusCode: model referralStatusCode: model
.getReferredPatientItem(index) .getReferredPatientItem(index)
.referralStatus, .referralStatus,

@ -127,10 +127,10 @@ class ReferredPatientDetailScreen extends StatelessWidget {
height: 20, height: 20,
), ),
AppText( AppText(
TranslationBase.of(context).showDetail, TranslationBase.of(context).viewProfile,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier,
color: Colors.blue, color: Colors.red[700],
) )
], ],
), ),
@ -146,7 +146,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
children: [ children: [
AppText( AppText(
"${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}", referredPatient.referralStatusDesc,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 1.9 * SizeConfig.textMultiplier, fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,

@ -453,7 +453,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
), ),
), ),
), ),
bottomSheet: Container( bottomSheet:Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
@ -462,55 +462,67 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
border: Border.all( border: Border.all(
color: HexColor('#707070'), color: HexColor('#707070'),
width: 0), width: 0),
), child: Padding( ),
padding: const EdgeInsets.all(12.0), height: 80,
child: Row( width: double.infinity,
mainAxisAlignment: MainAxisAlignment.center, child: Column(
children: [ children: [
Container( SizedBox(
width: MediaQuery.of(context).size.width * 0.4, height: 10,
child: AppButton( ),
title: TranslationBase Container(child:
.of(context) FractionallySizedBox(
.previous, widthFactor: .80,
color: Colors.grey[300], child: Center(
fontColor: Colors.black, child: Row(
fontWeight: FontWeight.w600, children: [
loading: model.state == ViewState.BusyLocal, Expanded(
onPressed: () async { child: AppButton(
widget.changePageViewIndex(1); title: TranslationBase
}, .of(context)
), .previous,
), color: Colors.grey[300],
SizedBox( fontColor: Colors.black,
width: MediaQuery.of(context).size.width * 0.05, fontWeight: FontWeight.w600,
), disabled: model.state == ViewState.BusyLocal,
Container( onPressed: () async {
width: MediaQuery.of(context).size.width * 0.4, widget.changePageViewIndex(1);
child: AppButton( },
title: TranslationBase )
.of(context) ,
.next, ),
fontWeight: FontWeight.w600, SizedBox(width: 5,),
color: Colors.red[700], Expanded(
loading: model.state == ViewState.BusyLocal, child: AppButton(
onPressed: () async { title: TranslationBase
if (widget.mySelectedAssessmentList.isEmpty) { .of(context)
Helpers.showErrorToast( .next,
TranslationBase fontWeight: FontWeight.w600,
.of(context) color: Colors.red[700],
.assessmentErrorMsg); disabled: model.state == ViewState.BusyLocal,
} else { onPressed: () async {
widget.changePageViewIndex(3); if (widget.mySelectedAssessmentList.isEmpty) {
widget.changeLoadingState(true); Helpers.showErrorToast(
} TranslationBase
}, .of(context)
.assessmentErrorMsg);
} else {
widget.changePageViewIndex(3);
widget.changeLoadingState(true);
}
},
),
),
],
), ),
), ),
], ),),
), SizedBox(
), height: 5,
), ),
],
),)
), ),
); );
} }

@ -143,7 +143,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
), ),
), ),
), ),
bottomSheet: Container( bottomSheet:
Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
@ -153,55 +154,56 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
color: HexColor('#707070'), color: HexColor('#707070'),
width: 0), width: 0),
), ),
height: MediaQuery height: 80,
.of(context)
.size
.height * 0.1,
width: double.infinity, width: double.infinity,
child: FractionallySizedBox( child: Column(
widthFactor: 0.9, children: [
child: Row( SizedBox(
children: [ height: 10,
Container( ),
width: MediaQuery.of(context).size.width *0.4, Container(child:
child: AppButton( FractionallySizedBox(
title: TranslationBase.of(context).previous, widthFactor: .80,
color: Colors.grey[300], child: Center(
fontColor: Colors.black, child: Row(
fontWeight: FontWeight.w600, children: [
onPressed: () { Expanded(
widget.changePageViewIndex(0); child: AppButton(
}, title: TranslationBase.of(context).previous,
), color: Colors.grey[300],
), fontColor: Colors.black,
SizedBox( fontWeight: FontWeight.w600,
width: MediaQuery.of(context).size.width *0.1, onPressed: () {
), widget.changePageViewIndex(0);
Container( },
width: MediaQuery.of(context).size.width *0.4, )
child: AppButton( ,
title: TranslationBase.of(context).next, ),
fontWeight: FontWeight.w600, SizedBox(width: 5,),
loading: model.state == ViewState.BusyLocal, Expanded(
color: widget.mySelectedExamination != null && child: AppButton(
widget.mySelectedExamination.length > 0 title: TranslationBase
? Colors.red[700] .of(context)
: HexColor("#A5A5A5"), .next,
fontColor: widget.mySelectedExamination != null && fontWeight: FontWeight.w600,
widget.mySelectedExamination.length > 0 ? Colors.white : HexColor("#5A5A5A"), color: Colors.red[700],
disabled: widget.mySelectedExamination != null && disabled: model.state == ViewState.BusyLocal,
widget.mySelectedExamination.length > 0 onPressed: () async {
? false await submitUpdateObjectivePage(model);
: true, },
onPressed: () async { ),
await submitUpdateObjectivePage(model); ),
}, ],
), ),
), ),
], ),),
), SizedBox(
), height: 5,
), ),
],
),)
), ),
); );
} }

@ -236,7 +236,8 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
), ),
), ),
), ),
bottomSheet: Container( bottomSheet:
Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
@ -246,76 +247,85 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
color: HexColor('#707070'), color: HexColor('#707070'),
width: 0), width: 0),
), ),
width: double.maxFinite, height: 80,
height: 90, width: double.infinity,
child: Padding( child: Column(
padding: const EdgeInsets.all(8.0), children: [
child: Container( SizedBox(
margin: EdgeInsets.all(6), height: 10,
child: Column( ),
children: [ Container(child:
Row( FractionallySizedBox(
widthFactor: .80,
child: Center(
child: Row(
children: [ children: [
Expanded( Expanded(
child: AppButton( child: AppButton(
title: TranslationBase.of(context).previous, title: TranslationBase
.of(context)
.previous,
color: Colors.grey[300], color: Colors.grey[300],
fontColor: Colors.black, fontColor: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
disabled: model.state == ViewState.BusyLocal,
onPressed: () async { onPressed: () async {
setState(() { widget.changePageViewIndex(2);
widget.changePageViewIndex(2);
});
}, },
), )
,
), ),
SizedBox(width: 5,), SizedBox(width: 5,),
Expanded( Expanded(
child: AppButton( child: AppButton(
title: isAddProgress? TranslationBase.of(context).next: "Finish", title: TranslationBase
.of(context)
.next,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.red[700], color: Colors.red[700],
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
disabled: progressNoteController.text.isEmpty, disabled: progressNoteController.text.isEmpty,
onPressed: () async { onPressed: () async {
if (progressNoteController.text.isNotEmpty) { if (progressNoteController.text.isNotEmpty) {
if (isAddProgress) { if (isAddProgress) {
Map profile = Map profile =
await sharedPref.getObj(DOCTOR_PROFILE); await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel doctorProfile =
DoctorProfileModel.fromJson(profile); DoctorProfileModel.fromJson(profile);
setState(() { setState(() {
widget.patientProgressNote.createdByName = widget.patientProgressNote.createdByName =
widget.patientProgressNote widget.patientProgressNote
.createdByName ?? .createdByName ??
doctorProfile.doctorName; doctorProfile.doctorName;
widget.patientProgressNote.editedByName = widget.patientProgressNote.editedByName =
doctorProfile.doctorName; doctorProfile.doctorName;
widget.patientProgressNote.createdOn = widget.patientProgressNote.createdOn =
DateTime.now().toString(); DateTime.now().toString();
widget.patientProgressNote.planNote = widget.patientProgressNote.planNote =
progressNoteController.text; progressNoteController.text;
isAddProgress = !isAddProgress; isAddProgress = !isAddProgress;
}); });
submitPlan(model); submitPlan(model);
} else { } else {
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
} else { } else {
Helpers.showErrorToast(TranslationBase.of(context) Helpers.showErrorToast(TranslationBase.of(context)
.progressNoteErrorMsg); .progressNoteErrorMsg);
} }
}, },
), ),
), ),
], ],
), ),
),
], ),),
SizedBox(
height: 5,
), ),
), ],
), ),)
),
), ),
); );
} }

@ -323,18 +323,15 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
color: HexColor('#707070'), color: HexColor('#707070'),
width: 0), width: 0),
), ),
height: MediaQuery height: 80,
.of(context)
.size
.height * 0.1,
width: double.infinity, width: double.infinity,
child: Column( child: Column(
children: [ children: [
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container(child: FractionallySizedBox( Container(child:
FractionallySizedBox(
widthFactor: .80, widthFactor: .80,
child: Center( child: Center(
child: AppButton( child: AppButton(

@ -10,9 +10,10 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
final List<TimeSeriesSales2> timeSeries1; final List<TimeSeriesSales2> timeSeries1;
final List<TimeSeriesSales2> timeSeries2; final List<TimeSeriesSales2> timeSeries2;
final int indexes; final int indexes;
final bool isOX;
LineChartCurvedBloodPressure( LineChartCurvedBloodPressure(
{this.title, this.timeSeries1, this.indexes, this.timeSeries2}); {this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.isOX= false});
List<int> xAxixs = List(); List<int> xAxixs = List();
List<double> yAxixs = List(); List<double> yAxixs = List();
@ -79,7 +80,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
color: Theme.of(context).primaryColor), color: Theme.of(context).primaryColor),
), ),
SizedBox(width: 5,), SizedBox(width: 5,),
AppText(TranslationBase.of(context).systolicLng) AppText(isOX? "SAO2":TranslationBase.of(context).systolicLng)
], ],
), ),
SizedBox(width: 15,), SizedBox(width: 15,),
@ -93,7 +94,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
color: Colors.red), color: Colors.red),
), ),
SizedBox(width: 5,), SizedBox(width: 5,),
AppText(TranslationBase.of(context).diastolicLng,) AppText(isOX? "FIO2":TranslationBase.of(context).diastolicLng,)
], ],
), ),
], ],

@ -316,8 +316,8 @@ class VitalSignDetailsScreen extends StatelessWidget {
GridView.count( GridView.count(
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
crossAxisSpacing: 6, crossAxisSpacing: 8,
mainAxisSpacing: 6, mainAxisSpacing: 12,
crossAxisCount: 3, crossAxisCount: 3,
children: [ children: [
InkWell( InkWell(

@ -47,6 +47,7 @@ class VitalSingChartBloodPressure extends StatelessWidget {
borderRadius: BorderRadius.circular(12)), borderRadius: BorderRadius.circular(12)),
child: LineChartCurvedBloodPressure( child: LineChartCurvedBloodPressure(
title: name, title: name,
isOX: title2=="SAO2",
timeSeries1: timeSeriesData1, timeSeries1: timeSeriesData1,
timeSeries2: timeSeriesData2, timeSeries2: timeSeriesData2,
indexes: timeSeriesData1.length ~/ 5.5, indexes: timeSeriesData1.length ~/ 5.5,

@ -284,118 +284,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Column( child: Column(
//mainAxisAlignment: MainAxisAlignment.end, //mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
// Container(
// height: MediaQuery.of(context).size.height *
// 0.070,
// color: Colors.white,
// child: InkWell(
// onTap: model.allMedicationList != null
// ? () {
// Helpers.hideKeyboard(context);
// setState(() {
// _selectedMedication = null;
// model.getItem(
// itemID: _selectedMedication
// .itemId);
// });
// }
// : null,
// child: _selectedMedication == null
// ? AutoCompleteTextField<
// GetMedicationResponseModel>(
// onFocusChanged: (__) {
// if (_selectedMedication !=
// null) {
// model.getItem(
// itemID:
// _selectedMedication
// .itemId);
// uom = _selectedMedication.uom;
// } else {
// null;
// }
// if (_selectedMedication !=
// null &&
// duration != null &&
// frequency != null &&
// strengthController.text !=
// null) {
// model.getBoxQuantity(
// freq: frequency[
// 'parameterCode'],
// duration: duration['id'],
// itemCode:
// _selectedMedication
// .itemId,
// strength: double.parse(
// strengthController
// .text));
// box = model.boxQuintity;
//
// return;
// }
// },
// decoration:
// textFieldSelectorDecoration(
// TranslationBase.of(context)
// .searchMedicineNameHere,
// _selectedMedication != null
// ? _selectedMedication
// .genericName
// : null,
// true,
// ),
// itemSubmitted: (item) => setState(
// () => _selectedMedication =
// item),
// key: key,
// suggestions:
// model.allMedicationList,
// itemBuilder: (context,
// suggestion) =>
// new Padding(
// child: AppText(suggestion
// .description +
// '/' +
// suggestion
// .genericName),
// padding:
// EdgeInsets.all(15.0)),
// itemSorter: (a, b) => 1,
// suggestionsAmount: 7,
// itemFilter: (suggestion, input) =>
// suggestion.genericName.toLowerCase().startsWith(
// input.toLowerCase()) ||
// suggestion.description
// .toLowerCase()
// .startsWith(input
// .toLowerCase()) ||
// suggestion.keywords
// .toLowerCase()
// .startsWith(
// input.toLowerCase()),
// )
// : TextField(
// onEditingComplete: () {
// model.getItem(
// itemID: _selectedMedication
// .itemId);
// },
// decoration: textFieldSelectorDecoration(
// TranslationBase.of(context)
// .searchMedicineNameHere,
// _selectedMedication != null
// ? _selectedMedication
// .description +
// ('${_selectedMedication.genericName}')
// : null,
// false,
// suffixIcon:
// Icon(Icons.search)),
// enabled: false,
// ),
// ),
// ),
FractionallySizedBox( FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: Container( child: Container(

@ -24,10 +24,12 @@ class PrescriptionsPage extends StatelessWidget {
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
bool isInpatient = routeArgs['isInpatient'];
bool isSelectInpatient = routeArgs['isSelectInpatient'];
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PrescriptionViewModel>( return BaseView<PrescriptionViewModel>(
onModelReady: (model) => onModelReady: (model) =>
patient.admissionNo != null && patient.admissionNo != "0" isSelectInpatient
? model.getPrescriptionsInPatient(patient) ? model.getPrescriptionsInPatient(patient)
: model.getPrescriptions(patient, patientType: patientType), : model.getPrescriptions(patient, patientType: patientType),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -35,7 +37,7 @@ class PrescriptionsPage extends StatelessWidget {
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.grey[100], backgroundColor: Colors.grey[100],
appBar: PatientProfileHeaderNewDesignAppBar( appBar: PatientProfileHeaderNewDesignAppBar(
patient, patientType ?? '0', arrivalType), patient, patientType ?? '0', arrivalType,isInpatient: isInpatient,),
body: patient.admissionNo == null body: patient.admissionNo == null
? FractionallySizedBox( ? FractionallySizedBox(
widthFactor: 1.0, widthFactor: 1.0,

@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.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:flutter/material.dart'; import 'package:flutter/material.dart';
import 'entity_list_checkbox_search_widget.dart'; import 'entity_list_checkbox_search_widget.dart';
@ -126,6 +127,7 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
TextEditingController remarksController = TextEditingController(); TextEditingController remarksController = TextEditingController();
List<EntityList> entityList = List(); List<EntityList> entityList = List();
List<EntityList> entityListProcedure = List(); List<EntityList> entityListProcedure = List();
TextEditingController procedureName = TextEditingController();
dynamic selectedCategory; dynamic selectedCategory;
@ -139,7 +141,7 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getCategory(), //onModelReady: (model) => model.getCategory(),
builder: (BuildContext context, ProcedureViewModel model, Widget child) => builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold( AppScaffold(
isShowAppBar: false, isShowAppBar: false,
@ -159,136 +161,197 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
'Please Enter Procedure',
fontWeight: FontWeight.w700,
fontSize: 20,
),
InkWell(
child: Icon(
Icons.close,
size: 24.0,
),
onTap: () {
Navigator.pop(context);
},
)
]),
SizedBox(
height: MediaQuery.of(context).size.height * 0.04,
),
Row( Row(
children: [ children: [
AppText( Container(
'Please Select Category', width: MediaQuery.of(context).size.width * 0.85,
fontWeight: FontWeight.w700, child: AppTextFieldCustom(
fontSize: 20, hintText: 'Search Procedure here...',
isTextFieldHasSuffix: false,
maxLines: 1,
minLines: 1,
hasBorder: true,
controller: procedureName,
// onSubmitted: (_) {
// model.getProcedureCategory(
// categoryName: procedureName.text);
// },
onClick: () {
if(procedureName.text.isNotEmpty && procedureName.text.length>=3)
model.getProcedureCategory(
categoryName: procedureName.text);
else
DrAppToastMsg.showErrorToast('At least three Characters');
},
),
), ),
SizedBox( SizedBox(
width: MediaQuery.of(context).size.width * 0.29, width: MediaQuery.of(context).size.width * 0.02,
), ),
InkWell( InkWell(
child: Icon(
Icons.close,
size: 24.0,
),
onTap: () { onTap: () {
Navigator.pop(context); if(procedureName.text.isNotEmpty && procedureName.text.length>=3)
model.getProcedureCategory(
categoryName: procedureName.text);
else
DrAppToastMsg.showErrorToast('At least three Characters');
}, },
child: Icon(
Icons.search,
size: 25.0,
),
), ),
], ],
), ),
SizedBox( // SizedBox(
height: 10.0, // width: MediaQuery.of(context).size.width * 0.29,
), // ),
Container( // InkWell(
height: screenSize.height * 0.070, // child: Icon(
child: InkWell( // Icons.close,
onTap: model.categoryList != null && // size: 24.0,
model.categoryList.length > 0 // ),
? () { // onTap: () {
ListSelectDialog dialog = // Navigator.pop(context);
ListSelectDialog( // },
list: model.categoryList, // ),
attributeName: 'categoryName', // ],
attributeValueId: 'categoryId', // ),
okText: TranslationBase.of(context).ok, // SizedBox(
okFunction: (selectedValue) { // height: 10.0,
setState(() { // ),
selectedCategory = selectedValue; // Container(
model.getProcedureCategory( // height: screenSize.height * 0.070,
categoryName: selectedCategory[ // child: InkWell(
'categoryName'], // onTap: model.categoryList != null &&
categoryID: selectedCategory[ // model.categoryList.length > 0
'categoryId'] <= // ? () {
9 // ListSelectDialog dialog =
? "0" + // ListSelectDialog(
selectedCategory[ // list: model.categoryList,
'categoryId'] // attributeName: 'categoryName',
.toString() // attributeValueId: 'categoryId',
: selectedCategory[ // okText: TranslationBase.of(context).ok,
'categoryId'] // okFunction: (selectedValue) {
.toString()); // setState(() {
}); // selectedCategory = selectedValue;
}, // model.getProcedureCategory(
); // categoryName: selectedCategory[
showDialog( // 'categoryName'],
barrierDismissible: false, // categoryID: selectedCategory[
context: context, // 'categoryId'] <=
builder: (BuildContext context) { // 9
return dialog; // ? "0" +
}, // selectedCategory[
); // 'categoryId']
//model.getProcedureCategory(); // .toString()
} // : selectedCategory[
: null, // 'categoryId']
child: TextField( // .toString());
decoration: textFieldSelectorDecoration( // });
TranslationBase.of(context) // },
.procedureCategorise, // );
selectedCategory != null // showDialog(
? selectedCategory['categoryName'] // barrierDismissible: false,
: null, // context: context,
true, // builder: (BuildContext context) {
suffixIcon: Icon( // return dialog;
Icons.search, // },
color: Colors.black, // );
)), // //model.getProcedureCategory();
enabled: false, // }
), // : null,
), // child: TextField(
), // decoration: textFieldSelectorDecoration(
if (widget.model.categoriesList.length != 0) // TranslationBase.of(context)
// .procedureCategorise,
// selectedCategory != null
// ? selectedCategory['categoryName']
// : null,
// true,
// suffixIcon: Icon(
// Icons.search,
// color: Colors.black,
// )),
// enabled: false,
// ),
// ),
// ),
if (procedureName.text.isNotEmpty &&
model.procedureList.length != 0)
NetworkBaseView( NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: selectedCategory != null child:
? selectedCategory['categoryId'] == 02 || // selectedCategory != null
selectedCategory['categoryId'] == 03 // ? selectedCategory['categoryId'] == 02 ||
? EntityListCheckboxSearchWidget( // selectedCategory['categoryId'] == 03
model: widget.model, // ?
masterList: widget.model EntityListCheckboxSearchWidget(
.categoriesList[0].entityList, model: widget.model,
removeHistory: (item) { masterList:
setState(() { widget.model.categoriesList[0].entityList,
entityList.remove(item); removeHistory: (item) {
}); setState(() {
}, entityList.remove(item);
addHistory: (history) { });
setState(() { },
entityList.add(history); addHistory: (history) {
}); setState(() {
}, entityList.add(history);
addSelectedHistories: () { });
//TODO build your fun herr },
// widget.addSelectedHistories(); addSelectedHistories: () {
}, //TODO build your fun herr
isEntityListSelected: (master) => // widget.addSelectedHistories();
isEntityListSelected(master), },
) isEntityListSelected: (master) =>
: ProcedureListWidget( isEntityListSelected(master),
model: widget.model, )
masterList: widget.model // : ProcedureListWidget(
.categoriesList[0].entityList, // model: widget.model,
removeHistory: (item) { // masterList: widget.model
setState(() { // .categoriesList[0].entityList,
entityList.remove(item); // removeHistory: (item) {
}); // setState(() {
}, // entityList.remove(item);
addHistory: (history) { // });
setState(() { // },
entityList.add(history); // addHistory: (history) {
}); // setState(() {
}, // entityList.add(history);
addSelectedHistories: () { // });
//TODO build your fun herr // },
// widget.addSelectedHistories(); // addSelectedHistories: () {
}, // //TODO build your fun herr
isEntityListSelected: (master) => // // widget.addSelectedHistories();
isEntityListSelected(master), // },
) // isEntityListSelected: (master) =>
: null), // isEntityListSelected(master),
// )
// : null,
),
SizedBox( SizedBox(
height: 15.0, height: 15.0,
), ),

@ -1,4 +1,3 @@
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/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -227,8 +226,7 @@ class _EntityListCheckboxSearchWidgetState
) )
: Center( : Center(
child: Container( child: Container(
child: AppText( child: AppText("Sorry , No Match",
"There's no procedures for this category",
color: Color(0xFFB9382C)), color: Color(0xFFB9382C)),
), ),
) )

@ -30,17 +30,17 @@ class ProcedureScreen extends StatelessWidget {
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
bool isInpatient = routeArgs['isInpatient'];
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => onModelReady: (model) =>
model.getProcedure(mrn: patient.patientId, patientType: patientType), model.getProcedure(mrn: patient.patientId, patientType: patientType,),
builder: (BuildContext context, ProcedureViewModel model, Widget child) => builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold( AppScaffold(
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.grey[100], backgroundColor: Colors.grey[100],
baseViewModel: model, baseViewModel: model,
appBar: PatientProfileHeaderNewDesignAppBar( appBar: PatientProfileHeaderNewDesignAppBar(
patient, arrivalType ?? '0', patientType), patient, arrivalType ?? '0', patientType,isInpatient: isInpatient,),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
child: Column( child: Column(
@ -183,23 +183,8 @@ class ProcedureScreen extends StatelessWidget {
doctorName: doctorNameP, doctorName: doctorNameP,
), ),
), ),
if (model.procedureList.isEmpty) if (model.state == ViewState.ErrorLocal || (model.procedureList.isNotEmpty && model.procedureList[0].entityList.isEmpty))
Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText('No Procedure Found 0000'),
)
],
),
),
if (model.state == ViewState.ErrorLocal)
Center( Center(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -210,7 +195,7 @@ class ProcedureScreen extends StatelessWidget {
Image.asset('assets/images/no-data.png'), Image.asset('assets/images/no-data.png'),
Padding( Padding(
padding: const EdgeInsets.all(22.0), padding: const EdgeInsets.all(22.0),
child: AppText(model.error), child: AppText(model.procedureList.isEmpty ? model.error: 'No Procedure Found '),
) )
], ],
), ),

@ -1,4 +1,5 @@
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/sick_leave_patient_model.dart';
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
@ -20,8 +21,10 @@ class AddSickLeavScreen extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
bool isInpatient = routeArgs['isInpatient'];
return BaseView<SickLeaveViewModel>( return BaseView<SickLeaveViewModel>(
onModelReady: (model) => model.getSickLeave(patient.patientMRN??patient.patientId), onModelReady: (model) =>
model.getSickLeavePatient(patient.patientMRN ?? patient.patientId),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
@ -30,6 +33,7 @@ class AddSickLeavScreen extends StatelessWidget {
patient, patient,
routeArgs['patientType'] ?? "0", routeArgs['patientType'] ?? "0",
routeArgs['arrivalType'] ?? "0", routeArgs['arrivalType'] ?? "0",
isInpatient: isInpatient,
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column(children: [ child: Column(children: [
@ -101,25 +105,26 @@ class AddSickLeavScreen extends StatelessWidget {
], ],
) )
: SizedBox(), : SizedBox(),
model.getAllSIckLeave.length > 0 model.getAllSIckLeavePatient.length > 0
? Column( ? Column(
children: model.getAllSIckLeave children: model.getAllSIckLeavePatient
.map<Widget>((GetAllSickLeaveResponse item) { .map<Widget>((SickLeavePatientModel item) {
return RoundedContainer( return RoundedContainer(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
child: Column( child: Column(
children: [ children: [
Container( Container(
decoration: BoxDecoration( // decoration: BoxDecoration(
border: Border( // border: Border(
left: BorderSide( // left: BorderSide(
color: item.status == 1 // // color: item.status == 1
? Colors.yellow[800] // // ? Colors.yellow[800]
: item.status == 2 // // : item.status == 2
? Colors.green // // ? Colors.green
: Colors.black, // // : Colors.black,
width: 5.0, // color: Colors.red,
))), // width: 5.0,
// ))),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
@ -138,35 +143,37 @@ class AddSickLeavScreen extends StatelessWidget {
Container( Container(
padding: EdgeInsets.all(3), padding: EdgeInsets.all(3),
child: AppText( child: AppText(
item.status == 1 item.doctorName,
? TranslationBase.of( // item.status == 1
context) // ? TranslationBase.of(
.hold // context)
: item.status == 2 // .hold
? TranslationBase // : item.status == 2
.of( // ? TranslationBase
context) // .of(
.active // context)
: TranslationBase // .active
.of(context) // : TranslationBase
.all, // .of(context)
// .all,
fontWeight: fontWeight:
FontWeight.bold, FontWeight.bold,
color: item.status == 1 // color: item.status == 1
? Colors.yellow[800] // ? Colors.yellow[800]
: item.status == 2 // : item.status == 2
? Colors.green // ? Colors.green
: Colors.black, // : Colors.black,
color: Colors.red,
), ),
), ),
Row( Row(
children: [ children: [
AppText(TranslationBase
.of(context)
.daysSickleave +
": "),
AppText( AppText(
TranslationBase.of( item.sickLeaveDays
context)
.daysSickleave),
AppText(
item.noOfDays
.toString(), .toString(),
fontWeight: fontWeight:
FontWeight.bold, FontWeight.bold,
@ -182,52 +189,54 @@ class AddSickLeavScreen extends StatelessWidget {
' ', ' ',
), ),
Flexible( Flexible(
child: AppText( child: AppText(
DateUtils DateUtils.getDayMonthYearDateFormatted(DateUtils
.convertStringToDateFormat( .convertStringToDate(
item.startDate, item.startDate)),
'dd-MMM-yyyy'), fontWeight:
fontWeight: FontWeight.bold,
FontWeight.bold, ),
)) )
], ],
), ),
Row( Row(
mainAxisAlignment: children: [
MainAxisAlignment AppText(
.spaceBetween, TranslationBase.of(
children: [ context)
AppText( .endDate +
item.remarks ?? "", ' ',
),
Flexible(
child: AppText(
DateUtils.getDayMonthYearDateFormatted(DateUtils
.convertStringToDate(
item.endDate,
)),
fontWeight:
FontWeight.bold,
), ),
// (item.status == 1 || )
// item.status == 2) ],
// ? IconButton( ),
// icon: Image.asset( Row(children: [
// 'assets/images/edit.png'), AppText(TranslationBase.of(
// context)
// // color: Colors.green, //Colors.black, .branch +
// onPressed: () => { ": "),
// if (item.status == AppText(
// 1) item.projectName ?? "",
// { ),
// DrAppToastMsg.showErrorToast( ]),
// TranslationBase.of( Row(children: [
// context) AppText(TranslationBase.of(
// .sickleaveonhold) context)
// } .clinic +
// else ": "),
// { AppText(
// openSickLeave( item.clinicName ?? "",
// context, ),
// true, ]),
// extendedData:
// item)
// }
// },
// )
// : SizedBox()
]),
], ],
), ),
SizedBox( SizedBox(

@ -239,16 +239,15 @@ class DateUtils {
static DateTime convertStringToDate(String date) { static DateTime convertStringToDate(String date) {
// /Date(1585774800000+0300)/ // /Date(1585774800000+0300)/
if (date != null) { if (date != null) {
const start = "/Date("; const start = "/Date(";
const end = "+0300)"; const end = "+0300)";
final startIndex = date.indexOf(start); final startIndex = date.indexOf(start);
final endIndex = date.indexOf(end, startIndex + start.length); final endIndex = date.indexOf(end, startIndex + start.length);
return DateTime.fromMillisecondsSinceEpoch( DateTime newDate = DateTime.fromMillisecondsSinceEpoch(
int.parse( int.parse(date.substring(startIndex + start.length, endIndex),),);
date.substring(startIndex + start.length, endIndex), return newDate;
),
);
} else } else
return DateTime.now(); return DateTime.now();
} }
@ -291,6 +290,15 @@ class DateUtils {
return ""; return "";
} }
/// get data formatted like 26/4/2020
/// [dateTime] convert DateTime to data formatted
static String getDayMonthYearDate(DateTime dateTime,{bool isArabic = false}) {
if (dateTime != null)
return dateTime.day.toString()+"/"+ "${dateTime.month}"+ "/" + dateTime.year.toString();
else
return "";
}
/// get data formatted like 10:45 PM /// get data formatted like 10:45 PM
/// [dateTime] convert DateTime to data formatted /// [dateTime] convert DateTime to data formatted
static String getHour(DateTime dateTime) { static String getHour(DateTime dateTime) {
@ -353,6 +361,18 @@ class DateUtils {
return DateFormat('hh:mm a').format(dateTime); return DateFormat('hh:mm a').format(dateTime);
} }
static String getTimeHHMMA2 (DateTime dateTime){
return DateFormat('hh:mm').format(dateTime);
}
static String getStartTime(String dateTime){
String time=dateTime;
if(dateTime.length>7)
time = dateTime.substring(0,5);
return time;
}
static String getTimeFormated(DateTime dateTime) { static String getTimeFormated(DateTime dateTime) {
print(dateTime); print(dateTime);
if (dateTime != null) if (dateTime != null)

@ -92,7 +92,8 @@ class DrAppSharedPreferances {
clear() async { clear() async {
final SharedPreferences prefs = await _prefs; final SharedPreferences prefs = await _prefs;
prefs.clear(); var vvas= await prefs.clear();
var asd;
} }
remove(String key) async { remove(String key) async {

@ -100,6 +100,9 @@ class TranslationBase {
String get referral => localizedValues['referral'][locale.languageCode]; String get referral => localizedValues['referral'][locale.languageCode];
String get inPatient => localizedValues['inPatient'][locale.languageCode]; String get inPatient => localizedValues['inPatient'][locale.languageCode];
String get inPatientLabel => localizedValues['inPatientLabel'][locale.languageCode];
String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode];
String get operations => localizedValues['operations'][locale.languageCode]; String get operations => localizedValues['operations'][locale.languageCode];
@ -568,7 +571,8 @@ class TranslationBase {
String get referTo => localizedValues['referTo'][locale.languageCode]; String get referTo => localizedValues['referTo'][locale.languageCode];
String get referredFrom => localizedValues['referredFrom'][locale.languageCode]; String get referredFrom =>
localizedValues['referredFrom'][locale.languageCode];
String get refClinic => localizedValues['refClinic'][locale.languageCode]; String get refClinic => localizedValues['refClinic'][locale.languageCode];
String get branch => localizedValues['branch'][locale.languageCode]; String get branch => localizedValues['branch'][locale.languageCode];
@ -1174,6 +1178,7 @@ class TranslationBase {
localizedValues['noDataAvailable'][locale.languageCode]; localizedValues['noDataAvailable'][locale.languageCode];
String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode]; String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode];
String get showDetail => localizedValues['showDetail'][locale.languageCode]; String get showDetail => localizedValues['showDetail'][locale.languageCode];
String get viewProfile => localizedValues['viewProfile'][locale.languageCode];
String get fileNumber => localizedValues['fileNumber'][locale.languageCode]; String get fileNumber => localizedValues['fileNumber'][locale.languageCode];
String get reschedule => localizedValues['reschedule'][locale.languageCode]; String get reschedule => localizedValues['reschedule'][locale.languageCode];
@ -1239,7 +1244,9 @@ class TranslationBase {
String get replayBefore => String get replayBefore =>
localizedValues['replayBefore'][locale.languageCode]; localizedValues['replayBefore'][locale.languageCode];
String get trySaying => localizedValues["try-saying"][locale.languageCode]; String get trySaying => localizedValues["try-saying"][locale.languageCode];
String get acknowledged => localizedValues['acknowledged'][locale.languageCode]; String get acknowledged =>
localizedValues['acknowledged'][locale.languageCode];
String get didntCatch => localizedValues["didntCatch"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -2,6 +2,8 @@ import 'dart:convert';
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../shared/app_texts_widget.dart'; import '../shared/app_texts_widget.dart';
@ -62,7 +64,8 @@ class _MedicineItemWidgetState extends State<MedicineItemWidget> {
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Align( child: Align(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: AppText(widget.label)))) child: AppText(widget.label)))),
Icon(EvaIcons.eye)
], ],
), ),
), ),

@ -55,6 +55,7 @@ class SMSOTP {
displayDialog(BuildContext context) async { displayDialog(BuildContext context) async {
return showDialog( return showDialog(
context: context, context: context,
barrierColor: Colors.black.withOpacity(0.7),
builder: (context) { builder: (context) {
projectProvider = Provider.of(context); projectProvider = Provider.of(context);
return AlertDialog( return AlertDialog(
@ -84,14 +85,14 @@ class SMSOTP {
? Padding( ? Padding(
child: Icon( child: Icon(
DoctorApp.verify_sms_1, DoctorApp.verify_sms_1,
size: 40, size: 50,
), ),
padding: EdgeInsets.only(bottom: 20), padding: EdgeInsets.only(bottom: 20),
) )
: Padding( : Padding(
child: Icon( child: Icon(
DoctorApp.verify_whtsapp, DoctorApp.verify_whtsapp,
size: 40, size: 50,
), ),
padding: EdgeInsets.only(bottom: 20), padding: EdgeInsets.only(bottom: 20),
), ),
@ -114,7 +115,7 @@ class SMSOTP {
) )
])), ])),
Padding( Padding(
padding: EdgeInsets.only(top: 5), padding: EdgeInsets.only(top: 5, right: 5),
child: AppText( child: AppText(
TranslationBase.of(context).verificationMessage + TranslationBase.of(context).verificationMessage +
' XXXXXX' + ' XXXXXX' +
@ -122,7 +123,9 @@ class SMSOTP {
.toString() .toString()
.substring(mobileNo.toString().length - 3), .substring(mobileNo.toString().length - 3),
textAlign: TextAlign.start, textAlign: TextAlign.start,
fontWeight: FontWeight.w600, fontWeight: FontWeight.bold,
fontSize: 14,
maxLines: 2,
)), )),
Form( Form(
key: verifyAccountForm, key: verifyAccountForm,
@ -131,10 +134,11 @@ class SMSOTP {
child: Directionality( child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
width: SizeConfig.realScreenWidth * 0.15, width: SizeConfig.realScreenWidth * 0.16,
margin: EdgeInsets.all(5),
child: TextFormField( child: TextFormField(
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
style: buildTextStyle(), style: buildTextStyle(),
@ -162,7 +166,8 @@ class SMSOTP {
), ),
), ),
Container( Container(
width: SizeConfig.realScreenWidth * 0.15, width: SizeConfig.realScreenWidth * 0.16,
margin: EdgeInsets.all(5),
child: TextFormField( child: TextFormField(
focusNode: focusD2, focusNode: focusD2,
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
@ -189,7 +194,8 @@ class SMSOTP {
validator: validateCodeDigit), validator: validateCodeDigit),
), ),
Container( Container(
width: SizeConfig.realScreenWidth * 0.15, margin: EdgeInsets.all(5),
width: SizeConfig.realScreenWidth * 0.16,
child: TextFormField( child: TextFormField(
focusNode: focusD3, focusNode: focusD3,
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
@ -216,7 +222,8 @@ class SMSOTP {
}, },
validator: validateCodeDigit)), validator: validateCodeDigit)),
Container( Container(
width: SizeConfig.realScreenWidth * 0.15, margin: EdgeInsets.all(5),
width: SizeConfig.realScreenWidth * 0.16,
child: TextFormField( child: TextFormField(
focusNode: focusD4, focusNode: focusD4,
maxLength: 1, maxLength: 1,
@ -280,15 +287,15 @@ class SMSOTP {
// contentPadding: EdgeInsets.only(top: 20, bottom: 20), // contentPadding: EdgeInsets.only(top: 20, bottom: 20),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10)), borderRadius: BorderRadius.all(Radius.circular(10)),
borderSide: BorderSide(color: Colors.grey[100]), borderSide: BorderSide(color: Colors.grey[300]),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Colors.grey[100]), borderSide: BorderSide(color: Colors.grey[300]),
), ),
errorBorder: OutlineInputBorder( errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Colors.grey[100]), borderSide: BorderSide(color: Colors.grey[300]),
), ),
focusedErrorBorder: OutlineInputBorder( focusedErrorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),

@ -16,13 +16,16 @@ class PatientCard extends StatelessWidget {
final String patientType; final String patientType;
final String arrivalType; final String arrivalType;
final bool isInpatient; final bool isInpatient;
final bool isMyPatient;
final bool isFromSearch;
const PatientCard( const PatientCard(
{Key key, {Key key,
this.patientInfo, this.patientInfo,
this.onTap, this.onTap,
this.patientType, this.patientType,
this.arrivalType, this.arrivalType,
this.isInpatient}) this.isInpatient, this.isMyPatient = false, this.isFromSearch = false})
: super(key: key); : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -35,9 +38,9 @@ class PatientCard extends StatelessWidget {
color: Colors.white, color: Colors.white,
), ),
child: Stack(children: [ child: Stack(children: [
if (SERVICES_PATIANT2[int.parse(patientType)] != "List_MyInPatient") if (!isInpatient&& !isMyPatient && !isFromSearch)
Container( Container(
height: MediaQuery.of(context).size.height * .20, height: 160,
width: 5, width: 5,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
@ -47,6 +50,16 @@ class PatientCard extends StatelessWidget {
? Colors.green[500] ? Colors.green[500]
: Colors.red[800], : Colors.red[800],
)), )),
if(isMyPatient && !isFromSearch)
Container(
height: 180,
width: 5,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10)),
color: Colors.green[500]
)),
Container( Container(
padding: EdgeInsets.only(left: 10, right: 0, bottom: 0), padding: EdgeInsets.only(left: 10, right: 0, bottom: 0),
child: InkWell( child: InkWell(
@ -55,48 +68,114 @@ class PatientCard extends StatelessWidget {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
SERVICES_PATIANT2[int.parse(patientType)] == !(isInpatient && !isFromSearch)
"List_MyOutPatient"
? Padding( ? Padding(
padding: EdgeInsets.only(left: 12.0), padding: EdgeInsets.only(left: 12.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
patientInfo.patientStatusType == 43 patientInfo.patientStatusType == 43
? AppText( ? Row(
TranslationBase.of(context).arrivedP, children: [
color: Colors.green, AppText(
fontWeight: FontWeight.bold, TranslationBase.of(context).arrivedP,
fontFamily: 'Poppins', color: Colors.green,
fontSize: 12, fontWeight: FontWeight.bold,
) fontFamily: 'Poppins',
: AppText( fontSize: 12,
TranslationBase.of(context).notArrived, ),
color: Colors.red[800], SizedBox(width: 8,),
fontWeight: FontWeight.bold, SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),),
fontFamily: 'Poppins', SizedBox(width: 8,),
fontSize: 12, AppText(
), patientInfo.status==2? 'Confirmed':'Booked',
color: patientInfo.status==2? Colors.green:Colors.grey ,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
),
],
)
: patientInfo.patientStatusType == 42?Row(
children: [
AppText(
TranslationBase.of(context).notArrived,
color: Colors.red[800],
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
),
SizedBox(width: 8,),
SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),),
SizedBox(width: 8,),
AppText(
patientInfo.status==2? 'Confirmed':'Booked',
color: patientInfo.status==2? Colors.green:Colors.grey ,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
),
],
): !isFromSearch && patientInfo.patientStatusType==null ? Row(
children: [
AppText(
TranslationBase.of(context).notArrived,
color: Colors.red[800],
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
),
SizedBox(width: 8,),
SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),),
SizedBox(width: 8,),
AppText(
patientInfo.status==2? 'Booked':'Confirmed',
color: patientInfo.status==2? Colors.grey:Colors.green ,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
)
],
):SizedBox(),
this.arrivalType == '1' this.arrivalType == '1'
? AppText( ? AppText(
patientInfo.startTime != null patientInfo.startTime != null
? patientInfo.startTime ? patientInfo.startTime
: patientInfo.startTimes, : patientInfo.startTimes,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w400,
) )
: patientInfo.arrivedOn != null : patientInfo.arrivedOn != null
? AppText( ? AppText(
DateUtils.convertStringToDateFormat( DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.arrivedOn,)
patientInfo.arrivedOn, )+" "+ "${DateUtils.getStartTime(patientInfo.startTime)}",
'MM-dd-yyyy HH:mm'),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w400,
) )
: SizedBox() : (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)?
AppText(
//
// )+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.appointmentDate,)),
" ${DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${DateUtils.getStartTime(patientInfo.startTime)}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
):SizedBox()
], ],
)) ))
: SizedBox(), : SizedBox(),
if(isInpatient && isMyPatient && !isFromSearch)
Row(
children: [
SizedBox(width: 12,),
AppText(
'My Patient',
color: Colors.green,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
),
],
),
Padding( Padding(
padding: EdgeInsets.only(left: 12.0), padding: EdgeInsets.only(left: 12.0),
child: Row( child: Row(
@ -213,8 +292,7 @@ class PatientCard extends StatelessWidget {
), ),
), ),
), ),
if (SERVICES_PATIANT2[int.parse(patientType)] != //if (isInpatient)
"List_MyInPatient")
Container( Container(
child: RichText( child: RichText(
text: new TextSpan( text: new TextSpan(
@ -239,7 +317,7 @@ class PatientCard extends StatelessWidget {
), ),
), ),
), ),
if (isInpatient == true) if (isInpatient )
Container( Container(
child: RichText( child: RichText(
text: new TextSpan( text: new TextSpan(
@ -265,7 +343,7 @@ class PatientCard extends StatelessWidget {
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 15)), fontSize: 15)),
]))), ]))),
if (isInpatient == true) if (patientInfo.admissionDate != null)
Row( Row(
children: [ children: [
AppText( AppText(
@ -278,100 +356,10 @@ class PatientCard extends StatelessWidget {
fontWeight: FontWeight.w700), fontWeight: FontWeight.w700),
], ],
), ),
// Container(
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start,
// children: <Widget>[
// Expanded(
// child: AppText(
// TranslationBase.of(context).noOfDays +
// " : ",
// fontSize: 14,
// ),
// ),
// AppText(
// patientInfo.days,
// color: Colors.white,
// fontSize: 1.5 * SizeConfig.textMultiplier,
// textAlign: TextAlign.center,
// fontWeight: FontWeight.bold,
// ),
// SizedBox(
// height: 0.5,
// )
// ],
// ),
// margin: EdgeInsets.only(
// top: 8,
// ),
// ),
//if (SERVICES_PATIANT2[int.parse(patientType)] ==
// "List_MyOutPatient")
// Container(
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start,
// children: <Widget>[
// AppText(
// TranslationBase.of(context)
// .appointmentDate +
// " : ",
// fontSize: 14,
// ),
// // Container(
// // child:
// patientInfo.appointmentDate != null
// ? AppText(
// DateUtils
// .convertDateFromServerFormat(
// patientInfo.appointmentDate
// .toString(),
// 'yyyy-MM-dd'),
// fontSize: 12,
// fontWeight: FontWeight.bold,
// )
// : SizedBox(),
// //),
// patientInfo.startTimes != null
// ?
// //
// // Container(
// // // height: 15,
// // // width: 60,
// // padding: EdgeInsets.all(5),
// // decoration: BoxDecoration(
// // borderRadius:
// // BorderRadius.circular(25),
// // color: HexColor("#20A169"),
// // ),
// // child:
// AppText(
// ' ' + patientInfo.startTimes,
// fontSize: 11,
// fontWeight: FontWeight.bold,
// )
// //)
// : SizedBox(),
// SizedBox(
// width: 3.5,
// ),
// //,
// SizedBox(
// height: 0.5,
// )
// ],
// ),
// margin: EdgeInsets.only(
// top: 8,
// ),
//)
])) ]))
]), ]),
SERVICES_PATIANT2[int.parse(patientType)] == !isInpatient && !isFromSearch
"List_MyOutPatient"
? Row( ? Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [

@ -21,6 +21,7 @@ class PatientProfileButton extends StatelessWidget {
final bool isLoading; final bool isLoading;
final Function onTap; final Function onTap;
final bool isDischargedPatient; final bool isDischargedPatient;
final bool isSelectInpatient;
PatientProfileButton( PatientProfileButton(
{Key key, {Key key,
this.patient, this.patient,
@ -35,7 +36,7 @@ class PatientProfileButton extends StatelessWidget {
this.isLoading = false, this.isLoading = false,
this.from, this.from,
this.to, this.to,
this.isInPatient = false, this.isDischargedPatient=false, this.isInPatient = false, this.isDischargedPatient=false, this.isSelectInpatient = false,
}) })
: super(key: key); : super(key: key);
@ -133,6 +134,7 @@ class PatientProfileButton extends StatelessWidget {
'arrivalType': arrivalType, 'arrivalType': arrivalType,
'isInpatient': isInPatient, 'isInpatient': isInPatient,
'isDischargedPatient': isDischargedPatient, 'isDischargedPatient': isDischargedPatient,
'isSelectInpatient': isSelectInpatient,
}); });
} }
} }

@ -17,9 +17,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
final String patientType; final String patientType;
final String arrivalType; final String arrivalType;
final double height; final double height;
final bool isInpatient;
PatientProfileHeaderNewDesignAppBar( PatientProfileHeaderNewDesignAppBar(
this.patient, this.patientType, this.arrivalType, {this.height = 0.0}); this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -38,7 +39,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
), ),
height: height == 0 ? 200 : height, height: height == 0 ? isInpatient? 215:200 : height,
child: Container( child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50), margin: EdgeInsets.only(top: 50),
@ -59,7 +60,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
" " + " " +
Helpers.capitalize(patient.lastName)) Helpers.capitalize(patient.lastName))
: Helpers.capitalize(patient.patientDetails.fullName), : Helpers.capitalize(patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier * 2.2, fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
@ -254,7 +255,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
), ),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of(context).age??'' + " : ", text: TranslationBase.of(context).age+ " : ",
style: TextStyle(fontSize: 14)), style: TextStyle(fontSize: 14)),
new TextSpan( new TextSpan(
text: text:
@ -265,6 +266,50 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
), ),
), ),
), ),
if(isInpatient)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize:
2.0 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: patient.admissionDate == null
? ""
: TranslationBase.of(context)
.admissionDate +
" : ",
style: TextStyle(fontSize: 14)),
new TextSpan(
text: patient.admissionDate == null
? ""
: "${DateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 15)),
]))),
if (patient.admissionDate != null)
Row(
children: [
AppText(
"${TranslationBase.of(context).numOfDays}: ",
fontSize: 15,
),
AppText(
"${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}",
fontSize: 15,
fontWeight: FontWeight.w700),
],
),
],
)
], ],
), ),
), ),

@ -16,10 +16,11 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
final String patientType; final String patientType;
final String arrivalType; final String arrivalType;
final double height; final double height;
final bool isHaveMargin;
PatientProfileHeaderNewDesign( PatientProfileHeaderNewDesign(
this.patient, this.patientType, this.arrivalType, this.patient, this.patientType, this.arrivalType,
{this.height = 0.0}); {this.height = 0.0, this.isHaveMargin=true});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -40,7 +40,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget {
height: height == 0 ? 200 : height, height: height == 0 ? 200 : height,
child: Container( child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50), // margin: EdgeInsets.only(top: 50),
child: Column( child: Column(
children: [ children: [
Container( Container(
@ -121,6 +121,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget {
fontWeight: FontWeight.w700), fontWeight: FontWeight.w700),
], ],
), ),
if(patient.admissionDate!=null)
Row( Row(
children: [ children: [
AppText( AppText(
@ -136,6 +137,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
if(patient.admissionDate!=null)
Row( Row(
children: [ children: [
AppText( AppText(
@ -177,6 +179,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget {
) )
], ],
), ),
if(patient.admissionDate!=null)
Row( Row(
children: [ children: [
AppText( AppText(

@ -328,7 +328,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget
margin: EdgeInsets.only(top: 10), margin: EdgeInsets.only(top: 10),
), ),
Expanded( Expanded(
flex: 4, flex: 5,
child: Container( child: Container(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
child: Column( child: Column(
@ -367,7 +367,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget
AppText(branch ?? '', fontSize: 12) AppText(branch ?? '', fontSize: 12)
], ],
), ),
if (isPrescriptions)
if (clinic != null) if (clinic != null)
Row( Row(
children: [ children: [
@ -467,5 +467,5 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget
} }
@override @override
Size get preferredSize => Size(double.maxFinite, 290); Size get preferredSize => Size(double.maxFinite, 310);
} }

@ -16,15 +16,15 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
final bool isInpatient; final bool isInpatient;
final bool isDischargedPatient; final bool isDischargedPatient;
ProfileMedicalInfoWidgetInPatient( ProfileMedicalInfoWidgetInPatient(
{Key key, {Key key,
this.patient, this.patient,
this.patientType, this.patientType,
this.arrivalType, this.arrivalType,
this.from, this.from,
this.to, this.isInpatient, this.isDischargedPatient = false}); this.to,
this.isInpatient,
this.isDischargedPatient = false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -14,6 +15,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
final String patientType; final String patientType;
final String arrivalType; final String arrivalType;
final bool isInpatient; final bool isInpatient;
final bool isDischargedPatient;
ProfileMedicalInfoWidgetSearch( ProfileMedicalInfoWidgetSearch(
{Key key, {Key key,
@ -21,146 +23,523 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
this.patientType, this.patientType,
this.arrivalType, this.arrivalType,
this.from, this.from,
this.to, this.isInpatient}); this.to,
this.isInpatient,
this.isDischargedPatient});
TabController _tabController;
void initState() {
_tabController = TabController(length: 2);
}
void dispose() {
_tabController.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async {}, onModelReady: (model) async {},
builder: (_, model, w) => GridView.count( builder: (_, model, w) => DefaultTabController(
shrinkWrap: true, length: 2,
physics: NeverScrollableScrollPhysics(), initialIndex: isInpatient ? 0 : 1,
crossAxisSpacing: 10, child: SizedBox(
mainAxisSpacing: 10, height: MediaQuery.of(context).size.height * 1.0,
childAspectRatio: 1 / 1.0, width: double.infinity,
crossAxisCount: 3, child: Scaffold(
children: [ appBar: AppBar(
PatientProfileButton( backgroundColor: Colors.white,
key: key, toolbarHeight: 55,
patient: patient, elevation: 0,
patientType: patientType, bottom: TabBar(
arrivalType: arrivalType, controller: _tabController,
from: from, indicator: BoxDecoration(
to: to, shape: BoxShape.rectangle,
nameLine1: TranslationBase.of(context).vital, borderRadius: BorderRadius.circular(10), // Creates border
nameLine2: TranslationBase.of(context).signs, color: Color(0xffD02126),
route: VITAL_SIGN_DETAILS, ),
icon: 'patient/vital_signs.png'), //isScrollable: true,
PatientProfileButton(
key: key, //indicatorWeight: 4.0,
patient: patient, indicatorColor: Colors.red[500],
patientType: patientType,
arrivalType: arrivalType, // labelPadding:
route: MEDICAL_FILE, // EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0),
nameLine1: "Health", //TranslationBase.of(context).medicalReport, unselectedLabelColor: Color(0xff5A6168),
nameLine2: "Summary", //TranslationBase.of(context).summaryReport, labelColor: Colors.white,
icon: 'patient/health_summary.png'), tabs: <Widget>[
PatientProfileButton( Container(
key: key, width: MediaQuery.of(context).size.width * 0.35,
patient: patient, height: MediaQuery.of(context).size.height * 0.06,
patientType: patientType, child: Center(
arrivalType: arrivalType, child: Text('Inpatient Info'),
route: LAB_RESULT, ),
nameLine1: TranslationBase.of(context).lab, ),
nameLine2: TranslationBase.of(context).result, Container(
icon: 'patient/lab_results.png'), width: MediaQuery.of(context).size.width * 0.35,
PatientProfileButton( height: MediaQuery.of(context).size.height * 0.06,
key: key, child: Center(
patient: patient, child: Text('OutPatient Info'),
patientType: patientType, ),
arrivalType: arrivalType, ),
isInPatient:isInpatient, ]),
route: RADIOLOGY_PATIENT, ),
nameLine1: TranslationBase.of(context).radiology, body: Padding(
nameLine2: TranslationBase.of(context).service, padding: const EdgeInsets.symmetric(vertical: 15.0),
icon: 'patient/health_summary.png'), child: TabBarView(
PatientProfileButton( physics: BouncingScrollPhysics(),
key: key, controller: _tabController,
patient: patient, children: [
patientType: patientType, GridView.count(
arrivalType: arrivalType, shrinkWrap: true,
route: PATIENT_ECG, physics: NeverScrollableScrollPhysics(),
nameLine1: TranslationBase.of(context).patient, crossAxisSpacing: 10,
nameLine2: "ECG", mainAxisSpacing: 10,
icon: 'patient/patient_sick_leave.png'), childAspectRatio: 1 / 1.0,
(int.parse(patientType) == 7 || int.parse(patientType) == 6) crossAxisCount: 3,
? PatientProfileButton( children: [
key: key, PatientProfileButton(
patient: patient, key: key,
patientType: patientType, patient: patient,
arrivalType: arrivalType, patientType: patientType,
route: ORDER_PRESCRIPTION_NEW, arrivalType: arrivalType,
nameLine1: TranslationBase.of(context).orders, from: from,
nameLine2: TranslationBase.of(context).prescription, to: to,
icon: 'patient/order_prescription.png') nameLine1: TranslationBase.of(context).vital,
: PatientProfileButton( nameLine2: TranslationBase.of(context).signs,
key: key, route: VITAL_SIGN_DETAILS,
patient: patient, isInPatient: true,
patientType: patientType, icon: 'patient/vital_signs.png'),
arrivalType: arrivalType, PatientProfileButton(
route: ORDER_PRESCRIPTION_NEW, key: key,
nameLine1: TranslationBase.of(context).orders, patient: patient,
nameLine2: TranslationBase.of(context).prescription, patientType: patientType,
icon: 'patient/order_prescription.png'), arrivalType: arrivalType,
PatientProfileButton( route: LAB_RESULT,
key: key, isInPatient: true,
patient: patient, nameLine1: TranslationBase.of(context).lab,
patientType: patientType, nameLine2: TranslationBase.of(context).result,
arrivalType: arrivalType, icon: 'patient/lab_results.png'),
route: ORDER_PROCEDURE, PatientProfileButton(
nameLine1: TranslationBase.of(context).orders, key: key,
nameLine2: TranslationBase.of(context).procedures, patient: patient,
icon: 'patient/Order_Procedures.png'), patientType: patientType,
PatientProfileButton( arrivalType: arrivalType,
key: key, isInPatient: isInpatient,
patient: patient, route: RADIOLOGY_PATIENT,
patientType: patientType, nameLine1: TranslationBase.of(context).radiology,
arrivalType: arrivalType, nameLine2: TranslationBase.of(context).result,
route: PATIENT_INSURANCE_APPROVALS_NEW, icon: 'patient/health_summary.png'),
nameLine1: TranslationBase.of(context).insurance, PatientProfileButton(
nameLine2: TranslationBase.of(context).service, key: key,
icon: 'patient/vital_signs.png'), patient: patient,
PatientProfileButton( patientType: patientType,
key: key, arrivalType: arrivalType,
patient: patient, route: ORDER_PRESCRIPTION_NEW,
patientType: patientType, nameLine1: TranslationBase.of(context).patient,
arrivalType: arrivalType, nameLine2: TranslationBase.of(context).prescription,
route: SHOW_SICKLEAVE, icon: 'patient/order_prescription.png'),
nameLine1: TranslationBase.of(context).patientSick, PatientProfileButton(
nameLine2: TranslationBase.of(context).leave, key: key,
icon: 'patient/patient_sick_leave.png'), patient: patient,
if (patient.admissionNo != null && patient.admissionNo != "0") patientType: patientType,
PatientProfileButton( arrivalType: arrivalType,
key: key, route: PROGRESS_NOTE,
patient: patient, isDischargedPatient: isDischargedPatient,
patientType: patientType, nameLine1: TranslationBase.of(context).progress,
arrivalType: arrivalType, nameLine2: TranslationBase.of(context).note,
route: PROGRESS_NOTE, icon: 'patient/Progress_notes.png'),
nameLine1: TranslationBase.of(context).progress, PatientProfileButton(
nameLine2: TranslationBase.of(context).note, key: key,
icon: 'patient/Progress_notes.png'), patient: patient,
if (patient.admissionNo != null && patient.admissionNo != "0") patientType: patientType,
PatientProfileButton( arrivalType: arrivalType,
key: key, route: ORDER_NOTE,
patient: patient, isDischargedPatient: isDischargedPatient,
patientType: patientType, nameLine1: "Order", //"Text",
arrivalType: arrivalType, nameLine2:
route: ORDER_NOTE, "Sheet", //TranslationBase.of(context).orders,
nameLine1: "Order", //"Text", icon: 'patient/Progress_notes.png'),
nameLine2: "Sheet", PatientProfileButton(
icon: 'patient/Progress_notes.png'), key: key,
if (patient.appointmentNo != null && patient.appointmentNo != 0) patient: patient,
PatientProfileButton( patientType: patientType,
key: key, arrivalType: arrivalType,
patient: patient, route: ORDER_PROCEDURE,
patientType: patientType, nameLine1: TranslationBase.of(context).orders,
arrivalType: arrivalType, nameLine2: TranslationBase.of(context).procedures,
route: REFER_PATIENT_TO_DOCTOR, icon: 'patient/Order_Procedures.png'),
// isDisable: patient.patientStatusType != 43 ? true : false, PatientProfileButton(
nameLine1: TranslationBase.of(context).referral, key: key,
nameLine2: TranslationBase.of(context).patient, patient: patient,
icon: 'patient/refer_patient.png'), patientType: patientType,
], arrivalType: arrivalType,
route: MEDICAL_FILE,
nameLine1: "Health",
//TranslationBase.of(context).medicalReport,
nameLine2: "Summary",
//TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isDisable: true,
route: MEDICAL_FILE,
nameLine1: "Medical", //Health
//TranslationBase.of(context).medicalReport,
nameLine2: "Report", //Report
//TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: REFER_IN_PATIENT_TO_DOCTOR,
isInPatient: true,
nameLine1: TranslationBase.of(context).referral,
nameLine2: TranslationBase.of(context).patient,
icon: 'patient/refer_patient.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).approvals,
icon: 'patient/vital_signs.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isDisable: true,
route: null,
nameLine1: "Discharge",
nameLine2: "Summery",
icon: 'patient/patient_sick_leave.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ADD_SICKLEAVE,
nameLine1: TranslationBase.of(context).patientSick,
nameLine2: TranslationBase.of(context).leave,
icon: 'patient/patient_sick_leave.png'),
],
),
GridView.count(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
crossAxisSpacing: 10,
mainAxisSpacing: 10,
childAspectRatio: 1 / 1.0,
crossAxisCount: 3,
children: [
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
from: from,
to: to,
nameLine1: TranslationBase.of(context).vital,
nameLine2: TranslationBase.of(context).signs,
route: VITAL_SIGN_DETAILS,
icon: 'patient/vital_signs.png'),
// if (selectedPatientType != 7)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: MEDICAL_FILE,
nameLine1:
"Health", //TranslationBase.of(context).medicalReport,
nameLine2:
"Summary", //TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: LAB_RESULT,
nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).result,
icon: 'patient/lab_results.png'),
// if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isInPatient: isInpatient,
route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).service,
icon: 'patient/health_summary.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_ECG,
nameLine1: TranslationBase.of(context).patient,
nameLine2: "ECG",
icon: 'patient/patient_sick_leave.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_PRESCRIPTION_NEW,
nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).prescription,
icon: 'patient/order_prescription.png'),
// if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_PROCEDURE,
nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).procedures,
icon: 'patient/Order_Procedures.png'),
//if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).service,
icon: 'patient/vital_signs.png'),
// if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ADD_SICKLEAVE,
nameLine1: TranslationBase.of(context).patientSick,
nameLine2: TranslationBase.of(context).leave,
icon: 'patient/patient_sick_leave.png'),
if (patient.appointmentNo != null &&
patient.appointmentNo != 0)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_UCAF_REQUEST,
isDisable:
patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).ucaf,
icon: 'patient/ucaf.png'),
if (patient.appointmentNo != null &&
patient.appointmentNo != 0)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: REFER_PATIENT_TO_DOCTOR,
isDisable:
patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).referral,
nameLine2: TranslationBase.of(context).patient,
icon: 'patient/refer_patient.png'),
if (patient.appointmentNo != null &&
patient.appointmentNo != 0)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_ADMISSION_REQUEST,
isDisable:
patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).admission,
nameLine2: TranslationBase.of(context).request,
icon: 'patient/admission_req.png'),
if (isInpatient)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PROGRESS_NOTE,
nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note,
icon: 'patient/Progress_notes.png'),
if (isInpatient)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_NOTE,
nameLine1: "Order", //"Text",
nameLine2: "Sheet",
icon: 'patient/Progress_notes.png'),
],
),
],
),
),
),
),
// GridView.count(
// shrinkWrap: true,
// physics: NeverScrollableScrollPhysics(),
// crossAxisSpacing: 10,
// mainAxisSpacing: 10,
// childAspectRatio: 1 / 1.0,
// crossAxisCount: 3,
// children: [
// PatientProfileButton(
// key: key,
// patient: patient,
// patientType: patientType,
// arrivalType: arrivalType,
// from: from,
// to: to,
// nameLine1: TranslationBase.of(context).vital,
// nameLine2: TranslationBase.of(context).signs,
// route: VITAL_SIGN_DETAILS,
// icon: 'patient/vital_signs.png'),
// PatientProfileButton(
// key: key,
// patient: patient,
// patientType: patientType,
// arrivalType: arrivalType,
// route: MEDICAL_FILE,
// nameLine1:
// "Health", //TranslationBase.of(context).medicalReport,
// nameLine2:
// "Summary", //TranslationBase.of(context).summaryReport,
// icon: 'patient/health_summary.png'),
// PatientProfileButton(
// key: key,
// patient: patient,
// patientType: patientType,
// arrivalType: arrivalType,
// route: LAB_RESULT,
// nameLine1: TranslationBase.of(context).lab,
// nameLine2: TranslationBase.of(context).result,
// icon: 'patient/lab_results.png'),
// PatientProfileButton(
// key: key,
// patient: patient,
// patientType: patientType,
// arrivalType: arrivalType,
// isInPatient: isInpatient,
// route: RADIOLOGY_PATIENT,
// nameLine1: TranslationBase.of(context).radiology,
// nameLine2: TranslationBase.of(context).service,
// icon: 'patient/health_summary.png'),
// PatientProfileButton(
// key: key,
// patient: patient,
// patientType: patientType,
// arrivalType: arrivalType,
// route: PATIENT_ECG,
// nameLine1: TranslationBase.of(context).patient,
// nameLine2: "ECG",
// icon: 'patient/patient_sick_leave.png'),
// (int.parse(patientType) == 7 ||
// int.parse(patientType) == 6)
// ? PatientProfileButton(
// key: key,
// patient: patient,
// patientType: patientType,
// arrivalType: arrivalType,
// route: ORDER_PRESCRIPTION_NEW,
// nameLine1: TranslationBase.of(context).orders,
// nameLine2:
// TranslationBase.of(context).prescription,
// icon: 'patient/order_prescription.png')
// : PatientProfileButton(
// key: key,
// patient: patient,
// patientType: patientType,
// arrivalType: arrivalType,
// route: ORDER_PRESCRIPTION_NEW,
// nameLine1: TranslationBase.of(context).orders,
// nameLine2:
// TranslationBase.of(context).prescription,
// icon: 'patient/order_prescription.png'),
// PatientProfileButton(
// key: key,
// patient: patient,
// patientType: patientType,
// arrivalType: arrivalType,
// route: ORDER_PROCEDURE,
// nameLine1: TranslationBase.of(context).orders,
// nameLine2: TranslationBase.of(context).procedures,
// icon: 'patient/Order_Procedures.png'),
// PatientProfileButton(
// key: key,
// patient: patient,
// patientType: patientType,
// arrivalType: arrivalType,
// route: PATIENT_INSURANCE_APPROVALS_NEW,
// nameLine1: TranslationBase.of(context).insurance,
// nameLine2: TranslationBase.of(context).service,
// icon: 'patient/vital_signs.png'),
// PatientProfileButton(
// key: key,
// patient: patient,
// patientType: patientType,
// arrivalType: arrivalType,
// route: SHOW_SICKLEAVE,
// nameLine1: TranslationBase.of(context).patientSick,
// nameLine2: TranslationBase.of(context).leave,
// icon: 'patient/patient_sick_leave.png'),
// if (patient.admissionNo != null &&
// patient.admissionNo != "0")
// PatientProfileButton(
// key: key,
// patient: patient,
// patientType: patientType,
// arrivalType: arrivalType,
// route: PROGRESS_NOTE,
// nameLine1: TranslationBase.of(context).progress,
// nameLine2: TranslationBase.of(context).note,
// icon: 'patient/Progress_notes.png'),
// if (patient.admissionNo != null &&
// patient.admissionNo != "0")
// PatientProfileButton(
// key: key,
// patient: patient,
// patientType: patientType,
// arrivalType: arrivalType,
// route: ORDER_NOTE,
// nameLine1: "Order", //"Text",
// nameLine2: "Sheet",
// icon: 'patient/Progress_notes.png'),
// if (patient.appointmentNo != null &&
// patient.appointmentNo != 0)
// PatientProfileButton(
// key: key,
// patient: patient,
// patientType: patientType,
// arrivalType: arrivalType,
// route: REFER_PATIENT_TO_DOCTOR,
// // isDisable: patient.patientStatusType != 43 ? true : false,
// nameLine1: TranslationBase.of(context).referral,
// nameLine2: TranslationBase.of(context).patient,
// icon: 'patient/refer_patient.png'),
// ],
// ),
), ),
); );
} }

@ -19,6 +19,7 @@ class AppScaffold extends StatelessWidget {
final Widget bottomSheet; final Widget bottomSheet;
final Color backgroundColor; final Color backgroundColor;
final Widget appBar; final Widget appBar;
final String subtitle;
final bool isHomeIcon; final bool isHomeIcon;
AppScaffold( AppScaffold(
{this.appBarTitle = '', {this.appBarTitle = '',
@ -29,7 +30,7 @@ class AppScaffold extends StatelessWidget {
this.bottomSheet, this.bottomSheet,
this.backgroundColor, this.backgroundColor,
this.isHomeIcon = true, this.isHomeIcon = true,
this.appBar}); this.appBar, this.subtitle});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -51,7 +52,14 @@ class AppScaffold extends StatelessWidget {
color: Colors.black87, color: Colors.black87,
fontSize: 16.8, fontSize: 16.8,
)), )),
title: Text(appBarTitle.toUpperCase()), title: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(appBarTitle.toUpperCase()),
if(subtitle!=null)
Text(subtitle,style: TextStyle(fontSize: 12,color: Colors.red),),
],
),
leading: Builder(builder: (BuildContext context) { leading: Builder(builder: (BuildContext context) {
return IconButton( return IconButton(
icon: Icon(Icons.arrow_back_ios), icon: Icon(Icons.arrow_back_ios),

@ -121,16 +121,14 @@ class _AppTextState extends State<AppText> {
style: widget.style != null style: widget.style != null
? _getFontStyle().copyWith( ? _getFontStyle().copyWith(
fontStyle: widget.italic ? FontStyle.italic : null, fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color != null ? widget.color : null, color: widget.color ,
fontWeight: widget.fontWeight ?? _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),
) )
: TextStyle( : TextStyle(
fontStyle: widget.italic ? FontStyle.italic : null, fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.textDecoration == null color: widget.color != null
? widget.color != null ? widget.color
? widget.color : Colors.black,
: Colors.black
: null,
fontSize: widget.fontSize ?? _getFontSize(), fontSize: widget.fontSize ?? _getFontSize(),
letterSpacing: letterSpacing:
widget.variant == "overline" ? 1.5 : null, widget.variant == "overline" ? 1.5 : null,

@ -238,11 +238,9 @@ class _SecondaryButtonState extends State<SecondaryButton>
widget.label, widget.label,
style: TextStyle( style: TextStyle(
color: widget.textColor, color: widget.textColor,
fontSize: widget.small ? 12.0 : 15.0, fontSize: 16,
// fontWeight: FontWeight.w800, fontWeight: FontWeight.w700,
fontFamily: projectViewModel.isArabic fontFamily: 'Poppins'),
? 'Cairo'
: 'Poppins'),
), ),
) )
], ],

@ -19,6 +19,8 @@ class DoctorCard extends StatelessWidget {
final bool isPrescriptions; final bool isPrescriptions;
final String clinic; final String clinic;
final bool isShowEye; final bool isShowEye;
final bool isShowTime;
final bool isNoMargin;
DoctorCard( DoctorCard(
{this.doctorName, {this.doctorName,
@ -30,13 +32,13 @@ class DoctorCard extends StatelessWidget {
this.orderNo, this.orderNo,
this.isPrescriptions = false, this.isPrescriptions = false,
this.clinic, this.clinic,
this.isShowEye = true}); this.isShowEye = true, this.isShowTime= true, this.isNoMargin =false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return Container( return Container(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(!isNoMargin? 10:0),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
width: 0.5, width: 0.5,
@ -71,7 +73,7 @@ class DoctorCard extends StatelessWidget {
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
), ),
if (!isPrescriptions) if (!isPrescriptions&& isShowTime)
AppText( AppText(
'${DateUtils.getHour(appointmentDate)}', '${DateUtils.getHour(appointmentDate)}',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

@ -2,30 +2,23 @@ import 'dart:async';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'dart:async';
import 'package:speech_to_text/speech_to_text.dart' as stt;
class SpeechToText { class SpeechToText {
final BuildContext context; final BuildContext context;
static var dialog; static var dialog;
static stt.SpeechToText speech = stt.SpeechToText();
SpeechToText({ SpeechToText({
@required this.context, @required this.context,
}); });
showAlertDialog(BuildContext context) { showAlertDialog(BuildContext context) {
//AlertDialog alert = AlertDialog
// AlertDialog alert = AlertDialog(content: MyStatefulBuilder(dispose: () {
// print('dispose!!!!!!!!!!!!');
// })
// isClosed = true;
// streamSubscription.cancel();
// }, builder: (BuildContext context, StateSetter setState) {
// //print(streamSubscription);
// }),
// );
// show the dialog // show the dialog
showDialog( showDialog(
context: context, context: context,
@ -42,6 +35,7 @@ class SpeechToText {
static closeAlertDialog(BuildContext context) { static closeAlertDialog(BuildContext context) {
Navigator.of(dialog).pop(); Navigator.of(dialog).pop();
speech.stop();
} }
} }
@ -93,14 +87,16 @@ class _MyStatefulBuilderState extends State<MyStatefulBuilder> {
width: SizeConfig.realScreenWidth * 0.8, width: SizeConfig.realScreenWidth * 0.8,
child: Container( child: Container(
child: Column(children: [ child: Column(children: [
Expanded( Row(
flex: 1, mainAxisAlignment: MainAxisAlignment.end,
child: Center( children: [
child: Image.asset( IconButton(
'assets/images/habib-logo.png', icon: Icon(DoctorApp.close),
height: 75, onPressed: () {
width: 75, SpeechToText.closeAlertDialog(context);
))), })
],
),
Expanded( Expanded(
flex: 3, flex: 3,
child: Center( child: Center(
@ -126,19 +122,38 @@ class _MyStatefulBuilderState extends State<MyStatefulBuilder> {
Expanded( Expanded(
flex: 1, flex: 1,
child: Center( child: Center(
child: AppText(searchText != null && searchText != 'null' child: AppText(
? searchText searchText == null
: TranslationBase.of(context).trySaying))), ? TranslationBase.of(context).trySaying
: searchText == 'null'
? TranslationBase.of(context).didntCatch
: searchText,
fontSize: 14,
))),
searchText == 'null' searchText == 'null'
? Center( ? Center(
child: RaisedButton( child: InkWell(
child: AppText('Retry'), child: Container(
onPressed: () { decoration: BoxDecoration(
border: Border.all(color: Colors.grey[300])),
padding: EdgeInsets.all(5),
child: AppText(
'Try Again',
fontSize: 13,
)),
onTap: () {
SpeechToText.closeAlertDialog(context); SpeechToText.closeAlertDialog(context);
event.setValue({'startPopUp': 'true'}); event.setValue({'startPopUp': 'true'});
}, },
)) ))
: SizedBox() : SizedBox(),
Row(mainAxisAlignment: MainAxisAlignment.end, children: [
Image.asset(
'assets/images/habib-logo.png',
height: 20,
width: 20,
)
])
]), ]),
))); )));

@ -4,11 +4,11 @@ class TextFieldsUtils{
static BoxDecoration containerBorderDecoration( static BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor, Color containerColor, Color borderColor,
{double borderWidth = -1}) { {double borderWidth = -1, double borderRadius = 12}) {
return BoxDecoration( return BoxDecoration(
color: containerColor, color: containerColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(12)), borderRadius: BorderRadius.all(Radius.circular(borderRadius)),
border: Border.fromBorderSide(BorderSide( border: Border.fromBorderSide(BorderSide(
color: borderColor, color: borderColor,
width: borderWidth == -1 ? 2.0 : borderWidth, width: borderWidth == -1 ? 2.0 : borderWidth,

@ -566,7 +566,7 @@ packages:
name: js name: js
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.6.2" version: "0.6.3-nullsafety.1"
json_annotation: json_annotation:
dependency: transitive dependency: transitive
description: description:
@ -608,7 +608,7 @@ packages:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0-nullsafety.4"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -900,7 +900,7 @@ packages:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0-nullsafety.2"
sticky_headers: sticky_headers:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1091,5 +1091,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.10.0 <2.11.0" dart: ">=2.10.0 <=2.11.0-213.1.beta"
flutter: ">=1.22.0 <2.0.0" flutter: ">=1.22.0 <2.0.0"

Loading…
Cancel
Save