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

merge-requests/619/head
hussam al-habibeh 5 years ago
commit 718091f1f6

@ -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,12 +7,8 @@ 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();
@ -70,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);
@ -145,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
@ -192,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)}");

@ -48,6 +48,7 @@ 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': 'كل المرضى الداخليين'}, 'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى الداخليين'},
'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'},
'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'},
@ -769,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": {

@ -20,6 +20,9 @@ class PatientSearchRequestModel {
this.patientMobileNumber ="0", this.patientMobileNumber ="0",
this.patientIdentificationID ="0", this.patientIdentificationID ="0",
this.patientID =0, this.patientID =0,
this.searchType =1,
this.mobileNo="",
this.identificationNo="0",
this.from ="0", this.from ="0",
this.to ="0"}); this.to ="0"});

@ -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";

@ -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,7 +25,8 @@ 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=[]; patientLabOrdersList=[];
@ -33,6 +34,7 @@ class LabsService extends BaseService {
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));

@ -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,31 +71,28 @@ class VitalSignsService extends BaseService {
); );
} }
Future getInPatientVitalSignHistory(PatiantInformtion patient, bool isInPatient) 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['PatientTypeID'] = patient.patientType; body['PatientTypeID'] = patient.patientType;
// if(isInPatient){ // if(isInPatient){
body['InOutPatientType'] = 0; body['InOutPatientType'] = 0;
// }else { body['isDentalAllowedBackend'] = false;
// body['InOutPatientType'] = 2; body['IPAdress'] = "10.20.10.20";
// } // }else {
// body['InOutPatientType'] = 2;
// }
if (patient.appointmentNo != null && patient.projectId != null) {
body['TransNo'] = patient.appointmentNo;
body['ProjectID'] = patient.projectId;
}
await baseAppClient.postPatient( await baseAppClient.postPatient(
GET_PATIENT_VITAL_SIGN, 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;

@ -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;
getAllSickLeavePatient = [];
await baseAppClient.postPatient( 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);
_getAllsickLeavePatient.clear(); getAllSickLeavePatient=[];
response['List_SickLeave'].forEach((v) { response['List_SickLeave'].forEach((v) {
_getAllsickLeavePatient.add(SickLeavePatientModel.fromJson(v)); getAllSickLeavePatient.add(SickLeavePatientModel.fromJson(v));
}); });
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
@ -119,13 +119,15 @@ class SickLeaveService extends BaseService {
_sickLeavePatientRequestModel = SickLeavePatientRequestModel( _sickLeavePatientRequestModel = SickLeavePatientRequestModel(
patientID: patientMRN, patientTypeID: 2, patientType: 1); patientID: patientMRN, patientTypeID: 2, patientType: 1);
hasError = false; hasError = false;
getAllSickLeavePatient =[];
getAllSickLeavePatient.clear();
await baseAppClient.postPatient( await baseAppClient.postPatient(
GET_SICK_LEAVE_PATIENT, GET_SICK_LEAVE_PATIENT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
Future.value(response); Future.value(response);
_getAllsickLeavePatient.clear(); getAllSickLeavePatient.clear();
response['List_SickLeave'].forEach((v) { response['List_SickLeave'].forEach((v) {
_getAllsickLeavePatient.add(SickLeavePatientModel.fromJson(v)); getAllSickLeavePatient.add(SickLeavePatientModel.fromJson(v));
}); });
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {

@ -124,6 +124,7 @@ class PatientSearchViewModel extends BaseViewModel{
currentModel.firstName = patientSearchRequestModel.firstName; currentModel.firstName = patientSearchRequestModel.firstName;
currentModel.lastName = patientSearchRequestModel.lastName; currentModel.lastName = patientSearchRequestModel.lastName;
currentModel.middleName = patientSearchRequestModel.middleName; currentModel.middleName = patientSearchRequestModel.middleName;
currentModel.doctorID = patientSearchRequestModel.doctorID;
currentModel.from = dateFrom; currentModel.from = dateFrom;
currentModel.to = dateTo; currentModel.to = dateTo;
@ -147,11 +148,12 @@ class PatientSearchViewModel extends BaseViewModel{
Future getInPatientList(PatientSearchRequestModel requestModel, Future getInPatientList(PatientSearchRequestModel requestModel,
{bool isMyInpatient = false, bool isFirstTime = true}) async { {bool isMyInpatient = false, bool isFirstTime = true}) async {
await getDoctorProfile();
if (isFirstTime) if (isFirstTime)
setState(ViewState.Busy); setState(ViewState.Busy);
else else
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _inPatientService.getInPatientList(requestModel, isMyInpatient); await _inPatientService.getInPatientList(requestModel, false);
if (_inPatientService.hasError) { if (_inPatientService.hasError) {
error = _inPatientService.error; error = _inPatientService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -56,7 +56,7 @@ class VitalSignsViewModel extends BaseViewModel {
if (isInPatient) { if (isInPatient) {
await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); await _vitalSignService.getPatientVitalSignsHistory(patient, from, to);
} else { } else {
await _vitalSignService.getInPatientVitalSignHistory(patient, isInPatient); await _vitalSignService.getOutPatientVitalSignHistory(patient, from, to);
} }

@ -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);
} }
} }

@ -62,7 +62,7 @@ class SickLeaveViewModel extends BaseViewModel {
await _sickLeaveService.getSickLeavePatient(patientMRN); await _sickLeaveService.getSickLeavePatient(patientMRN);
if (_sickLeaveService.hasError) { if (_sickLeaveService.hasError) {
error = _sickLeaveService.error; error = _sickLeaveService.error;
setState(ViewState.Error); setState(ViewState.ErrorLocal);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }

@ -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';

@ -559,7 +559,7 @@ class _HomeScreenState extends State<HomeScreen> {
isSearch: false, isSearch: false,
isInpatient: false, isInpatient: false,
patientSearchRequestModel: patientSearchRequestModel:
PatientSearchRequestModel(from: date, to: date), PatientSearchRequestModel(from: date, to: date,doctorID: authProvider.doctorProfile.doctorID),
selectedPatientType: selectedPatientType:
PatientType.OutPatient, PatientType.OutPatient,
isSearchWithKeyInfo: false, isSearchWithKeyInfo: false,

@ -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(

@ -27,6 +27,7 @@ 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,
@ -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),
], ],

@ -101,31 +101,60 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> {
// const SizedBox( // const SizedBox(
// height: 16, // height: 16,
// ), // ),
...model.filteredInPatientItems.map((item) { ...List.generate(model.filteredInPatientItems.length, (index) {
return PatientCard( if(_activeTab == 0)
patientInfo: item, return PatientCard(
patientType: "1", patientInfo: model.filteredInPatientItems[index],
arrivalType: "1", patientType: "1",
isInpatient: true, arrivalType: "1",
onTap: () { isInpatient: true,
FocusScopeNode currentFocus = FocusScope.of(context); isMyPatient: model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID,
if (!currentFocus.hasPrimaryFocus) { onTap: () {
currentFocus.unfocus(); FocusScopeNode currentFocus = FocusScope.of(context);
} if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
Navigator.of(context) Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: { .pushNamed(PATIENTS_PROFILE, arguments: {
"patient": item, "patient": model.filteredInPatientItems[index],
"patientType": "1", "patientType": "1",
"from": "0", "from": "0",
"to": "0", "to": "0",
"isSearch": false, "isSearch": false,
"isInpatient": true, "isInpatient": true,
"arrivalType": "1", "arrivalType": "1",
}); });
}, },
); );
}).toList(), 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,)
], ],
), ),
), ),
@ -172,12 +201,14 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> {
if (!currentFocus.hasPrimaryFocus) { if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus(); currentFocus.unfocus();
} }
GifLoaderDialogUtils.showMyDialog( if (_activeTab==0) {
context); GifLoaderDialogUtils.showMyDialog(
await model.getInPatientList(requestModel, context);
isMyInpatient: _activeTab == 1, isFirstTime: false); await model.getInPatientList(requestModel,
GifLoaderDialogUtils.hideDialog( isMyInpatient: _activeTab == 1, isFirstTime: false);
context); GifLoaderDialogUtils.hideDialog(
context);
}
}, },
child: Center( child: Center(
child: Container( child: Container(

@ -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,

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.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/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/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_new.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/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
@ -12,6 +13,7 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils
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:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class PatientSearchScreenNew extends StatefulWidget { class PatientSearchScreenNew extends StatefulWidget {
@override @override
@ -26,9 +28,11 @@ class _PatientSearchScreenNewState extends State<PatientSearchScreenNew> {
TextEditingController middleNameInfoController = TextEditingController(); TextEditingController middleNameInfoController = TextEditingController();
TextEditingController lastNameFileInfoController = TextEditingController(); TextEditingController lastNameFileInfoController = TextEditingController();
PatientType selectedPatientType = PatientType.inPatient; PatientType selectedPatientType = PatientType.inPatient;
AuthViewModel authProvider;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
authProvider =Provider.of(context);
return BaseView<PatientSearchViewModel>( return BaseView<PatientSearchViewModel>(
onModelReady: (model) async {}, onModelReady: (model) async {},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -51,46 +55,46 @@ class _PatientSearchScreenNewState extends State<PatientSearchScreenNew> {
SizedBox( SizedBox(
height: 16, height: 16,
), ),
AppText( // AppText(
'Patient Type', // 'Patient Type',
fontWeight: FontWeight.w600, // fontWeight: FontWeight.w600,
), // ),
Row( // Row(
children: [ // children: [
Row( // Row(
children: [ // children: [
Radio( // Radio(
activeColor: Color(0xFFB9382C), // activeColor: Color(0xFFB9382C),
value: PatientType.inPatient, // value: PatientType.inPatient,
groupValue: selectedPatientType, // groupValue: selectedPatientType,
onChanged: (value) { // onChanged: (value) {
setState(() { // setState(() {
selectedPatientType = // selectedPatientType =
PatientType.inPatient; // PatientType.inPatient;
}); // });
}, // },
), // ),
Text('InPatient'), // Text('InPatient'),
], // ],
), // ),
Row( // Row(
children: [ // children: [
Radio( // Radio(
activeColor: Color(0xFFB9382C), // activeColor: Color(0xFFB9382C),
value: PatientType.OutPatient, // value: PatientType.OutPatient,
groupValue: selectedPatientType, // groupValue: selectedPatientType,
onChanged: (value) { // onChanged: (value) {
setState(() { // setState(() {
selectedPatientType = // selectedPatientType =
PatientType.OutPatient; // PatientType.OutPatient;
}); // });
}, // },
), // ),
Text('OutPatient'), // Text('OutPatient'),
], // ],
), // ),
], // ],
), // ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -121,78 +125,78 @@ class _PatientSearchScreenNewState extends State<PatientSearchScreenNew> {
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Row( // Row(
mainAxisAlignment: MainAxisAlignment.end, // mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
children: [ // children: [
InkWell( // InkWell(
child: this.showOther == false // child: this.showOther == false
? AppText( // ? AppText(
TranslationBase.of(context) // TranslationBase.of(context)
.searchWithOther, // .searchWithOther,
color: Colors.red, // color: Colors.red,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
) // )
: AppText( // : AppText(
TranslationBase.of(context) // TranslationBase.of(context)
.hideOtherCriteria, // .hideOtherCriteria,
color: Colors.red, // color: Colors.red,
fontWeight: FontWeight.bold), // fontWeight: FontWeight.bold),
onTap: () { // onTap: () {
setState(() { // setState(() {
this.showOther = !this.showOther; // this.showOther = !this.showOther;
}); // });
}, // },
) // )
], // ],
), // ),
SizedBox( // SizedBox(
height: 30, // height: 30,
), // ),
if (showOther) // if (showOther)
Column( // Column(
children: [ // children: [
AppTextFieldCustom( // AppTextFieldCustom(
hintText: // hintText:
TranslationBase.of(context).firstName, // TranslationBase.of(context).firstName,
controller: firstNameInfoController, // controller: firstNameInfoController,
maxLines: 1, // maxLines: 1,
minLines: 1, // minLines: 1,
hasBorder: true, // hasBorder: true,
onChanged: (_) {}, // onChanged: (_) {},
// validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , // // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null ,
), // ),
SizedBox( // SizedBox(
height: 10, // height: 10,
), // ),
AppTextFieldCustom( // AppTextFieldCustom(
hintText: // hintText:
TranslationBase.of(context).middleName, // TranslationBase.of(context).middleName,
controller: middleNameInfoController, // controller: middleNameInfoController,
maxLines: 1, // maxLines: 1,
minLines: 1, // minLines: 1,
onChanged: (_) {}, // onChanged: (_) {},
hasBorder: true, // hasBorder: true,
// validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , // // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null ,
), // ),
SizedBox( // SizedBox(
height: 10, // height: 10,
), // ),
AppTextFieldCustom( // AppTextFieldCustom(
hintText: // hintText:
TranslationBase.of(context).lastName, // TranslationBase.of(context).lastName,
controller: lastNameFileInfoController, // controller: lastNameFileInfoController,
maxLines: 1, // maxLines: 1,
minLines: 1, // minLines: 1,
onChanged: (_) {}, // onChanged: (_) {},
hasBorder: true, // hasBorder: true,
// validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , // // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null ,
), // ),
SizedBox( // SizedBox(
height: 10, // height: 10,
), // ),
], // ],
), // ),
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * 0.12, height: MediaQuery.of(context).size.height * 0.12,
), ),
@ -248,7 +252,7 @@ class _PatientSearchScreenNewState extends State<PatientSearchScreenNew> {
isFormSubmitted = true; isFormSubmitted = true;
}); });
PatientSearchRequestModel patientSearchRequestModel = PatientSearchRequestModel patientSearchRequestModel =
PatientSearchRequestModel(); PatientSearchRequestModel(doctorID: authProvider.doctorProfile.doctorID);
if (showOther) { if (showOther) {
patientSearchRequestModel.firstName = firstNameInfoController.text.trim().isEmpty?"0":firstNameInfoController.text.trim(); patientSearchRequestModel.firstName = firstNameInfoController.text.trim().isEmpty?"0":firstNameInfoController.text.trim();
patientSearchRequestModel.middleName = middleNameInfoController.text.trim().isEmpty?"0":middleNameInfoController.text.trim(); patientSearchRequestModel.middleName = middleNameInfoController.text.trim().isEmpty?"0":middleNameInfoController.text.trim();
@ -295,8 +299,9 @@ class _PatientSearchScreenNewState extends State<PatientSearchScreenNew> {
isSearchWithKeyInfo: isSearchWithKeyInfo:
patientFileInfoController.text.isNotEmpty ? true : false, patientFileInfoController.text.isNotEmpty ? true : false,
isSearch: true, isSearch: true,
isSearchAndOut:true,
searchKey: patientFileInfoController.text, searchKey: patientFileInfoController.text,
isInpatient: selectedPatientType == PatientType.OutPatient && patientFileInfoController.text.isEmpty?false: true, isInpatient: false,
), ),
), ),
); );

@ -5,7 +5,6 @@ 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/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_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/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
@ -14,6 +13,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/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/text_fields/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
@ -33,6 +33,7 @@ class PatientsScreenNew extends StatefulWidget {
final bool isSearchWithKeyInfo; final bool isSearchWithKeyInfo;
final bool isSearch; final bool isSearch;
final bool isInpatient; final bool isInpatient;
final bool isSearchAndOut;
final String searchKey; final String searchKey;
@ -46,7 +47,7 @@ class PatientsScreenNew extends StatefulWidget {
this.patientSearchRequestModel, this.patientSearchRequestModel,
this.isSearchWithKeyInfo = true, this.isSearchWithKeyInfo = true,
this.isSearch = false, this.isSearch = false,
this.isInpatient = false, this.searchKey}); this.isInpatient = false, this.searchKey, this.isSearchAndOut=false});
@override @override
_PatientsScreenNewState createState() => _PatientsScreenNewState(); _PatientsScreenNewState createState() => _PatientsScreenNewState();
@ -100,186 +101,157 @@ class _PatientsScreenNewState extends State<PatientsScreenNew> {
title: "Search for ${widget.searchKey}", title: "Search for ${widget.searchKey}",
), ),
baseViewModel: model, baseViewModel: model,
body: Container( body: Column(
color: Colors.grey[200], children: [
child: ListView( if(!widget.isInpatient && !widget.isSearch)
scrollDirection: Axis.vertical,
children: <Widget>[
Container( Container(
child: Column( // color: Colors.red,
children: <Widget>[ height: screenSize.height * 0.070,
if(!widget.isInpatient) decoration: TextFieldsUtils
Container( .containerBorderDecoration(
// color: Colors.red, Color(0Xffffffff),
height: screenSize.height * 0.070, Color(0xFFCCCCCC),
decoration: TextFieldsUtils borderRadius: 4,
.containerBorderDecoration( borderWidth: 0),
Color(0Xffffffff), child: Row(
Color(0xFFCCCCCC), mainAxisSize: MainAxisSize.max,
borderRadius: 4, crossAxisAlignment: CrossAxisAlignment.center,
borderWidth: 0), children: _locations.map((item) {
child: Row( bool _isActive = _locations[_activeLocation] == item
mainAxisSize: MainAxisSize.max, ? true
crossAxisAlignment: CrossAxisAlignment.center, : false;
children: _locations.map((item) {
bool _isActive = _locations[_activeLocation] == item
? true
: false;
return Expanded( return Expanded(
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
setState(() { setState(() {
_activeLocation = _locations.indexOf(item); _activeLocation = _locations.indexOf(item);
}); });
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.getPatientBasedOnDate(item: item, await model.getPatientBasedOnDate(item: item,
selectedPatientType: widget.selectedPatientType, selectedPatientType: widget.selectedPatientType,
patientSearchRequestModel: widget patientSearchRequestModel: widget
.patientSearchRequestModel, .patientSearchRequestModel,
isSearchWithKeyInfo: widget.isSearchWithKeyInfo); isSearchWithKeyInfo: widget.isSearchWithKeyInfo);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}, },
child: Center( child: Center(
child: Container( child: Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration( decoration: TextFieldsUtils.containerBorderDecoration(
_isActive _isActive
? Color(0xFFD02127 /*B8382B*/) ? Color(0xFFD02127 /*B8382B*/)
: Color(0xFFEAEAEA), : Color(0xFFEAEAEA),
_isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4, borderRadius: 4,
borderWidth: 0), borderWidth: 0),
child: Center( child: Center(
child: AppText( child: AppText(
item, item,
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
color: _isActive ? Colors.white : Color(0xFF2B353E), color: _isActive ? Colors.white : Color(0xFF2B353E),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
),
),
),
),
), ),
); ),
}).toList(), ),
), ),
), ),
);
}).toList(),
),
),
SizedBox(height: 18.5), SizedBox(height: 18.5),
Container( Container(
width: SizeConfig.screenWidth * 0.9, width: SizeConfig.screenWidth * 0.9,
height: 75, height: 75,
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"),
),
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,
),
SizedBox(
height: 10.0,
), ),
Container( color: Colors.white),
child: model.patientList.isNotEmpty child: Column(
? Column( crossAxisAlignment:
// mainAxisAlignment: MainAxisAlignment.center, CrossAxisAlignment.start,
children: model.filterData children: [
.map((PatiantInformtion Padding(
item) { padding: EdgeInsets.only(
return PatientCard( left: 10, top: 10),
patientInfo: item, child: AppText(
patientType: TranslationBase.of(
patientType, context)
arrivalType: .searchPatientName,
arrivalType, fontSize: 13,
isInpatient: )),
widget.isInpatient, AppTextFormField(
onTap: () { // focusNode: focusProject,
// TODO change the parameter to daynamic controller: _controller,
Navigator.of(context) borderColor: Colors.white,
.pushNamed( prefix: IconButton(
PATIENTS_PROFILE, icon: Icon(
arguments: { DoctorApp.filter_1,
"patient": item, color: Colors.black,
"patientType": ),
"1", iconSize: 20,
"from": widget.patientSearchRequestModel.from, padding:
"to": widget.patientSearchRequestModel.from, EdgeInsets.only(
"isSearch": bottom: 30),
widget.isSearch,
"isInpatient":
widget.isInpatient,
"arrivalType":
"7",
});
},
);
}).toList(),
)
: Center(
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.center,
children: [
SizedBox(
height: 100,
),
Image.asset(
'assets/images/no-data.png'),
Padding(
padding:
const EdgeInsets
.all(8.0),
child: AppText(
TranslationBase.of(
context)
.youDontHaveAnyPatient),
)
],
), ),
)), 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,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,
);
}
}

