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:io' show Platform;
import 'package:doctor_app_flutter/config/config.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/util/dr_app_shared_pref.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:http/http.dart' as http;
import 'dart:io' show Platform;
import '../UpdatePage.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Helpers helpers = new Helpers();
@ -70,6 +67,11 @@ class BaseAppClient {
await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
}
if (body['ProjectID'] != null &&
(body['ProjectID'] == 2 || body['ProjectID'] == 3)) {
body['PatientOutSA'] = true;
}
print("URL : $url");
print("Body : ${json.encode(body)}");
var asd = json.encode(body);
@ -145,11 +147,11 @@ class BaseAppClient {
: SETUP_ID;
}
body['VersionID'] = 6.3;
body['VersionID'] = 8.3;
body['Channel'] = CHANNEL;
body['LanguageID'] = languageID == 'ar' ? 1 : 2;
body['IPAdress'] = IP_ADDRESS;
body['IPAdress'] = "10.20.10.20";
body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null
@ -192,6 +194,11 @@ class BaseAppClient {
body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it
body['SessionID'] = SESSION_ID; //getSe
if (body['ProjectID'] != null &&
(body['ProjectID'] == 2 || body['ProjectID'] == 3)) {
body['PatientOutSA'] = true;
}
print("URL : $url");
print("Body : ${json.encode(body)}");

@ -48,6 +48,7 @@ const Map<String, Map<String, String>> localizedValues = {
'service': {'en': 'Service', 'ar': 'خدمة'},
'referral': {'en': 'Referral', 'ar': 'الإحالة'},
'inPatient': {'en': 'My InPatients', 'ar': 'المريض الداخلي'},
'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'},
'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى الداخليين'},
'operations': {'en': 'Operations', 'ar': 'عمليات'},
'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'},
@ -769,7 +770,7 @@ const Map<String, Map<String, String>> localizedValues = {
'arrived_p': {'en': "Arrived", 'ar': "وصل"},
'details': {'en': 'Details', 'ar': 'التفاصيل'},
"liveCare": {"en": "Live Care", "ar": "لايف كير"},
"out-patient": {"en": "Out Patient", "ar": "عيادات خارجية"},
"out-patient": {"en": "OutPatient", "ar": "عيادات خارجية"},
"BillNo": {"en": "Bill No :", "ar": "رقم الفاتورة"},
"labResults": {"en": "Lab Result", "ar": "نتيجة المختبر"},
"sendSuc": {

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

@ -11,7 +11,7 @@ class DischargedPatientService extends BaseService {
Future getDischargedPatient() async {
hasError = false;
Map<String, dynamic> body = Map();
await getDoctorProfile();
await getDoctorProfile(isGetProfile: true);
body['DoctorID'] = doctorProfile.doctorID;
body['FirstName'] = "0";
body['MiddleName'] = "0";

@ -15,7 +15,17 @@ class BaseService {
List<PatiantInformtion> patientArrivalList = [];
//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) {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) {

@ -25,7 +25,8 @@ class LabsService extends BaseService {
body['isDentalAllowedBackend'] = false;
url = GET_Patient_LAB_ORDERS;
}
patientLabOrdersList=[];
patientLabOrdersList.clear();
await baseAppClient.postPatient(url, patient: patient,
onSuccess: (dynamic response, int statusCode) {
patientLabOrdersList=[];
@ -33,6 +34,7 @@ class LabsService extends BaseService {
response['ListPLO'].forEach((hospital) {
patientLabOrdersList.add(PatientLabOrders.fromJson(hospital));
});
var asd="";
} else {
response['List_GetLabOreders'].forEach((hospital) {
patientLabOrdersList.add(PatientLabOrders.fromJson(hospital));

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

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

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

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

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

@ -43,16 +43,15 @@ class ProcedureViewModel extends BaseViewModel {
List<FinalRadiology> get radiologyList =>
_radiologyService.finalRadiologyList;
List<PatientLabOrders> get patientLabOrdersList => _labsService.patientLabOrdersList;
List<LabOrderResult> get labOrdersResultsList =>
_labsService.labOrdersResultsList;
List<PatientLabOrdersList> _patientLabOrdersListClinic = List();
List<PatientLabOrdersList> _patientLabOrdersListHospital = List();
List<PatientLabOrdersList> get patientLabOrdersList =>
filterType == FilterType.Clinic
? _patientLabOrdersListClinic
: _patientLabOrdersListHospital;
Future getProcedure({int mrn,String patientType}) async {
hasError = false;
@ -147,7 +146,7 @@ class ProcedureViewModel extends BaseViewModel {
if(patientType=="7")
setState(ViewState.ErrorLocal);
else
setState(ViewState.Error);
setState(ViewState.ErrorLocal);
} else {
_radiologyService.finalRadiologyList.forEach((element) {
List<FinalRadiologyList> finalRadiologyListClinic =
@ -222,6 +221,8 @@ class ProcedureViewModel extends BaseViewModel {
List<LabResultList> labResultLists = List();
List<LabResultList> get labResultListsCoustom {
return labResultLists;
}
@ -233,45 +234,6 @@ class ProcedureViewModel extends BaseViewModel {
error = _labsService.error;
setState(ViewState.Error);
} 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);
}
}

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

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

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

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

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

@ -27,6 +27,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
onModelReady: (model) => model.getDischargedPatient(),
builder: (_, model, w) => AppScaffold(
appBarTitle: 'Discharged Patient',
subtitle: "Last Three Months",
backgroundColor: Colors.grey[200],
isShowAppBar: true,
baseViewModel: model,
@ -309,7 +310,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
fontSize: 14,fontWeight: FontWeight.w300,
),
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,
fontWeight: FontWeight.w700),
],

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

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

@ -33,7 +33,7 @@ class _InsuranceApprovalScreenNewState
PatiantInformtion patient = routeArgs['patient'];
patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
bool isInpatient = routeArgs['isInpatient'];
return BaseView<InsuranceViewModel>(
onModelReady: patient.admissionNo != null
? (model) => model.getInsuranceInPatient(mrn: patient.patientId)
@ -45,7 +45,7 @@ class _InsuranceApprovalScreenNewState
builder: (BuildContext context, InsuranceViewModel model, Widget child) =>
AppScaffold(
appBar: PatientProfileHeaderNewDesignAppBar(
patient, patientType.toString() ?? "0", patientType),
patient, patientType.toString() ?? "0", patientType,isInpatient: isInpatient,),
isShowAppBar: true,
baseViewModel: model,
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/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_new.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
@ -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:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class PatientSearchScreenNew extends StatefulWidget {
@override
@ -26,9 +28,11 @@ class _PatientSearchScreenNewState extends State<PatientSearchScreenNew> {
TextEditingController middleNameInfoController = TextEditingController();
TextEditingController lastNameFileInfoController = TextEditingController();
PatientType selectedPatientType = PatientType.inPatient;
AuthViewModel authProvider;
@override
Widget build(BuildContext context) {
authProvider =Provider.of(context);
return BaseView<PatientSearchViewModel>(
onModelReady: (model) async {},
builder: (_, model, w) => AppScaffold(
@ -51,46 +55,46 @@ class _PatientSearchScreenNewState extends State<PatientSearchScreenNew> {
SizedBox(
height: 16,
),
AppText(
'Patient Type',
fontWeight: FontWeight.w600,
),
Row(
children: [
Row(
children: [
Radio(
activeColor: Color(0xFFB9382C),
value: PatientType.inPatient,
groupValue: selectedPatientType,
onChanged: (value) {
setState(() {
selectedPatientType =
PatientType.inPatient;
});
},
),
Text('InPatient'),
],
),
Row(
children: [
Radio(
activeColor: Color(0xFFB9382C),
value: PatientType.OutPatient,
groupValue: selectedPatientType,
onChanged: (value) {
setState(() {
selectedPatientType =
PatientType.OutPatient;
});
},
),
Text('OutPatient'),
],
),
],
),
// AppText(
// 'Patient Type',
// fontWeight: FontWeight.w600,
// ),
// Row(
// children: [
// Row(
// children: [
// Radio(
// activeColor: Color(0xFFB9382C),
// value: PatientType.inPatient,
// groupValue: selectedPatientType,
// onChanged: (value) {
// setState(() {
// selectedPatientType =
// PatientType.inPatient;
// });
// },
// ),
// Text('InPatient'),
// ],
// ),
// Row(
// children: [
// Radio(
// activeColor: Color(0xFFB9382C),
// value: PatientType.OutPatient,
// groupValue: selectedPatientType,
// onChanged: (value) {
// setState(() {
// selectedPatientType =
// PatientType.OutPatient;
// });
// },
// ),
// Text('OutPatient'),
// ],
// ),
// ],
// ),
SizedBox(
height: 10,
),
@ -121,78 +125,78 @@ class _PatientSearchScreenNewState extends State<PatientSearchScreenNew> {
SizedBox(
height: 5,
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
InkWell(
child: this.showOther == false
? AppText(
TranslationBase.of(context)
.searchWithOther,
color: Colors.red,
fontWeight: FontWeight.bold,
)
: AppText(
TranslationBase.of(context)
.hideOtherCriteria,
color: Colors.red,
fontWeight: FontWeight.bold),
onTap: () {
setState(() {
this.showOther = !this.showOther;
});
},
)
],
),
SizedBox(
height: 30,
),
if (showOther)
Column(
children: [
AppTextFieldCustom(
hintText:
TranslationBase.of(context).firstName,
controller: firstNameInfoController,
maxLines: 1,
minLines: 1,
hasBorder: true,
onChanged: (_) {},
// validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null ,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
hintText:
TranslationBase.of(context).middleName,
controller: middleNameInfoController,
maxLines: 1,
minLines: 1,
onChanged: (_) {},
hasBorder: true,
// validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null ,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
hintText:
TranslationBase.of(context).lastName,
controller: lastNameFileInfoController,
maxLines: 1,
minLines: 1,
onChanged: (_) {},
hasBorder: true,
// validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null ,
),
SizedBox(
height: 10,
),
],
),
// Row(
// mainAxisAlignment: MainAxisAlignment.end,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// InkWell(
// child: this.showOther == false
// ? AppText(
// TranslationBase.of(context)
// .searchWithOther,
// color: Colors.red,
// fontWeight: FontWeight.bold,
// )
// : AppText(
// TranslationBase.of(context)
// .hideOtherCriteria,
// color: Colors.red,
// fontWeight: FontWeight.bold),
// onTap: () {
// setState(() {
// this.showOther = !this.showOther;
// });
// },
// )
// ],
// ),
// SizedBox(
// height: 30,
// ),
// if (showOther)
// Column(
// children: [
// AppTextFieldCustom(
// hintText:
// TranslationBase.of(context).firstName,
// controller: firstNameInfoController,
// maxLines: 1,
// minLines: 1,
// hasBorder: true,
// onChanged: (_) {},
// // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null ,
// ),
// SizedBox(
// height: 10,
// ),
// AppTextFieldCustom(
// hintText:
// TranslationBase.of(context).middleName,
// controller: middleNameInfoController,
// maxLines: 1,
// minLines: 1,
// onChanged: (_) {},
// hasBorder: true,
// // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null ,
// ),
// SizedBox(
// height: 10,
// ),
// AppTextFieldCustom(
// hintText:
// TranslationBase.of(context).lastName,
// controller: lastNameFileInfoController,
// maxLines: 1,
// minLines: 1,
// onChanged: (_) {},
// hasBorder: true,
// // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null ,
// ),
// SizedBox(
// height: 10,
// ),
// ],
// ),
SizedBox(
height: MediaQuery.of(context).size.height * 0.12,
),
@ -248,7 +252,7 @@ class _PatientSearchScreenNewState extends State<PatientSearchScreenNew> {
isFormSubmitted = true;
});
PatientSearchRequestModel patientSearchRequestModel =
PatientSearchRequestModel();
PatientSearchRequestModel(doctorID: authProvider.doctorProfile.doctorID);
if (showOther) {
patientSearchRequestModel.firstName = firstNameInfoController.text.trim().isEmpty?"0":firstNameInfoController.text.trim();
patientSearchRequestModel.middleName = middleNameInfoController.text.trim().isEmpty?"0":middleNameInfoController.text.trim();
@ -295,8 +299,9 @@ class _PatientSearchScreenNewState extends State<PatientSearchScreenNew> {
isSearchWithKeyInfo:
patientFileInfoController.text.isNotEmpty ? true : false,
isSearch: true,
isSearchAndOut:true,
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/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/routes.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/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
@ -33,6 +33,7 @@ class PatientsScreenNew extends StatefulWidget {
final bool isSearchWithKeyInfo;
final bool isSearch;
final bool isInpatient;
final bool isSearchAndOut;
final String searchKey;
@ -46,7 +47,7 @@ class PatientsScreenNew extends StatefulWidget {
this.patientSearchRequestModel,
this.isSearchWithKeyInfo = true,
this.isSearch = false,
this.isInpatient = false, this.searchKey});
this.isInpatient = false, this.searchKey, this.isSearchAndOut=false});
@override
_PatientsScreenNewState createState() => _PatientsScreenNewState();
@ -100,186 +101,157 @@ class _PatientsScreenNewState extends State<PatientsScreenNew> {
title: "Search for ${widget.searchKey}",
),
baseViewModel: model,
body: Container(
color: Colors.grey[200],
child: ListView(
scrollDirection: Axis.vertical,
children: <Widget>[
body: Column(
children: [
if(!widget.isInpatient && !widget.isSearch)
Container(
child: Column(
children: <Widget>[
if(!widget.isInpatient)
Container(
// color: Colors.red,
height: screenSize.height * 0.070,
decoration: TextFieldsUtils
.containerBorderDecoration(
Color(0Xffffffff),
Color(0xFFCCCCCC),
borderRadius: 4,
borderWidth: 0),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _locations.map((item) {
bool _isActive = _locations[_activeLocation] == item
? true
: false;
// color: Colors.red,
height: screenSize.height * 0.070,
decoration: TextFieldsUtils
.containerBorderDecoration(
Color(0Xffffffff),
Color(0xFFCCCCCC),
borderRadius: 4,
borderWidth: 0),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _locations.map((item) {
bool _isActive = _locations[_activeLocation] == item
? true
: false;
return Expanded(
child: InkWell(
onTap: () async {
setState(() {
_activeLocation = _locations.indexOf(item);
});
GifLoaderDialogUtils.showMyDialog(context);
await model.getPatientBasedOnDate(item: item,
selectedPatientType: widget.selectedPatientType,
patientSearchRequestModel: widget
.patientSearchRequestModel,
isSearchWithKeyInfo: widget.isSearchWithKeyInfo);
GifLoaderDialogUtils.hideDialog(context);
},
child: Center(
child: Container(
height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
_isActive
? Color(0xFFD02127 /*B8382B*/)
: Color(0xFFEAEAEA),
_isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4,
borderWidth: 0),
child: Center(
child: AppText(
item,
fontSize: SizeConfig.textMultiplier * 1.8,
color: _isActive ? Colors.white : Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
),
),
),
return Expanded(
child: InkWell(
onTap: () async {
setState(() {
_activeLocation = _locations.indexOf(item);
});
GifLoaderDialogUtils.showMyDialog(context);
await model.getPatientBasedOnDate(item: item,
selectedPatientType: widget.selectedPatientType,
patientSearchRequestModel: widget
.patientSearchRequestModel,
isSearchWithKeyInfo: widget.isSearchWithKeyInfo);
GifLoaderDialogUtils.hideDialog(context);
},
child: Center(
child: Container(
height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
_isActive
? Color(0xFFD02127 /*B8382B*/)
: Color(0xFFEAEAEA),
_isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4,
borderWidth: 0),
child: Center(
child: AppText(
item,
fontSize: SizeConfig.textMultiplier * 1.8,
color: _isActive ? Colors.white : Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
);
}).toList(),
),
),
),
),
);
}).toList(),
),
),
SizedBox(height: 18.5),
Container(
width: SizeConfig.screenWidth * 0.9,
height: 75,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"),
),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(
left: 10, top: 10),
child: AppText(
TranslationBase.of(
context)
.searchPatientName,
fontSize: 13,
)),
AppTextFormField(
// focusNode: focusProject,
controller: _controller,
borderColor: Colors.white,
prefix: IconButton(
icon: Icon(
DoctorApp.filter_1,
color: Colors.black,
),
iconSize: 20,
padding:
EdgeInsets.only(
bottom: 30),
),
onChanged: (String str) {
model.searchData(str);
}),
])),
SizedBox(
height: 10.0,
),
SizedBox(
height: 10.0,
SizedBox(height: 18.5),
Container(
width: SizeConfig.screenWidth * 0.9,
height: 75,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"),
),
Container(
child: model.patientList.isNotEmpty
? Column(
// mainAxisAlignment: MainAxisAlignment.center,
children: model.filterData
.map((PatiantInformtion
item) {
return PatientCard(
patientInfo: item,
patientType:
patientType,
arrivalType:
arrivalType,
isInpatient:
widget.isInpatient,
onTap: () {
// TODO change the parameter to daynamic
Navigator.of(context)
.pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": item,
"patientType":
"1",
"from": widget.patientSearchRequestModel.from,
"to": widget.patientSearchRequestModel.from,
"isSearch":
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),
)
],
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(
left: 10, top: 10),
child: AppText(
TranslationBase.of(
context)
.searchPatientName,
fontSize: 13,
)),
AppTextFormField(
// focusNode: focusProject,
controller: _controller,
borderColor: Colors.white,
prefix: IconButton(
icon: Icon(
DoctorApp.filter_1,
color: Colors.black,
),
iconSize: 20,
padding:
EdgeInsets.only(
bottom: 30),
),
)),
],
),
)
],
),
onChanged: (String str) {
model.searchData(str);
}),
])),
SizedBox(
height: 10.0,
),
Expanded(
child: Container(
child: model.filterData.isEmpty
? Center(
child: ErrorMessage(
error: TranslationBase.of(context)
.youDontHaveAnyPatient,
),
)
: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.filterData.length,
itemBuilder: (BuildContext ctxt, int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: PatientCard(
patientInfo: model.filterData[index],
patientType: patientType,
arrivalType: arrivalType,
isFromSearch:widget.isSearchAndOut,
isInpatient: widget.isInpatient,
onTap: () {
// TODO change the parameter to daynamic
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": model.filterData[index],
"patientType": "1",
"from": widget
.patientSearchRequestModel.from,
"to": widget
.patientSearchRequestModel.from,
"isSearch": widget.isSearch,
"isInpatient": widget.isInpatient,
"arrivalType": "7",
"isSearchAndOut": widget.isSearchAndOut,
});
},
// isFromSearch: widget.isSearch,
),
);
})),
),
],
)
),
);

@ -0,0 +1,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,
maxX: (widget.labResult.length - 1).toDouble(),
maxY: getMaxY(),
maxY: getMaxY()+2,
minY: getMinY(),
lineBarsData: getData(),
);

@ -44,7 +44,7 @@ class _LabsHomePageState extends State<LabsHomePage> {
backgroundColor: Colors.grey[100],
isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(
patient, patient.patientType.toString() ?? '0', patientType),
patient, patient.patientType.toString() ?? '0', patientType,isInpatient: isInpatient,),
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: FractionallySizedBox(
@ -114,87 +114,79 @@ class _LabsHomePageState extends State<LabsHomePage> {
),
...List.generate(
model.patientLabOrdersList.length,
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: model
.patientLabOrdersList[index].patientLabOrdersList
.map((labOrder) {
return Container(
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
border: Border.all(
width: 0.5,
color: Colors.white,
),
borderRadius: BorderRadius.all(
Radius.circular(8.0),
(index) => Container(
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
border: Border.all(
width: 0.5,
color: Colors.white,
),
borderRadius: BorderRadius.all(
Radius.circular(8.0),
),
color: Colors.white),
child: Row(
children: [
Container(
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(
children: [
Container(
width: 20,
height: 160,
decoration: BoxDecoration(
//Colors.red[900] Color(0xff404545)
color: labOrder.isLiveCareAppointment
? Colors.red[900]
: !labOrder.isInOutPatient
? Colors.black
: Color(0xffa9a089),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
bottomLeft: Radius.circular(8),
),
child: RotatedBox(
quarterTurns: 3,
child: Center(
child: Text(
model.patientLabOrdersList[index].isLiveCareAppointment
? TranslationBase.of(context)
.liveCare
.toUpperCase()
: !model.patientLabOrdersList[index].isInOutPatient
? TranslationBase.of(context)
.inPatientLabel
.toUpperCase()
: TranslationBase.of(context)
.outpatient
.toUpperCase(),
style: TextStyle(color: Colors.white),
),
),
child: RotatedBox(
quarterTurns: 3,
child: Center(
child: Text(
labOrder.isLiveCareAppointment
? TranslationBase.of(context)
.liveCare
.toUpperCase()
: !labOrder.isInOutPatient
? TranslationBase.of(context)
.inPatient
.toUpperCase()
: 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,
),
),
)),
),
Expanded(
child: DoctorCard(
isNoMargin: true,
onTap: () => Navigator.push(
context,
FadePage(
page: LaboratoryResultPage(
patientLabOrders: model.patientLabOrdersList[index],
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 &&

@ -79,7 +79,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
// appBarTitle: TranslationBase.of(context).progressNote,
appBar: PatientProfileHeaderNewDesignAppBar(
patient, patient.patientType.toString() ?? '0', arrivalType),
patient, patient.patientType.toString() ?? '0', arrivalType,isInpatient: true,),
body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0
? DrAppEmbeddedError(
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],
// appBarTitle: TranslationBase.of(context).radiology,
appBar: PatientProfileHeaderNewDesignAppBar(
patient, patient.patientType.toString() ?? '0', arrivalType),
patient, patient.patientType.toString() ?? '0', arrivalType,isInpatient: isInpatient,),
baseViewModel: model,
body: FractionallySizedBox(
widthFactor: 1.0,
@ -155,7 +155,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
.toUpperCase()
: !model.radiologyList[index].isInOutPatient
? TranslationBase.of(context)
.inPatient
.inPatientLabel
.toUpperCase()
: TranslationBase.of(context)
.outpatient
@ -172,9 +172,8 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
invoiceNO: '${model.radiologyList[index].invoiceNo}',
branch: '${model.radiologyList[index].projectName}',
clinic: model.radiologyList[index].clinicDescription,
appointmentDate: !isInpatient
? model.radiologyList[index].orderDate
: model.radiologyList[index].reportDate,
appointmentDate: model.radiologyList[index].orderDate??
model.radiologyList[index].reportDate,
onTap: () {
Navigator.push(
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/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/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/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/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/speech-text-popup.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.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 {
@override
_PatientMakeInPatientReferralScreenState createState() =>
@ -41,6 +47,76 @@ class _PatientMakeInPatientReferralScreenState
String clinicError;
String doctorError;
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
Widget build(BuildContext context) {
@ -48,7 +124,7 @@ class _PatientMakeInPatientReferralScreenState
patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
bool isInpatient = routeArgs['isInpatient'];
referToList = List();
dynamic sameBranch = {
"id": 1,
@ -70,7 +146,7 @@ class _PatientMakeInPatientReferralScreenState
appBarTitle: TranslationBase.of(context).referPatient,
isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(
patient, patientType, arrivalType),
patient, patientType, arrivalType,isInpatient: isInpatient,),
body: SingleChildScrollView(
child: Container(
child: Column(
@ -387,13 +463,30 @@ class _PatientMakeInPatientReferralScreenState
SizedBox(
height: 10,
),
AppTextFieldCustom(
hintText:
TranslationBase.of(context).dietTypeRemarks,
controller: _remarksController,
inputType: TextInputType.multiline,
minLines: 4,
maxLines: 6,
Stack(
children: [
AppTextFieldCustom(
hintText:"Remarks",
controller: _remarksController,
inputType: TextInputType.multiline,
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(
color: Colors.white,
borderRadius: BorderRadius.all(
@ -462,55 +462,67 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
border: Border.all(
color: HexColor('#707070'),
width: 0),
), child: Padding(
padding: const EdgeInsets.all(12.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
width: MediaQuery.of(context).size.width * 0.4,
child: AppButton(
title: TranslationBase
.of(context)
.previous,
color: Colors.grey[300],
fontColor: Colors.black,
fontWeight: FontWeight.w600,
loading: model.state == ViewState.BusyLocal,
onPressed: () async {
widget.changePageViewIndex(1);
},
),
),
SizedBox(
width: MediaQuery.of(context).size.width * 0.05,
),
Container(
width: MediaQuery.of(context).size.width * 0.4,
child: AppButton(
title: TranslationBase
.of(context)
.next,
fontWeight: FontWeight.w600,
color: Colors.red[700],
loading: model.state == ViewState.BusyLocal,
onPressed: () async {
if (widget.mySelectedAssessmentList.isEmpty) {
Helpers.showErrorToast(
TranslationBase
.of(context)
.assessmentErrorMsg);
} else {
widget.changePageViewIndex(3);
widget.changeLoadingState(true);
}
},
),
height: 80,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(child:
FractionallySizedBox(
widthFactor: .80,
child: Center(
child: Row(
children: [
Expanded(
child: AppButton(
title: TranslationBase
.of(context)
.previous,
color: Colors.grey[300],
fontColor: Colors.black,
fontWeight: FontWeight.w600,
disabled: model.state == ViewState.BusyLocal,
onPressed: () async {
widget.changePageViewIndex(1);
},
)
,
),
SizedBox(width: 5,),
Expanded(
child: AppButton(
title: TranslationBase
.of(context)
.next,
fontWeight: FontWeight.w600,
color: Colors.red[700],
disabled: model.state == ViewState.BusyLocal,
onPressed: () async {
if (widget.mySelectedAssessmentList.isEmpty) {
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(
color: Colors.white,
borderRadius: BorderRadius.all(
@ -153,55 +154,56 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
color: HexColor('#707070'),
width: 0),
),
height: MediaQuery
.of(context)
.size
.height * 0.1,
height: 80,
width: double.infinity,
child: FractionallySizedBox(
widthFactor: 0.9,
child: Row(
children: [
Container(
width: MediaQuery.of(context).size.width *0.4,
child: AppButton(
title: TranslationBase.of(context).previous,
color: Colors.grey[300],
fontColor: Colors.black,
fontWeight: FontWeight.w600,
onPressed: () {
widget.changePageViewIndex(0);
},
),
),
SizedBox(
width: MediaQuery.of(context).size.width *0.1,
),
Container(
width: MediaQuery.of(context).size.width *0.4,
child: AppButton(
title: TranslationBase.of(context).next,
fontWeight: FontWeight.w600,
loading: model.state == ViewState.BusyLocal,
color: widget.mySelectedExamination != null &&
widget.mySelectedExamination.length > 0
? Colors.red[700]
: HexColor("#A5A5A5"),
fontColor: widget.mySelectedExamination != null &&
widget.mySelectedExamination.length > 0 ? Colors.white : HexColor("#5A5A5A"),
disabled: widget.mySelectedExamination != null &&
widget.mySelectedExamination.length > 0
? false
: true,
onPressed: () async {
await submitUpdateObjectivePage(model);
},
child: Column(
children: [
SizedBox(
height: 10,
),
Container(child:
FractionallySizedBox(
widthFactor: .80,
child: Center(
child: Row(
children: [
Expanded(
child: AppButton(
title: TranslationBase.of(context).previous,
color: Colors.grey[300],
fontColor: Colors.black,
fontWeight: FontWeight.w600,
onPressed: () {
widget.changePageViewIndex(0);
},
)
,
),
SizedBox(width: 5,),
Expanded(
child: AppButton(
title: TranslationBase
.of(context)
.next,
fontWeight: FontWeight.w600,
color: Colors.red[700],
disabled: model.state == ViewState.BusyLocal,
onPressed: () async {
await submitUpdateObjectivePage(model);
},
),
),
],
),
),
],
),
),
),
),),
SizedBox(
height: 5,
),
],
),)
),
);
}

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

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

@ -10,9 +10,10 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
final List<TimeSeriesSales2> timeSeries1;
final List<TimeSeriesSales2> timeSeries2;
final int indexes;
final bool isOX;
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<double> yAxixs = List();
@ -79,7 +80,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
color: Theme.of(context).primaryColor),
),
SizedBox(width: 5,),
AppText(TranslationBase.of(context).systolicLng)
AppText(isOX? "SAO2":TranslationBase.of(context).systolicLng)
],
),
SizedBox(width: 15,),
@ -93,7 +94,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
color: Colors.red),
),
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(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
crossAxisSpacing: 6,
mainAxisSpacing: 6,
crossAxisSpacing: 8,
mainAxisSpacing: 12,
crossAxisCount: 3,
children: [
InkWell(

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

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

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

@ -30,17 +30,17 @@ class ProcedureScreen extends StatelessWidget {
PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
bool isInpatient = routeArgs['isInpatient'];
return BaseView<ProcedureViewModel>(
onModelReady: (model) =>
model.getProcedure(mrn: patient.patientId, patientType: patientType),
model.getProcedure(mrn: patient.patientId, patientType: patientType,),
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: true,
backgroundColor: Colors.grey[100],
baseViewModel: model,
appBar: PatientProfileHeaderNewDesignAppBar(
patient, arrivalType ?? '0', patientType),
patient, arrivalType ?? '0', patientType,isInpatient: isInpatient,),
body: SingleChildScrollView(
child: Container(
child: Column(

@ -21,6 +21,7 @@ class AddSickLeavScreen extends StatelessWidget {
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient'];
bool isInpatient = routeArgs['isInpatient'];
return BaseView<SickLeaveViewModel>(
onModelReady: (model) =>
model.getSickLeavePatient(patient.patientMRN ?? patient.patientId),
@ -32,6 +33,7 @@ class AddSickLeavScreen extends StatelessWidget {
patient,
routeArgs['patientType'] ?? "0",
routeArgs['arrivalType'] ?? "0",
isInpatient: isInpatient,
),
body: SingleChildScrollView(
child: Column(children: [

@ -290,6 +290,15 @@ class DateUtils {
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
/// [dateTime] convert DateTime to data formatted
static String getHour(DateTime dateTime) {
@ -352,6 +361,18 @@ class DateUtils {
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) {
print(dateTime);
if (dateTime != null)

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

@ -100,6 +100,7 @@ class TranslationBase {
String get referral => localizedValues['referral'][locale.languageCode];
String get inPatient => localizedValues['inPatient'][locale.languageCode];
String get inPatientLabel => localizedValues['inPatientLabel'][locale.languageCode];
String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode];

@ -2,6 +2,8 @@ import 'dart:convert';
import 'dart:typed_data';
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 '../shared/app_texts_widget.dart';
@ -62,7 +64,8 @@ class _MedicineItemWidgetState extends State<MedicineItemWidget> {
padding: EdgeInsets.all(5),
child: Align(
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 arrivalType;
final bool isInpatient;
final bool isMyPatient;
final bool isFromSearch;
const PatientCard(
{Key key,
this.patientInfo,
this.onTap,
this.patientType,
this.arrivalType,
this.isInpatient})
this.isInpatient, this.isMyPatient = false, this.isFromSearch = false})
: super(key: key);
@override
Widget build(BuildContext context) {
@ -35,9 +38,9 @@ class PatientCard extends StatelessWidget {
color: Colors.white,
),
child: Stack(children: [
if (isInpatient)
if (!isInpatient&& !isMyPatient && !isFromSearch)
Container(
height: MediaQuery.of(context).size.height * .20,
height: 160,
width: 5,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
@ -47,6 +50,16 @@ class PatientCard extends StatelessWidget {
? Colors.green[500]
: 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(
padding: EdgeInsets.only(left: 10, right: 0, bottom: 0),
child: InkWell(
@ -55,47 +68,114 @@ class PatientCard extends StatelessWidget {
SizedBox(
height: 10,
),
!isInpatient
!(isInpatient && !isFromSearch)
? Padding(
padding: EdgeInsets.only(left: 12.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
patientInfo.patientStatusType == 43
? AppText(
TranslationBase.of(context).arrivedP,
color: Colors.green,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
)
: AppText(
TranslationBase.of(context).notArrived,
color: Colors.red[800],
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
),
? Row(
children: [
AppText(
TranslationBase.of(context).arrivedP,
color: Colors.green,
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,
),
],
)
: 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'
? AppText(
patientInfo.startTime != null
? patientInfo.startTime
: patientInfo.startTimes,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w400,
)
: patientInfo.arrivedOn != null
? AppText(
DateUtils.getDayMonthYearDateFormatted(DateUtils.convertStringToDate(
patientInfo.arrivedOn,
)),
DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.arrivedOn,)
)+" "+ "${DateUtils.getStartTime(patientInfo.startTime)}",
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(),
if(isInpatient && isMyPatient && !isFromSearch)
Row(
children: [
SizedBox(width: 12,),
AppText(
'My Patient',
color: Colors.green,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
),
],
),
Padding(
padding: EdgeInsets.only(left: 12.0),
child: Row(
@ -212,7 +292,7 @@ class PatientCard extends StatelessWidget {
),
),
),
if (isInpatient)
//if (isInpatient)
Container(
child: RichText(
text: new TextSpan(
@ -276,99 +356,10 @@ class PatientCard extends StatelessWidget {
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(
mainAxisAlignment: MainAxisAlignment.end,
children: [

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

@ -17,9 +17,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
final String patientType;
final String arrivalType;
final double height;
final bool isInpatient;
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
Widget build(BuildContext context) {
@ -38,7 +39,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
decoration: BoxDecoration(
color: Colors.white,
),
height: height == 0 ? 200 : height,
height: height == 0 ? isInpatient? 215:200 : height,
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50),
@ -59,7 +60,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
" " +
Helpers.capitalize(patient.lastName))
: Helpers.capitalize(patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier * 2.2,
fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),
@ -254,7 +255,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).age??'' + " : ",
text: TranslationBase.of(context).age+ " : ",
style: TextStyle(fontSize: 14)),
new TextSpan(
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 Color backgroundColor;
final Widget appBar;
final String subtitle;
final bool isHomeIcon;
AppScaffold(
{this.appBarTitle = '',
@ -29,7 +30,7 @@ class AppScaffold extends StatelessWidget {
this.bottomSheet,
this.backgroundColor,
this.isHomeIcon = true,
this.appBar});
this.appBar, this.subtitle});
@override
Widget build(BuildContext context) {
@ -51,7 +52,14 @@ class AppScaffold extends StatelessWidget {
color: Colors.black87,
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) {
return IconButton(
icon: Icon(Icons.arrow_back_ios),

Loading…
Cancel
Save