@ -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(),
); );

@ -44,7 +44,7 @@ class _LabsHomePageState extends State<LabsHomePage> {
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(
@ -114,87 +114,79 @@ class _LabsHomePageState extends State<LabsHomePage> {
), ),
...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 Container( ),
margin: EdgeInsets.all(10), borderRadius: BorderRadius.all(
decoration: BoxDecoration( Radius.circular(8.0),
border: Border.all( ),
width: 0.5, color: Colors.white),
color: Colors.white, child: Row(
), children: [
borderRadius: BorderRadius.all( Container(
Radius.circular(8.0), 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),
), ),
color: Colors.white), ),
child: Row( child: RotatedBox(
children: [ quarterTurns: 3,
Container( child: Center(
width: 20, child: Text(
height: 160, model.patientLabOrdersList[index].isLiveCareAppointment
decoration: BoxDecoration( ? TranslationBase.of(context)
//Colors.red[900] Color(0xff404545) .liveCare
color: labOrder.isLiveCareAppointment .toUpperCase()
? Colors.red[900] : !model.patientLabOrdersList[index].isInOutPatient
: !labOrder.isInOutPatient ? TranslationBase.of(context)
? Colors.black .inPatientLabel
: Color(0xffa9a089), .toUpperCase()
borderRadius: BorderRadius.only( : TranslationBase.of(context)
topLeft: Radius.circular(8), .outpatient
bottomLeft: Radius.circular(8), .toUpperCase(),
style: TextStyle(color: Colors.white),
), ),
), )),
child: RotatedBox( ),
quarterTurns: 3, Expanded(
child: Center( child: DoctorCard(
child: Text( isNoMargin: true,
labOrder.isLiveCareAppointment onTap: () => Navigator.push(
? TranslationBase.of(context) context,
.liveCare FadePage(
.toUpperCase() page: LaboratoryResultPage(
: !labOrder.isInOutPatient patientLabOrders: model.patientLabOrdersList[index],
? TranslationBase.of(context) patient: patient,
.inPatient arrivalType: arrivalType,
.toUpperCase() patientType: patientType,
: TranslationBase.of(context)
.outpatient
.toUpperCase(),
style: TextStyle(color: Colors.white),
),
)),
),
Expanded(
child: DoctorCard(
isNoMargin: true,
onTap: () => Navigator.push(
context,
FadePage(
page: LaboratoryResultPage(
patientLabOrders: labOrder,
patient: patient,
arrivalType: arrivalType,
patientType: patientType,
),
),
), ),
doctorName: labOrder.doctorName,
invoiceNO: ' ${labOrder.invoiceNo}',
profileUrl: labOrder.doctorImageURL,
branch: labOrder.projectName,
clinic: labOrder.clinicDescription,
appointmentDate: labOrder.orderDate,
orderNo: labOrder.orderNo,
isShowTime: false,
), ),
), ),
], 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,
),
), ),
); ],
}).toList(), ),
), ),
), ),
if (model.patientLabOrdersList.isEmpty && if (model.patientLabOrdersList.isEmpty &&

@ -79,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)

File diff suppressed because it is too large Load Diff

@ -47,7 +47,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
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,
@ -155,7 +155,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
.toUpperCase() .toUpperCase()
: !model.radiologyList[index].isInOutPatient : !model.radiologyList[index].isInOutPatient
? TranslationBase.of(context) ? TranslationBase.of(context)
.inPatient .inPatientLabel
.toUpperCase() .toUpperCase()
: TranslationBase.of(context) : TranslationBase.of(context)
.outpatient .outpatient
@ -172,9 +172,8 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
invoiceNO: '${model.radiologyList[index].invoiceNo}', invoiceNO: '${model.radiologyList[index].invoiceNo}',
branch: '${model.radiologyList[index].projectName}', branch: '${model.radiologyList[index].projectName}',
clinic: model.radiologyList[index].clinicDescription, clinic: model.radiologyList[index].clinicDescription,
appointmentDate: !isInpatient appointmentDate: model.radiologyList[index].orderDate??
? model.radiologyList[index].orderDate model.radiologyList[index].reportDate,
: model.radiologyList[index].reportDate,
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,

@ -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()});
},
),
),
],
), ),
], ],
), ),

@ -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,

@ -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,

@ -199,8 +199,11 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
// categoryName: procedureName.text); // categoryName: procedureName.text);
// }, // },
onClick: () { onClick: () {
if(procedureName.text.isNotEmpty && procedureName.text.length>=3)
model.getProcedureCategory( model.getProcedureCategory(
categoryName: procedureName.text); categoryName: procedureName.text);
else
DrAppToastMsg.showErrorToast('At least three Characters');
}, },
), ),
), ),
@ -209,8 +212,11 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
model.getProcedureCategory( if(procedureName.text.isNotEmpty && procedureName.text.length>=3)
categoryName: procedureName.text); model.getProcedureCategory(
categoryName: procedureName.text);
else
DrAppToastMsg.showErrorToast('At least three Characters');
}, },
child: Icon( child: Icon(
Icons.search, Icons.search,

@ -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(

@ -21,6 +21,7 @@ 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) => onModelReady: (model) =>
model.getSickLeavePatient(patient.patientMRN ?? patient.patientId), model.getSickLeavePatient(patient.patientMRN ?? patient.patientId),
@ -32,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: [

@ -290,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) {
@ -352,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,7 @@ 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 inPatientAll => localizedValues['inPatientAll'][locale.languageCode];

@ -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)
], ],
), ),
), ),

@ -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 (isInpatient) 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,47 +68,114 @@ class PatientCard extends StatelessWidget {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
!isInpatient !(isInpatient && !isFromSearch)
? 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.getDayMonthYearDateFormatted(DateUtils.convertStringToDate( DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.arrivedOn,)
patientInfo.arrivedOn, )+" "+ "${DateUtils.getStartTime(patientInfo.startTime)}",
)),
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(
@ -212,7 +292,7 @@ class PatientCard extends StatelessWidget {
), ),
), ),
), ),
if (isInpatient) //if (isInpatient)
Container( Container(
child: RichText( child: RichText(
text: new TextSpan( text: new TextSpan(
@ -276,99 +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,
// ),
//)
])) ]))
]), ]),
!isInpatient !isInpatient && !isFromSearch
? 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),
],
),
],
)
], ],
), ),
), ),

@ -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),

Loading…
Cancel
Save