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

 Conflicts:
	pubspec.lock
merge-requests/839/head
hussam al-habibeh 5 years ago
commit 7be6ef6ed6

@ -42,6 +42,7 @@ const Map<String, Map<String, String>> localizedValues = {
"referral": {"en": "Referral", "ar": "الإحالة"}, "referral": {"en": "Referral", "ar": "الإحالة"},
"inPatient": {"en": "InPatients", "ar": "مرضاي"}, "inPatient": {"en": "InPatients", "ar": "مرضاي"},
"myInPatient": {"en": "My\nInPatients", "ar": "مرضاي\nالمنومين"}, "myInPatient": {"en": "My\nInPatients", "ar": "مرضاي\nالمنومين"},
"myInPatientTitle": {"en": "My InPatients", "ar": "مرضاي المنومين"},
"inPatientLabel": {"en": "InPatients", "ar": "المريض المنوم"}, "inPatientLabel": {"en": "InPatients", "ar": "المريض المنوم"},
"inPatientAll": {"en": "All InPatients", "ar": "جميع المرضى المنومين"}, "inPatientAll": {"en": "All InPatients", "ar": "جميع المرضى المنومين"},
"operations": {"en": "Operations", "ar": "عمليات"}, "operations": {"en": "Operations", "ar": "عمليات"},
@ -702,11 +703,11 @@ const Map<String, Map<String, String>> localizedValues = {
"patientArrived": {"en": "Patient Arrived", "ar": "وصل المريض"}, "patientArrived": {"en": "Patient Arrived", "ar": "وصل المريض"},
"calledAndNoResponse": {"en": "Called And No Response", "ar": "تم الاتصال ولا يوجد رد"}, "calledAndNoResponse": {"en": "Called And No Response", "ar": "تم الاتصال ولا يوجد رد"},
"underProcess": {"en": "Under Process", "ar": "تحت التجهيز"}, "underProcess": {"en": "Under Process", "ar": "تحت التجهيز"},
"textResponse": {"en": "Text Response", "ar": "استجابة النص" "textResponse": {"en": "Text Response", "ar": "استجابة النص"},
} "notReplied": {"en": "Not Replied", "ar": "لم يتم يرد"},
,
"requestType":{ "requestType":{
"en":"Request Type", "en":"Request Type",
"ar":"نوع الطلب"}, "ar":"نوع الطلب"},
"special": {"en": "Special", "ar": "خاص"} "special": {"en": "Special", "ar": "خاص"},
"allClinic": {"en": "All Clinics", "ar": "جميع العيادات"}
}; };

@ -30,6 +30,11 @@ class GetMedicationForInPatientModel {
dynamic strength; dynamic strength;
String pHRItemDescription; String pHRItemDescription;
String pHRItemDescriptionN; String pHRItemDescriptionN;
String doctorName;
String uomDescription;
String routeDescription;
String directionDescription;
String refillDescription;
GetMedicationForInPatientModel( GetMedicationForInPatientModel(
{this.setupID, {this.setupID,
@ -62,11 +67,22 @@ class GetMedicationForInPatientModel {
this.editedOn, this.editedOn,
this.strength, this.strength,
this.pHRItemDescription, this.pHRItemDescription,
this.pHRItemDescriptionN}); this.pHRItemDescriptionN,
this.doctorName,
this.uomDescription,
this.routeDescription,
this.directionDescription,
this.refillDescription});
GetMedicationForInPatientModel.fromJson(Map<String, dynamic> json) { GetMedicationForInPatientModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID']; setupID = json['SetupID'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
doctorName = json['DoctorName'];
refillDescription = json['RefillDescription'];
directionDescription = json['DirectionDescription'];
routeDescription = json['RouteDescription'];
uomDescription = json['UOMDescription'];
admissionNo = json['AdmissionNo']; admissionNo = json['AdmissionNo'];
patientID = json['PatientID']; patientID = json['PatientID'];
orderNo = json['OrderNo']; orderNo = json['OrderNo'];
@ -101,6 +117,11 @@ class GetMedicationForInPatientModel {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID; data['SetupID'] = this.setupID;
data['DoctorName'] = this.doctorName;
data['RefillDescription'] = this.refillDescription;
data['RouteDescription'] = this.routeDescription;
data['DirectionDescription'] = this.directionDescription;
data['UOMDescription'] = this.uomDescription;
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;
data['AdmissionNo'] = this.admissionNo; data['AdmissionNo'] = this.admissionNo;
data['PatientID'] = this.patientID; data['PatientID'] = this.patientID;

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

@ -8,39 +8,56 @@ import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patien
import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart'; import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart';
class DoctorReplyService extends BaseService { class DoctorReplyService extends BaseService {
List<ListGtMyPatientsQuestions> get listDoctorWorkingHoursTable =>
List<ListGtMyPatientsQuestions> get listDoctorWorkingHoursTable => _listDoctorWorkingHoursTable; _listDoctorWorkingHoursTable;
List<ListGtMyPatientsQuestions> get listDoctorNotRepliedQuestions =>
_listDoctorNotRepliedQuestions;
List<ListGtMyPatientsQuestions> _listDoctorWorkingHoursTable = []; List<ListGtMyPatientsQuestions> _listDoctorWorkingHoursTable = [];
List<ListGtMyPatientsQuestions> _listDoctorNotRepliedQuestions = [];
List<MyReferralPatientModel> _listMyReferralPatientModel = []; List<MyReferralPatientModel> _listMyReferralPatientModel = [];
List<MyReferralPatientModel> get listMyReferralPatientModel => _listMyReferralPatientModel;
List<MyReferralPatientModel> get listMyReferralPatientModel =>
_listMyReferralPatientModel;
int notRepliedCount = 0; int notRepliedCount = 0;
Future getDoctorReply(RequestDoctorReply _requestDoctorReply,{bool clearData = false}) async { Future getDoctorReply(RequestDoctorReply _requestDoctorReply,
{bool clearData = false, bool isGettingNotReply = false}) async {
hasError = false; hasError = false;
await baseAppClient.post(GT_MY_PATIENT_QUESTION, await baseAppClient.post(
onSuccess: (dynamic response, int statusCode) { GT_MY_PATIENT_QUESTION,
if(clearData) onSuccess: (dynamic response, int statusCode) {
if (clearData) {
if(isGettingNotReply)
_listDoctorNotRepliedQuestions.clear();
else
_listDoctorWorkingHoursTable.clear(); _listDoctorWorkingHoursTable.clear();
response['List_GtMyPatientsQuestions'].forEach((v) { }
_listDoctorWorkingHoursTable
.add(ListGtMyPatientsQuestions.fromJson(v));
}); response['List_GtMyPatientsQuestions'].forEach((v) {
}, onFailure: (String error, int statusCode) {
hasError = true; if(isGettingNotReply)
super.error = error; _listDoctorNotRepliedQuestions.add(ListGtMyPatientsQuestions.fromJson(v));
}, body: _requestDoctorReply.toJson(),); else
_listDoctorWorkingHoursTable
.add(ListGtMyPatientsQuestions.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _requestDoctorReply.toJson(),
);
} }
Future createDoctorResponse( Future createDoctorResponse(
CreateDoctorResponseModel createDoctorResponseModel) async { CreateDoctorResponseModel createDoctorResponseModel) async {
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
CREATE_DOCTOR_RESPONSE, CREATE_DOCTOR_RESPONSE,
body: createDoctorResponseModel.toJson(), body: createDoctorResponseModel.toJson(),
onSuccess: (dynamic body, int statusCode) { onSuccess: (dynamic body, int statusCode) {},
},
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -48,14 +65,12 @@ class DoctorReplyService extends BaseService {
); );
} }
Future getNotRepliedCount() async { Future getNotRepliedCount() async {
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
GET_DOCTOR_NOT_REPLIED_COUNTS, GET_DOCTOR_NOT_REPLIED_COUNTS,
body: {}, body: {},
onSuccess: (dynamic body onSuccess: (dynamic body, int statusCode) {
, int statusCode) {
notRepliedCount = body["DoctorNotRepliedCounts"]; notRepliedCount = body["DoctorNotRepliedCounts"];
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {

@ -194,7 +194,7 @@ class PrescriptionsService extends BaseService {
isDentalAllowedBackend: false, isDentalAllowedBackend: false,
admissionNo: int.parse(patient.admissionNo), admissionNo: int.parse(patient.admissionNo),
tokenID: "@dm!n", tokenID: "@dm!n",
projectID: 15, projectID: patient.projectId,
); );
await baseAppClient.postPatient(GET_MEDICATION_FOR_IN_PATIENT, patient: patient, await baseAppClient.postPatient(GET_MEDICATION_FOR_IN_PATIENT, patient: patient,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {

@ -28,16 +28,12 @@ class ProcedureService extends BaseService {
List<ProcedureTempleteDetailsModel> templateList = List(); List<ProcedureTempleteDetailsModel> templateList = List();
List<ProcedureTempleteDetailsModel> _templateDetailsList = List(); List<ProcedureTempleteDetailsModel> _templateDetailsList = List();
List<ProcedureTempleteDetailsModel> get templateDetailsList => List<ProcedureTempleteDetailsModel> get templateDetailsList => _templateDetailsList;
_templateDetailsList;
GetOrderedProcedureRequestModel _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel();
GetOrderedProcedureRequestModel();
ProcedureTempleteRequestModel _procedureTempleteRequestModel = ProcedureTempleteRequestModel _procedureTempleteRequestModel = ProcedureTempleteRequestModel();
ProcedureTempleteRequestModel(); ProcedureTempleteDetailsRequestModel _procedureTempleteDetailsRequestModel = ProcedureTempleteDetailsRequestModel();
ProcedureTempleteDetailsRequestModel _procedureTempleteDetailsRequestModel =
ProcedureTempleteDetailsRequestModel();
GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel( GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel(
// clinicId: 17, // clinicId: 17,
@ -63,8 +59,7 @@ class ProcedureService extends BaseService {
//search: ["DENTAL"], //search: ["DENTAL"],
); );
Future getProcedureTemplate( Future getProcedureTemplate({int doctorId, int projectId, int clinicId, String categoryID}) async {
{int doctorId, int projectId, int clinicId, String categoryID}) async {
_procedureTempleteRequestModel = ProcedureTempleteRequestModel( _procedureTempleteRequestModel = ProcedureTempleteRequestModel(
// tokenID: "@dm!n", // tokenID: "@dm!n",
patientID: 0, patientID: 0,
@ -72,19 +67,18 @@ class ProcedureService extends BaseService {
); );
hasError = false; hasError = false;
await baseAppClient.post(GET_TEMPLETE_LIST/*GET_PROCEDURE_TEMPLETE*/, await baseAppClient.post(GET_TEMPLETE_LIST /*GET_PROCEDURE_TEMPLETE*/,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
templateList.clear(); templateList.clear();
response['DAPP_TemplateGetList'].forEach((template) { response['DAPP_TemplateGetList'].forEach((template) {
ProcedureTempleteDetailsModel templateElement = ProcedureTempleteDetailsModel.fromJson(template); ProcedureTempleteDetailsModel templateElement = ProcedureTempleteDetailsModel.fromJson(template);
if(categoryID != null){ if (categoryID != null) {
if(categoryID == templateElement.categoryID){ if (categoryID == templateElement.categoryID) {
templateList.add(templateElement); templateList.add(templateElement);
} }
} else { } else {
templateList.add(templateElement); templateList.add(templateElement);
} }
}); });
// response['HIS_ProcedureTemplateList'].forEach((template) { // response['HIS_ProcedureTemplateList'].forEach((template) {
// _templateList.add(ProcedureTempleteModel.fromJson(template)); // _templateList.add(ProcedureTempleteModel.fromJson(template));
@ -95,21 +89,17 @@ class ProcedureService extends BaseService {
}, body: _procedureTempleteRequestModel.toJson()); }, body: _procedureTempleteRequestModel.toJson());
} }
Future getProcedureTemplateDetails( Future getProcedureTemplateDetails({int doctorId, int projectId, int clinicId, int templateId}) async {
{int doctorId, int projectId, int clinicId, int templateId}) async {
_procedureTempleteDetailsRequestModel = _procedureTempleteDetailsRequestModel =
ProcedureTempleteDetailsRequestModel( ProcedureTempleteDetailsRequestModel(templateID: templateId, searchType: 1, patientID: 0);
templateID: templateId, searchType: 1, patientID: 0);
hasError = false; hasError = false;
//insuranceApprovalInPatient.clear(); //insuranceApprovalInPatient.clear();
_templateDetailsList.clear(); _templateDetailsList.clear();
await baseAppClient.post(GET_PROCEDURE_TEMPLETE_DETAILS, await baseAppClient.post(GET_PROCEDURE_TEMPLETE_DETAILS, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
//prescriptionsList.clear(); //prescriptionsList.clear();
response['HIS_ProcedureTemplateDetailsList'].forEach((template) { response['HIS_ProcedureTemplateDetailsList'].forEach((template) {
_templateDetailsList _templateDetailsList.add(ProcedureTempleteDetailsModel.fromJson(template));
.add(ProcedureTempleteDetailsModel.fromJson(template));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -117,15 +107,14 @@ class ProcedureService extends BaseService {
}, body: _procedureTempleteDetailsRequestModel.toJson()); }, body: _procedureTempleteDetailsRequestModel.toJson());
} }
Future getProcedure({int mrn}) async { Future getProcedure({int mrn, int appointmentNo}) async {
_getOrderedProcedureRequestModel = _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel(
GetOrderedProcedureRequestModel(patientMRN: mrn); patientMRN: mrn,
);
hasError = false; hasError = false;
_procedureList.clear(); _procedureList.clear();
await baseAppClient.post(GET_PROCEDURE_LIST, await baseAppClient.post(GET_PROCEDURE_LIST, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { _procedureList.add(GetOrderedProcedureModel.fromJson(response['OrderedProcedureList']));
_procedureList.add(
GetOrderedProcedureModel.fromJson(response['OrderedProcedureList']));
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -135,8 +124,7 @@ class ProcedureService extends BaseService {
Future getCategory() async { Future getCategory() async {
hasError = false; hasError = false;
await baseAppClient.post(GET_LIST_CATEGORISE, await baseAppClient.post(GET_LIST_CATEGORISE, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
categoryList = []; categoryList = [];
categoryList = response['listProcedureCategories']['entityList']; categoryList = response['listProcedureCategories']['entityList'];
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -145,7 +133,7 @@ class ProcedureService extends BaseService {
}, body: Map()); }, body: Map());
} }
Future getProcedureCategory({String categoryName, String categoryID,patientId}) async { Future getProcedureCategory({String categoryName, String categoryID, patientId}) async {
_getProcedureCategoriseReqModel = GetProcedureReqModel( _getProcedureCategoriseReqModel = GetProcedureReqModel(
search: ["$categoryName"], search: ["$categoryName"],
patientMRN: patientId, patientMRN: patientId,
@ -156,10 +144,8 @@ class ProcedureService extends BaseService {
); );
hasError = false; hasError = false;
_categoriesList.clear(); _categoriesList.clear();
await baseAppClient.post(GET_CATEGORISE_PROCEDURE, await baseAppClient.post(GET_CATEGORISE_PROCEDURE, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { _categoriesList.add(CategoriseProcedureModel.fromJson(response['ProcedureList']));
_categoriesList
.add(CategoriseProcedureModel.fromJson(response['ProcedureList']));
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -169,8 +155,7 @@ class ProcedureService extends BaseService {
Future postProcedure(PostProcedureReqModel postProcedureReqModel) async { Future postProcedure(PostProcedureReqModel postProcedureReqModel) async {
hasError = false; hasError = false;
_procedureList.clear(); _procedureList.clear();
await baseAppClient.post(POST_PROCEDURE_LIST, await baseAppClient.post(POST_PROCEDURE_LIST, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -178,12 +163,10 @@ class ProcedureService extends BaseService {
}, body: postProcedureReqModel.toJson()); }, body: postProcedureReqModel.toJson());
} }
Future updateProcedure( Future updateProcedure(UpdateProcedureRequestModel updateProcedureRequestModel) async {
UpdateProcedureRequestModel updateProcedureRequestModel) async {
hasError = false; hasError = false;
_procedureList.clear(); _procedureList.clear();
await baseAppClient.post(UPDATE_PROCEDURE, await baseAppClient.post(UPDATE_PROCEDURE, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
print("ACCEPTED"); print("ACCEPTED");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -191,14 +174,11 @@ class ProcedureService extends BaseService {
}, body: updateProcedureRequestModel.toJson()); }, body: updateProcedureRequestModel.toJson());
} }
Future valadteProcedure( Future valadteProcedure(ProcedureValadteRequestModel procedureValadteRequestModel) async {
ProcedureValadteRequestModel procedureValadteRequestModel) async {
hasError = false; hasError = false;
_valadteProcedureList.clear(); _valadteProcedureList.clear();
await baseAppClient.post(GET_PROCEDURE_VALIDATION, await baseAppClient.post(GET_PROCEDURE_VALIDATION, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { _valadteProcedureList.add(ProcedureValadteModel.fromJson(response['ValidateProcedureList']));
_valadteProcedureList.add(
ProcedureValadteModel.fromJson(response['ValidateProcedureList']));
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -85,7 +85,7 @@ class SOAPService extends LookupService {
print("Success"); print("Success");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = super.error+ "\n"+error;
}, body: postAllergyRequestModel.toJson()); }, body: postAllergyRequestModel.toJson());
} }
@ -97,13 +97,14 @@ class SOAPService extends LookupService {
print("Success"); print("Success");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error =super.error + "\n"+error;
}, body: postHistoriesRequestModel.toJson()); }, body: postHistoriesRequestModel.toJson());
} }
Future postChiefComplaint( Future postChiefComplaint(
PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { PostChiefComplaintRequestModel postChiefComplaintRequestModel) async {
hasError = false; hasError = false;
super.error ="";
await baseAppClient.post(POST_CHIEF_COMPLAINT, await baseAppClient.post(POST_CHIEF_COMPLAINT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
@ -157,7 +158,7 @@ class SOAPService extends LookupService {
print("Success"); print("Success");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = "\n"+error;
}, body: patchAllergyRequestModel.toJson()); }, body: patchAllergyRequestModel.toJson());
} }
@ -169,13 +170,14 @@ class SOAPService extends LookupService {
print("Success"); print("Success");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = super.error +"\n"+error;
}, body: patchHistoriesRequestModel.toJson()); }, body: patchHistoriesRequestModel.toJson());
} }
Future patchChiefComplaint( Future patchChiefComplaint(
PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async { PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async {
hasError = false; hasError = false;
super.error ="";
await baseAppClient.post(PATCH_CHIEF_COMPLAINT, await baseAppClient.post(PATCH_CHIEF_COMPLAINT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");

@ -14,26 +14,39 @@ import 'base_view_model.dart';
class PatientSearchViewModel extends BaseViewModel { class PatientSearchViewModel extends BaseViewModel {
OutPatientService _outPatientService = locator<OutPatientService>(); OutPatientService _outPatientService = locator<OutPatientService>();
SpecialClinicsService _specialClinicsService = locator<SpecialClinicsService>(); SpecialClinicsService _specialClinicsService =
locator<SpecialClinicsService>();
List<PatiantInformtion> get patientList => _outPatientService.patientList; List<PatiantInformtion> get patientList => _outPatientService.patientList;
List<GetSpecialClinicalCareMappingListResponseModel> get specialClinicalCareMappingList =>
_specialClinicsService.specialClinicalCareMappingList; List<GetSpecialClinicalCareMappingListResponseModel>
get specialClinicalCareMappingList =>
_specialClinicsService.specialClinicalCareMappingList;
List<PatiantInformtion> filterData = []; List<PatiantInformtion> filterData = [];
DateTime selectedFromDate; DateTime selectedFromDate;
DateTime selectedToDate; DateTime selectedToDate;
int firstSubsetIndex = 0;
int inPatientPageSize = 20;
int lastSubsetIndex = 20;
List<String> InpatientClinicList = [];
searchData(String str) { searchData(String str) {
var strExist = str.length > 0 ? true : false; var strExist = str.length > 0 ? true : false;
if (strExist) { if (strExist) {
filterData = []; filterData = [];
for (var i = 0; i < _outPatientService.patientList.length; i++) { for (var i = 0; i < _outPatientService.patientList.length; i++) {
String firstName = _outPatientService.patientList[i].firstName.toUpperCase(); String firstName =
String lastName = _outPatientService.patientList[i].lastName.toUpperCase(); _outPatientService.patientList[i].firstName.toUpperCase();
String mobile = _outPatientService.patientList[i].mobileNumber.toUpperCase(); String lastName =
String patientID = _outPatientService.patientList[i].patientId.toString(); _outPatientService.patientList[i].lastName.toUpperCase();
String mobile =
_outPatientService.patientList[i].mobileNumber.toUpperCase();
String patientID =
_outPatientService.patientList[i].patientId.toString();
if (firstName.contains(str.toUpperCase()) || if (firstName.contains(str.toUpperCase()) ||
lastName.contains(str.toUpperCase()) || lastName.contains(str.toUpperCase()) ||
@ -49,7 +62,8 @@ class PatientSearchViewModel extends BaseViewModel {
} }
} }
getOutPatient(PatientSearchRequestModel patientSearchRequestModel, {bool isLocalBusy = false}) async { getOutPatient(PatientSearchRequestModel patientSearchRequestModel,
{bool isLocalBusy = false}) async {
if (isLocalBusy) { if (isLocalBusy) {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
} else { } else {
@ -74,16 +88,16 @@ class PatientSearchViewModel extends BaseViewModel {
sortOutPatient({bool isDes = false}) { sortOutPatient({bool isDes = false}) {
if (isDes) if (isDes)
filterData = filterData.reversed.toList(); filterData = filterData.reversed.toList();
// filterData.sort((PatiantInformtion a, PatiantInformtion b)=>b.appointmentDateWithDateTimeForm.compareTo(a.appointmentDateWithDateTimeForm));
else else
filterData = filterData.reversed.toList(); filterData = filterData.reversed.toList();
// filterData.sort((PatiantInformtion a, PatiantInformtion b)=>a.appointmentDateWithDateTimeForm.compareTo(b.appointmentDateWithDateTimeForm));
setState(ViewState.Idle); setState(ViewState.Idle);
} }
getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, {bool isLocalBusy = false}) async { getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel,
{bool isLocalBusy = false}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _outPatientService.getPatientFileInformation(patientSearchRequestModel); await _outPatientService
.getPatientFileInformation(patientSearchRequestModel);
if (_outPatientService.hasError) { if (_outPatientService.hasError) {
error = _outPatientService.error; error = _outPatientService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -102,21 +116,32 @@ class PatientSearchViewModel extends BaseViewModel {
String dateTo; String dateTo;
String dateFrom; String dateFrom;
if (OutPatientFilterType.Previous == outPatientFilterType) { if (OutPatientFilterType.Previous == outPatientFilterType) {
selectedFromDate = DateTime(DateTime.now().year, DateTime.now().month - 1, DateTime.now().day); selectedFromDate = DateTime(
selectedToDate = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); DateTime.now().year, DateTime.now().month - 1, DateTime.now().day);
selectedToDate = DateTime(
DateTime.now().year, DateTime.now().month, DateTime.now().day - 1);
dateTo = AppDateUtils.convertDateToFormat(selectedToDate, 'yyyy-MM-dd'); dateTo = AppDateUtils.convertDateToFormat(selectedToDate, 'yyyy-MM-dd');
dateFrom = AppDateUtils.convertDateToFormat(selectedFromDate, 'yyyy-MM-dd'); dateFrom =
AppDateUtils.convertDateToFormat(selectedFromDate, 'yyyy-MM-dd');
} else if (OutPatientFilterType.NextWeek == outPatientFilterType) { } else if (OutPatientFilterType.NextWeek == outPatientFilterType) {
dateTo = AppDateUtils.convertDateToFormat( dateTo = AppDateUtils.convertDateToFormat(
DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 6), 'yyyy-MM-dd'); DateTime(DateTime.now().year, DateTime.now().month,
DateTime.now().day + 6),
'yyyy-MM-dd');
dateFrom = AppDateUtils.convertDateToFormat( dateFrom = AppDateUtils.convertDateToFormat(
DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 1), 'yyyy-MM-dd'); DateTime(DateTime.now().year, DateTime.now().month,
DateTime.now().day + 1),
'yyyy-MM-dd');
} else { } else {
dateFrom = AppDateUtils.convertDateToFormat( dateFrom = AppDateUtils.convertDateToFormat(
DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd'); DateTime(
DateTime.now().year, DateTime.now().month, DateTime.now().day),
'yyyy-MM-dd');
dateTo = AppDateUtils.convertDateToFormat( dateTo = AppDateUtils.convertDateToFormat(
DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd'); DateTime(
DateTime.now().year, DateTime.now().month, DateTime.now().day),
'yyyy-MM-dd');
} }
PatientSearchRequestModel currentModel = PatientSearchRequestModel(); PatientSearchRequestModel currentModel = PatientSearchRequestModel();
currentModel.patientID = patientSearchRequestModel.patientID; currentModel.patientID = patientSearchRequestModel.patientID;
@ -130,13 +155,16 @@ class PatientSearchViewModel extends BaseViewModel {
filterData = _outPatientService.patientList; filterData = _outPatientService.patientList;
} }
PatientInPatientService _inPatientService = locator<PatientInPatientService>(); PatientInPatientService _inPatientService =
locator<PatientInPatientService>();
List<PatiantInformtion> get inPatientList => _inPatientService.inPatientList; List<PatiantInformtion> get inPatientList => _inPatientService.inPatientList;
List<PatiantInformtion> get myIinPatientList => _inPatientService.myInPatientList; List<PatiantInformtion> get myIinPatientList =>
_inPatientService.myInPatientList;
List<PatiantInformtion> filteredInPatientItems = List(); List<PatiantInformtion> filteredInPatientItems = List();
List<PatiantInformtion> filteredMyInPatientItems = List();
Future getInPatientList(PatientSearchRequestModel requestModel, Future getInPatientList(PatientSearchRequestModel requestModel,
{bool isMyInpatient = false, bool isLocalBusy = false}) async { {bool isMyInpatient = false, bool isLocalBusy = false}) async {
@ -146,7 +174,8 @@ class PatientSearchViewModel extends BaseViewModel {
} else { } else {
setState(ViewState.Busy); setState(ViewState.Busy);
} }
if (inPatientList.length == 0) await _inPatientService.getInPatientList(requestModel, false); if (inPatientList.length == 0)
await _inPatientService.getInPatientList(requestModel, false);
if (_inPatientService.hasError) { if (_inPatientService.hasError) {
error = _inPatientService.error; error = _inPatientService.error;
if (isLocalBusy) { if (isLocalBusy) {
@ -156,59 +185,215 @@ class PatientSearchViewModel extends BaseViewModel {
} }
} else { } else {
setDefaultInPatientList(); setDefaultInPatientList();
generateInpatientClinicList();
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
sortInPatient({bool isDes = false}) { sortInPatient({bool isDes = false, bool isAllClinic, bool isMyInPatient}) {
if (isDes) if (isMyInPatient
filteredInPatientItems.sort((PatiantInformtion a, PatiantInformtion b) => ? myIinPatientList.length > 0
b.admissionDateWithDateTimeForm.compareTo(a.admissionDateWithDateTimeForm)); : isAllClinic
else ? inPatientList.length > 0
filteredInPatientItems.sort((PatiantInformtion a, PatiantInformtion b) => : filteredInPatientItems.length > 0) {
a.admissionDateWithDateTimeForm.compareTo(b.admissionDateWithDateTimeForm)); List<PatiantInformtion> localInPatient = isMyInPatient
? [...filteredMyInPatientItems]
: isAllClinic
? [...inPatientList]
: [...filteredInPatientItems];
if (isDes)
localInPatient.sort((PatiantInformtion a, PatiantInformtion b) => b
.admissionDateWithDateTimeForm
.compareTo(a.admissionDateWithDateTimeForm));
else
localInPatient.sort((PatiantInformtion a, PatiantInformtion b) => a
.admissionDateWithDateTimeForm
.compareTo(b.admissionDateWithDateTimeForm));
if (isMyInPatient) {
filteredMyInPatientItems.clear();
filteredMyInPatientItems.addAll(localInPatient);
} else if (isAllClinic) {
resetInPatientPagination();
filteredInPatientItems
.addAll(localInPatient.sublist(firstSubsetIndex, lastSubsetIndex));
} else {
filteredInPatientItems.clear();
filteredInPatientItems.addAll(localInPatient);
}
}
setState(ViewState.Idle); setState(ViewState.Idle);
} }
resetInPatientPagination() {
filteredInPatientItems.clear();
firstSubsetIndex = 0;
lastSubsetIndex = inPatientPageSize - 1;
}
Future setDefaultInPatientList() async { Future setDefaultInPatientList() async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await getDoctorProfile(); await getDoctorProfile();
filteredInPatientItems.clear(); resetInPatientPagination();
if (inPatientList.length > 0) filteredInPatientItems.addAll(inPatientList); if (inPatientList.length > 0)
filteredInPatientItems
.addAll(inPatientList.sublist(firstSubsetIndex, lastSubsetIndex));
if (myIinPatientList.length > 0) {
filteredMyInPatientItems.addAll(myIinPatientList);
}
setState(ViewState.Idle); setState(ViewState.Idle);
} }
generateInpatientClinicList() {
inPatientList.forEach((element) {
if (!InpatientClinicList.contains(element.clinicDescription)) {
InpatientClinicList.add(element.clinicDescription);
}
});
}
addOnFilteredList() {
if (lastSubsetIndex < inPatientList.length) {
firstSubsetIndex = firstSubsetIndex +
(inPatientList.length - lastSubsetIndex < inPatientPageSize - 1
? inPatientList.length - lastSubsetIndex
: inPatientPageSize - 1);
lastSubsetIndex = lastSubsetIndex +
(inPatientList.length - lastSubsetIndex < inPatientPageSize - 1
? inPatientList.length - lastSubsetIndex
: inPatientPageSize - 1);
filteredInPatientItems
.addAll(inPatientList.sublist(firstSubsetIndex, lastSubsetIndex));
setState(ViewState.Idle);
}
}
removeOnFilteredList() {
if (lastSubsetIndex - inPatientPageSize - 1 > 0) {
filteredInPatientItems.removeAt(lastSubsetIndex - inPatientPageSize - 1);
setState(ViewState.Idle);
}
}
filterByHospital({int hospitalId}) {
filteredInPatientItems = [];
for (var i = 0; i < inPatientList.length; i++) {
if (inPatientList[i].projectId == hospitalId) {
filteredInPatientItems.add(inPatientList[i]);
}
}
notifyListeners();
}
filterByClinic({String clinicName}) {
filteredInPatientItems = [];
for (var i = 0; i < inPatientList.length; i++) {
if (inPatientList[i].clinicDescription == clinicName) {
filteredInPatientItems.add(inPatientList[i]);
}
}
notifyListeners();
}
void clearPatientList() { void clearPatientList() {
_inPatientService.inPatientList = []; _inPatientService.inPatientList = [];
_inPatientService.myInPatientList = []; _inPatientService.myInPatientList = [];
} }
void filterSearchResults(String query) { void filterSearchResults(String query,
{bool isAllClinic, bool isMyInPatient}) {
var strExist = query.length > 0 ? true : false; var strExist = query.length > 0 ? true : false;
if (strExist) {
filteredInPatientItems = []; if (isMyInPatient) {
for (var i = 0; i < inPatientList.length; i++) { List<PatiantInformtion> localFilteredMyInPatientItems = [
String firstName = inPatientList[i].firstName.toUpperCase(); ...myIinPatientList
String lastName = inPatientList[i].lastName.toUpperCase(); ];
String mobile = inPatientList[i].mobileNumber.toUpperCase();
String patientID = inPatientList[i].patientId.toString(); if (strExist) {
filteredMyInPatientItems.clear();
if (firstName.contains(query.toUpperCase()) || for (var i = 0; i < localFilteredMyInPatientItems.length; i++) {
lastName.contains(query.toUpperCase()) || String firstName =
mobile.contains(query) || localFilteredMyInPatientItems[i].firstName.toUpperCase();
patientID.contains(query)) { String lastName =
filteredInPatientItems.add(inPatientList[i]); localFilteredMyInPatientItems[i].lastName.toUpperCase();
String mobile =
localFilteredMyInPatientItems[i].mobileNumber.toUpperCase();
String patientID =
localFilteredMyInPatientItems[i].patientId.toString();
if (firstName.contains(query.toUpperCase()) ||
lastName.contains(query.toUpperCase()) ||
mobile.contains(query) ||
patientID.contains(query)) {
filteredMyInPatientItems.add(localFilteredMyInPatientItems[i]);
}
} }
notifyListeners();
} else {
if (myIinPatientList.length > 0) filteredMyInPatientItems.clear();
filteredMyInPatientItems.addAll(myIinPatientList);
notifyListeners();
} }
notifyListeners();
} else { } else {
if (inPatientList.length > 0) filteredInPatientItems.clear(); if (isAllClinic) {
filteredInPatientItems.addAll(inPatientList); if (strExist) {
notifyListeners(); filteredInPatientItems = [];
for (var i = 0; i < inPatientList.length; i++) {
String firstName = inPatientList[i].firstName.toUpperCase();
String lastName = inPatientList[i].lastName.toUpperCase();
String mobile = inPatientList[i].mobileNumber.toUpperCase();
String patientID = inPatientList[i].patientId.toString();
if (firstName.contains(query.toUpperCase()) ||
lastName.contains(query.toUpperCase()) ||
mobile.contains(query) ||
patientID.contains(query)) {
filteredInPatientItems.add(inPatientList[i]);
}
}
notifyListeners();
} else {
if (inPatientList.length > 0) filteredInPatientItems.clear();
filteredInPatientItems.addAll(inPatientList);
notifyListeners();
}
} else {
List<PatiantInformtion> localFilteredInPatientItems = [
...filteredInPatientItems
];
if (strExist) {
filteredInPatientItems.clear();
for (var i = 0; i < localFilteredInPatientItems.length; i++) {
String firstName =
localFilteredInPatientItems[i].firstName.toUpperCase();
String lastName =
localFilteredInPatientItems[i].lastName.toUpperCase();
String mobile =
localFilteredInPatientItems[i].mobileNumber.toUpperCase();
String patientID =
localFilteredInPatientItems[i].patientId.toString();
if (firstName.contains(query.toUpperCase()) ||
lastName.contains(query.toUpperCase()) ||
mobile.contains(query) ||
patientID.contains(query)) {
filteredInPatientItems.add(localFilteredInPatientItems[i]);
}
}
notifyListeners();
} else {
if (localFilteredInPatientItems.length > 0)
filteredInPatientItems.clear();
filteredInPatientItems.addAll(localFilteredInPatientItems);
notifyListeners();
}
}
} }
} }
getSpecialClinicalCareMappingList(clinicId, {bool isLocalBusy = false}) async { getSpecialClinicalCareMappingList(clinicId,
{bool isLocalBusy = false}) async {
if (isLocalBusy) { if (isLocalBusy) {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
} else { } else {

@ -28,7 +28,9 @@ import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_mode
import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart';
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.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/patients/profile/soap_update/assessment/assessment_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/assessment/assessment_call_back.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/objective/objective_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/objective/objective_call_back.dart';
@ -199,38 +201,6 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postAllergy(postAllergyRequestModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future postHistories(
PostHistoriesRequestModel postHistoriesRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postHistories(postHistoriesRequestModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future postChiefComplaint(
PostChiefComplaintRequestModel postChiefComplaintRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postChiefComplaint(postChiefComplaintRequestModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future postPhysicalExam( Future postPhysicalExam(
PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { PostPhysicalExamRequestModel postPhysicalExamRequestModel) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
@ -264,38 +234,6 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future patchAllergy(PostAllergyRequestModel patchAllergyRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.patchAllergy(patchAllergyRequestModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future patchHistories(
PostHistoriesRequestModel patchHistoriesRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.patchHistories(patchHistoriesRequestModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future patchChiefComplaint(
PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.patchChiefComplaint(patchChiefComplaintRequestModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future patchPhysicalExam( Future patchPhysicalExam(
PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async { PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
@ -361,28 +299,6 @@ class SOAPViewModel extends BaseViewModel {
return allergiesString; return allergiesString;
} }
Future getPatientHistories(GetHistoryReqModel getHistoryReqModel,
{bool isFirst = false}) async {
setState(ViewState.Busy);
await _SOAPService.getPatientHistories(getHistoryReqModel,
isFirst: isFirst);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getPatientChiefComplaint(
GetChiefComplaintReqModel getChiefComplaintReqModel) async {
setState(ViewState.Busy);
await _SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getPatientPhysicalExam( Future getPatientPhysicalExam(
PatiantInformtion patientInfo, PatiantInformtion patientInfo,
@ -742,20 +658,16 @@ class SOAPViewModel extends BaseViewModel {
} }
} }
if (allMedicationList.length == 0) { if (allMedicationList.length == 0) {
await getMedicationList();
if (services == null) { if (services == null) {
services = [ services = [_prescriptionService.getMedicationList()];
_prescriptionService.getMedicationList()
];
} else { } else {
services.add( services.add(_prescriptionService.getMedicationList());
_prescriptionService.getMedicationList());
} }
} }
final results = await Future.wait(services ?? []); final results = await Future.wait(services ?? []);
if (_SOAPService.hasError ||_prescriptionService.hasError ) { if (_SOAPService.hasError || _prescriptionService.hasError) {
error = _SOAPService.error + _prescriptionService.error; error = _SOAPService.error + _prescriptionService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else
@ -763,8 +675,7 @@ class SOAPViewModel extends BaseViewModel {
} }
callAddAssessmentLookupsServices({bool allowSetState = true}) async { callAddAssessmentLookupsServices({bool allowSetState = true}) async {
if(allowSetState) if (allowSetState) setState(ViewState.Busy);
setState(ViewState.Busy);
var services; var services;
if (listOfDiagnosisCondition.length == 0) { if (listOfDiagnosisCondition.length == 0) {
if (services == null) { if (services == null) {
@ -782,59 +693,177 @@ class SOAPViewModel extends BaseViewModel {
_SOAPService.getMasterLookup(MasterKeysService.DiagnosisType) _SOAPService.getMasterLookup(MasterKeysService.DiagnosisType)
]; ];
} else { } else {
services.add(_SOAPService.getMasterLookup( services
MasterKeysService.DiagnosisType)); .add(_SOAPService.getMasterLookup(MasterKeysService.DiagnosisType));
} }
} }
if (listOfICD10.length == 0) { if (listOfICD10.length == 0) {
if (services == null) { if (services == null) {
services = [ services = [_SOAPService.getMasterLookup(MasterKeysService.ICD10)];
_SOAPService.getMasterLookup(MasterKeysService.ICD10)
];
} else { } else {
services.add( services.add(_SOAPService.getMasterLookup(MasterKeysService.ICD10));
_SOAPService.getMasterLookup(MasterKeysService.ICD10));
} }
} }
final results = await Future.wait(services ?? []); final results = await Future.wait(services ?? []);
if(allowSetState) { if (allowSetState) {
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
error = _SOAPService.error; error = _SOAPService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
onUpdateAssessmentStepStart(PatiantInformtion patientInfo) async { onUpdateAssessmentStepStart(PatiantInformtion patientInfo) async {
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(
patientMRN: patientInfo.patientMRN, patientMRN: patientInfo.patientMRN,
episodeID: patientInfo.episodeNo.toString(), episodeID: patientInfo.episodeNo.toString(),
editedBy: '', editedBy: '',
doctorID: '', doctorID: '',
appointmentNo: appointmentNo: int.parse(patientInfo.appointmentNo.toString()));
int.parse(patientInfo.appointmentNo.toString()));
var services = [ var services = [_SOAPService.getPatientAssessment(getAssessmentReqModel)];
_SOAPService.getPatientAssessment(getAssessmentReqModel)
];
final results = await Future.wait(services); final results = await Future.wait(services);
if (patientAssessmentList.isNotEmpty) { if (patientAssessmentList.isNotEmpty) {
await callAddAssessmentLookupsServices(allowSetState: false); await callAddAssessmentLookupsServices(allowSetState: false);
} }
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
error = _SOAPService.error; error = _SOAPService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
postSubjectServices(
{patientInfo,
String complaintsText,
String medicationText,
String illnessText,
List<MySelectedHistory> myHistoryList,
List<MySelectedAllergy> myAllergiesList}) async {
var services;
PostChiefComplaintRequestModel postChiefComplaintRequestModel =
createPostChiefComplaintRequestModel(
patientInfo: patientInfo,
illnessText: illnessText,
medicationText: medicationText,
complaintsText: complaintsText);
if (patientChiefComplaintList.isEmpty) {
postChiefComplaintRequestModel.editedBy = '';
services = [
_SOAPService.postChiefComplaint(postChiefComplaintRequestModel)
];
} else {
postChiefComplaintRequestModel.editedBy = '';
services = [
_SOAPService.patchChiefComplaint(postChiefComplaintRequestModel)
];
}
if (myHistoryList.length != 0) {
PostHistoriesRequestModel postHistoriesRequestModel =
createPostHistoriesRequestModel(
patientInfo: patientInfo, myHistoryList: myHistoryList);
if (patientHistoryList.isEmpty) {
services.add(_SOAPService.postHistories(postHistoriesRequestModel));
} else {
services.add(_SOAPService.patchHistories(postHistoriesRequestModel));
}
}
if (myAllergiesList.length != 0) {
PostAllergyRequestModel postAllergyRequestModel =createPostAllergyRequestModel (myAllergiesList:myAllergiesList, patientInfo: patientInfo);
if (patientAllergiesList.isEmpty) {
services.add(_SOAPService.postAllergy(postAllergyRequestModel));
} else {
services.add(_SOAPService.patchAllergy(postAllergyRequestModel));
}
}
final results = await Future.wait(services);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
}
PostChiefComplaintRequestModel createPostChiefComplaintRequestModel(
{patientInfo,
String complaintsText,
String medicationText,
String illnessText}) {
return new PostChiefComplaintRequestModel(
admissionNo: patientInfo.admissionNo != null
? int.parse(patientInfo.admissionNo)
: null,
patientMRN: patientInfo.patientMRN,
episodeID: patientInfo.episodeNo ?? 0,
appointmentNo: patientInfo.appointmentNo ?? 0,
chiefComplaint: complaintsText,
currentMedication: medicationText,
hopi: illnessText,
isLactation: false,
ispregnant: false,
doctorID: '',
numberOfWeeks: 0);
}
PostHistoriesRequestModel createPostHistoriesRequestModel(
{patientInfo, List<MySelectedHistory> myHistoryList}) {
PostHistoriesRequestModel postHistoriesRequestModel =
new PostHistoriesRequestModel(doctorID: '');
myHistoryList.forEach((history) {
if (postHistoriesRequestModel.listMedicalHistoryVM == null)
postHistoriesRequestModel.listMedicalHistoryVM = [];
postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM(
patientMRN: patientInfo.patientMRN,
episodeId: patientInfo.episodeNo,
appointmentNo: patientInfo.appointmentNo,
remarks: "",
historyId: history.selectedHistory.id,
historyType: history.selectedHistory.typeId,
isChecked: history.isChecked,
));
});
return postHistoriesRequestModel;
}
PostAllergyRequestModel createPostAllergyRequestModel({myAllergiesList, patientInfo}){
PostAllergyRequestModel postAllergyRequestModel =
new PostAllergyRequestModel();
myAllergiesList.forEach((allergy) {
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM ==
null)
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(
ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.typeId,
patientMRN: patientInfo.patientMRN,
episodeId: patientInfo.episodeNo,
appointmentNo: patientInfo.appointmentNo,
severity: allergy.selectedAllergySeverity.id,
remarks: allergy.remark,
createdBy: allergy.createdBy ?? doctorProfile.doctorID,
createdOn: DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
isChecked: allergy.isChecked,
isUpdatedByNurse: false));
});
return postAllergyRequestModel;
} }
} }

@ -253,7 +253,7 @@ class AuthenticationViewModel extends BaseViewModel {
/// add  token to shared preferences in case of send activation code is success /// add  token to shared preferences in case of send activation code is success
setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel)async { setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel)async {
// print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode);
await sharedPref.setString(VIDA_AUTH_TOKEN_ID, await sharedPref.setString(VIDA_AUTH_TOKEN_ID,
sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID);
await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, await sharedPref.setString(VIDA_REFRESH_TOKEN_ID,

@ -12,9 +12,14 @@ class DoctorReplayViewModel extends BaseViewModel {
List<ListGtMyPatientsQuestions> get listDoctorWorkingHoursTable => List<ListGtMyPatientsQuestions> get listDoctorWorkingHoursTable =>
_doctorReplyService.listDoctorWorkingHoursTable; _doctorReplyService.listDoctorWorkingHoursTable;
List<ListGtMyPatientsQuestions> get listDoctorNotRepliedQuestions =>
_doctorReplyService.listDoctorNotRepliedQuestions;
Future getDoctorReply( Future getDoctorReply(
{int pageSize = 10, int pageIndex = 1, bool isLocalBusy = true}) async { {int pageSize = 10,
int pageIndex = 1,
bool isLocalBusy = true,
bool isGettingNotReply = false}) async {
if (isLocalBusy) { if (isLocalBusy) {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
} else { } else {
@ -23,8 +28,11 @@ class DoctorReplayViewModel extends BaseViewModel {
await getDoctorProfile(); await getDoctorProfile();
RequestDoctorReply _requestDoctorReply = RequestDoctorReply _requestDoctorReply =
RequestDoctorReply(pageIndex: pageIndex, pageSize: pageSize); RequestDoctorReply(pageIndex: pageIndex, pageSize: pageSize);
if (isGettingNotReply)
_requestDoctorReply.infoStatus = 99; //to get the not replied only
await _doctorReplyService.getDoctorReply(_requestDoctorReply, clearData:!isLocalBusy ); await _doctorReplyService.getDoctorReply(_requestDoctorReply,
clearData: !isLocalBusy, isGettingNotReply: isGettingNotReply);
if (_doctorReplyService.hasError) { if (_doctorReplyService.hasError) {
error = _doctorReplyService.error; error = _doctorReplyService.error;
if (isLocalBusy) { if (isLocalBusy) {

@ -36,6 +36,8 @@ class UcafViewModel extends BaseViewModel {
List<OrderProcedure> get orderProcedures => _ucafService.orderProcedureList; List<OrderProcedure> get orderProcedures => _ucafService.orderProcedureList;
Function saveUCAFOnTap;
String selectedLanguage; String selectedLanguage;
String heightCm = "0"; String heightCm = "0";
String weightKg = "0"; String weightKg = "0";
@ -45,7 +47,11 @@ class UcafViewModel extends BaseViewModel {
String respirationBeatPerMinute = "0"; String respirationBeatPerMinute = "0";
String bloodPressure = "0 / 0"; String bloodPressure = "0 / 0";
resetDataInFirst() { resetDataInFirst({bool firstPage = true}) {
if(firstPage){
_ucafService.patientVitalSignsHistory = [];
_ucafService.patientChiefComplaintList = [];
}
_ucafService.patientAssessmentList = []; _ucafService.patientAssessmentList = [];
_ucafService.orderProcedureList = []; _ucafService.orderProcedureList = [];
_ucafService.prescriptionList = null; _ucafService.prescriptionList = null;
@ -56,7 +62,7 @@ class UcafViewModel extends BaseViewModel {
} }
Future getUCAFData(PatiantInformtion patient) async { Future getUCAFData(PatiantInformtion patient) async {
setState(ViewState.Busy); // setState(ViewState.Busy);
String from; String from;
String to; String to;
@ -112,7 +118,7 @@ class UcafViewModel extends BaseViewModel {
Future getPatientAssessment(PatiantInformtion patient) async { Future getPatientAssessment(PatiantInformtion patient) async {
if (patientAssessmentList.isEmpty) { if (patientAssessmentList.isEmpty) {
setState(ViewState.Busy); // setState(ViewState.Busy);
await _ucafService.getPatientAssessment(patient); await _ucafService.getPatientAssessment(patient);
if (_ucafService.hasError) { if (_ucafService.hasError) {
error = _ucafService.error; error = _ucafService.error;
@ -139,7 +145,7 @@ class UcafViewModel extends BaseViewModel {
Future getOrderProcedures(PatiantInformtion patient) async { Future getOrderProcedures(PatiantInformtion patient) async {
if (orderProcedures.isEmpty) { if (orderProcedures.isEmpty) {
setState(ViewState.Busy); // setState(ViewState.Busy);
await _ucafService.getOrderProcedures(patient); await _ucafService.getOrderProcedures(patient);
if (_ucafService.hasError) { if (_ucafService.hasError) {
error = _ucafService.error; error = _ucafService.error;
@ -152,7 +158,7 @@ class UcafViewModel extends BaseViewModel {
Future getPrescription(PatiantInformtion patient) async { Future getPrescription(PatiantInformtion patient) async {
if (prescriptionList == null) { if (prescriptionList == null) {
setState(ViewState.Busy); // setState(ViewState.Busy);
await _ucafService.getPrescription(patient); await _ucafService.getPrescription(patient);
if (_ucafService.hasError) { if (_ucafService.hasError) {
error = _ucafService.error; error = _ucafService.error;
@ -190,7 +196,7 @@ class UcafViewModel extends BaseViewModel {
} }
Future postUCAF(PatiantInformtion patient) async { Future postUCAF(PatiantInformtion patient) async {
setState(ViewState.Busy); // setState(ViewState.Busy);
await _ucafService.postUCAF(patient); await _ucafService.postUCAF(patient);
if (_ucafService.hasError) { if (_ucafService.hasError) {
error = _ucafService.error; error = _ucafService.error;

@ -23,8 +23,7 @@ import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' as cpe;
as cpe;
class ProcedureViewModel extends BaseViewModel { class ProcedureViewModel extends BaseViewModel {
//TODO Hussam clean it //TODO Hussam clean it
@ -61,13 +60,13 @@ class ProcedureViewModel extends BaseViewModel {
List<PatientLabOrdersList> _patientLabOrdersListClinic = List(); List<PatientLabOrdersList> _patientLabOrdersListClinic = List();
List<PatientLabOrdersList> _patientLabOrdersListHospital = List(); List<PatientLabOrdersList> _patientLabOrdersListHospital = List();
Future getProcedure({int mrn, String patientType}) async { Future getProcedure({int mrn, String patientType, int appointmentNo}) async {
hasError = false; hasError = false;
await getDoctorProfile(); await getDoctorProfile();
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.getProcedure(mrn: mrn); await _procedureService.getProcedure(mrn: mrn, appointmentNo: appointmentNo);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
if (patientType == "7") if (patientType == "7")
@ -78,15 +77,12 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getProcedureCategory( Future getProcedureCategory({String categoryName, String categoryID, patientId}) async {
{String categoryName, String categoryID, patientId}) async {
if (categoryName == null) return; if (categoryName == null) return;
hasError = false; hasError = false;
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.getProcedureCategory( await _procedureService.getProcedureCategory(
categoryName: categoryName, categoryName: categoryName, categoryID: categoryID, patientId: patientId);
categoryID: categoryID,
patientId: patientId);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -321,8 +317,7 @@ class ProcedureViewModel extends BaseViewModel {
List<cpe.EntityList> entityList, List<cpe.EntityList> entityList,
ProcedureType procedureType}) async { ProcedureType procedureType}) async {
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
ProcedureValadteRequestModel procedureValadteRequestModel = ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel();
new ProcedureValadteRequestModel();
procedureValadteRequestModel.patientMRN = patient.patientMRN; procedureValadteRequestModel.patientMRN = patient.patientMRN;
procedureValadteRequestModel.episodeID = patient.episodeNo; procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo; procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
@ -337,21 +332,13 @@ class ProcedureViewModel extends BaseViewModel {
procedureValadteRequestModel.procedure = [element.procedureId]; procedureValadteRequestModel.procedure = [element.procedureId];
List<Controls> controls = List(); List<Controls> controls = List();
controls.add( controls.add(
Controls( Controls(code: "remarks", controlValue: element.remarks != null ? element.remarks : ""),
code: "remarks",
controlValue: element.remarks != null ? element.remarks : ""),
); );
controls.add( controls.add(
Controls( Controls(code: "ordertype", controlValue: procedureType == ProcedureType.PROCEDURE ? element.type ?? "1" : "0"),
code: "ordertype",
controlValue: procedureType == ProcedureType.PROCEDURE
? element.type ?? "1"
: "0"),
); );
controlsProcedure.add(Procedures( controlsProcedure
category: element.categoryID, .add(Procedures(category: element.categoryID, procedure: element.procedureId, controls: controls));
procedure: element.procedureId,
controls: controls));
}); });
postProcedureReqModel.procedures = controlsProcedure; postProcedureReqModel.procedures = controlsProcedure;
@ -371,8 +358,7 @@ class ProcedureViewModel extends BaseViewModel {
Helpers.showErrorToast(error); Helpers.showErrorToast(error);
getProcedure(mrn: patient.patientMRN); getProcedure(mrn: patient.patientMRN);
} else if (state == ViewState.Idle) { } else if (state == ViewState.Idle) {
Helpers.showErrorToast( Helpers.showErrorToast(valadteProcedureList[0].entityList[0].warringMessages);
valadteProcedureList[0].entityList[0].warringMessages);
} }
} }
} else { } else {

@ -1,4 +1,4 @@
import 'package:doctor_app_flutter/screens/doctor/doctor_reply_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/my_schedule_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/my_schedule_screen.dart';
import 'package:doctor_app_flutter/screens/home/home_screen.dart'; import 'package:doctor_app_flutter/screens/home/home_screen.dart';
import 'package:doctor_app_flutter/screens/qr_reader/QR_reader_screen.dart'; import 'package:doctor_app_flutter/screens/qr_reader/QR_reader_screen.dart';

@ -15,6 +15,7 @@ class RequestDoctorReply {
bool patientOutSA; bool patientOutSA;
int pageIndex; int pageIndex;
int pageSize; int pageSize;
int infoStatus;
RequestDoctorReply( RequestDoctorReply(
{this.projectID, {this.projectID,
@ -30,6 +31,7 @@ class RequestDoctorReply {
this.isLoginForDoctorApp, this.isLoginForDoctorApp,
this.patientOutSA, this.patientOutSA,
this.pageIndex, this.pageIndex,
this.infoStatus,
this.pageSize}); this.pageSize});
RequestDoctorReply.fromJson(Map<String, dynamic> json) { RequestDoctorReply.fromJson(Map<String, dynamic> json) {
@ -47,6 +49,7 @@ class RequestDoctorReply {
patientOutSA = json['PatientOutSA']; patientOutSA = json['PatientOutSA'];
pageIndex = json['PageIndex']; pageIndex = json['PageIndex'];
pageSize = json['PageSize']; pageSize = json['PageSize'];
pageSize = json['InfoStatus'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -65,6 +68,8 @@ class RequestDoctorReply {
data['PatientOutSA'] = this.patientOutSA; data['PatientOutSA'] = this.patientOutSA;
data['PageIndex'] = this.pageIndex; data['PageIndex'] = this.pageIndex;
data['PageSize'] = this.pageSize; data['PageSize'] = this.pageSize;
if(this.infoStatus != null)
data['InfoStatus'] = this.infoStatus;
return data; return data;
} }
} }

@ -3,8 +3,6 @@ import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart';
import 'package:doctor_app_flutter/screens/medical-file/health_summary_page.dart'; import 'package:doctor_app_flutter/screens/medical-file/health_summary_page.dart';
import 'package:doctor_app_flutter/screens/patients/ECGPage.dart'; import 'package:doctor_app_flutter/screens/patients/ECGPage.dart';
import 'package:doctor_app_flutter/screens/patients/insurance_approval_screen_patient.dart'; import 'package:doctor_app_flutter/screens/patients/insurance_approval_screen_patient.dart';
import 'package:doctor_app_flutter/screens/patients/profile/UCAF/UCAF-detail-screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/UCAF/UCAF-input-screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/lab_result/all_lab_special_result_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/all_lab_special_result_page.dart';
import 'package:doctor_app_flutter/screens/patients/profile/lab_result/labs_home_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/labs_home_page.dart';
import 'package:doctor_app_flutter/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart'; import 'package:doctor_app_flutter/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart';
@ -22,6 +20,7 @@ import 'package:doctor_app_flutter/screens/sick-leave/show-sickleave.dart';
import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart';
import './screens/auth/login_screen.dart'; import './screens/auth/login_screen.dart';
import 'screens/patients/profile/UCAF/ucaf_pager_screen.dart';
import 'screens/patients/profile/profile_screen/patient_profile_screen.dart'; import 'screens/patients/profile/profile_screen/patient_profile_screen.dart';
import './screens/patients/profile/vital_sign/vital_sign_details_screen.dart'; import './screens/patients/profile/vital_sign/vital_sign_details_screen.dart';
import 'landing_page.dart'; import 'landing_page.dart';
@ -109,8 +108,8 @@ var routes = {
ORDER_PRESCRIPTION_NEW: (_) => PrescriptionsPage(), ORDER_PRESCRIPTION_NEW: (_) => PrescriptionsPage(),
ORDER_PROCEDURE: (_) => ProcedureScreen(), ORDER_PROCEDURE: (_) => ProcedureScreen(),
MY_REFERRAL_DETAIL: (_) => MyReferralDetailScreen(), MY_REFERRAL_DETAIL: (_) => MyReferralDetailScreen(),
PATIENT_UCAF_REQUEST: (_) => UCAFInputScreen(), PATIENT_UCAF_REQUEST: (_) => UCAFPagerScreen(),
PATIENT_UCAF_DETAIL: (_) => UcafDetailScreen(), // PATIENT_UCAF_DETAIL: (_) => UcafDetailScreen(),
PATIENT_ECG: (_) => ECGPage(), PATIENT_ECG: (_) => ECGPage(),
ALL_SPECIAL_LAB_RESULT: (_) => AllLabSpecialResult(), ALL_SPECIAL_LAB_RESULT: (_) => AllLabSpecialResult(),
}; };

@ -460,7 +460,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
if (authMethodType == AuthMethodTypes.SMS || if (authMethodType == AuthMethodTypes.SMS ||
authMethodType == AuthMethodTypes.WhatsApp) { authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
this.startSMSService(authMethodType); this.startSMSService(authMethodType,isSilentLogin: true);
} else { } else {
checkActivationCode(isSilentLogin: true); checkActivationCode(isSilentLogin: true);
} }
@ -503,7 +503,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
} }
} }
startSMSService(AuthMethodTypes type) { startSMSService(AuthMethodTypes type,{isSilentLogin: false}) {
new SMSOTP( new SMSOTP(
context, context,
type, type,
@ -515,7 +515,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
return AppLoaderWidget(); return AppLoaderWidget();
}); });
this.checkActivationCode(value: value,isSilentLogin: false); this.checkActivationCode(value: value,isSilentLogin: isSilentLogin);
}, },
() => () =>
{ {

@ -0,0 +1,95 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_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/screens/doctor/doctor_replay/doctor_reply_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:flutter/material.dart';
import 'doctor_repaly_chat.dart';
class AllDoctorQuestions extends StatefulWidget {
final Function changeCurrentTab;
const AllDoctorQuestions({Key key, this.changeCurrentTab}) : super(key: key);
@override
_AllDoctorQuestionsState createState() => _AllDoctorQuestionsState();
}
class _AllDoctorQuestionsState extends State<AllDoctorQuestions> {
int pageIndex = 1;
@override
Widget build(BuildContext context) {
return BaseView<DoctorReplayViewModel>(
onModelReady: (model) {
model.getDoctorReply(isLocalBusy: false);
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).replay2,
isShowAppBar: false,
body: model.listDoctorWorkingHoursTable.isEmpty
?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem)
: Column(
children: [
Expanded(
child: Container(
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
child: NotificationListener(
child: ListView.builder(
scrollDirection: Axis.vertical,
itemCount: model.listDoctorWorkingHoursTable.length,
shrinkWrap: true,
itemBuilder: (BuildContext ctxt, int index) {
return Column(
children: [
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
DoctorReplayChat(
reply:
model.listDoctorWorkingHoursTable[
index],
previousModel: model,
),
settings: RouteSettings(
name: 'DoctorReplayChat'),
));
},
child: DoctorReplyWidget(
reply: model
.listDoctorWorkingHoursTable[index]),
),
if(model.state == ViewState.BusyLocal && index == model.listDoctorWorkingHoursTable.length-1)
DrAppCircularProgressIndeicator()
],
);
}),
onNotification: (t) {
if (t is ScrollUpdateNotification && t.metrics.pixels >= t.metrics.maxScrollExtent - 50 &&
model.state != ViewState.BusyLocal) {
setState(() {
pageIndex++;
});
model.getDoctorReply(pageIndex: pageIndex);
}
return;
},
),
),
),
],
),
),
);
}
}

@ -187,7 +187,7 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
children: [ children: [
AppText( AppText(
widget.reply.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), widget.reply.createdOn !=null?getFormattedDate(widget.reply.createdOn):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()),
fontWeight: FontWeight fontWeight: FontWeight
.w500, .w500,
color: Colors.white, color: Colors.white,
@ -295,7 +295,7 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
AppText( AppText(
widget.reply.responseDate !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(widget.reply.responseDate)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), widget.reply.responseDate !=null?getFormattedDate(widget.reply.responseDate):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()),
fontWeight: FontWeight fontWeight: FontWeight
.w500, .w500,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
@ -445,4 +445,24 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
), ),
)); ));
} }
getFormattedDate(date){
return (AppDateUtils.getDateTimeFromServerFormat(
date)
.day
.toString() +
" " +
AppDateUtils.getMonth(
AppDateUtils.getDateTimeFromServerFormat(
date)
.month)
.toString()
.substring(0, 3) +
' ' +
AppDateUtils.getDateTimeFromServerFormat(
date)
.year
.toString());
}
} }

@ -0,0 +1,185 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_repaly_chat.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_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/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'all_doctor_questions.dart';
import 'not_replaied_Doctor_Questions.dart';
/*
*@author: Mohammad Aljammal
*@Date:28/4/2020
*@param:
*@return:
*@desc: Doctor Reply Screen display data from GtMyPatientsQuestions service
*/
class DoctorReplyScreen extends StatefulWidget {
final Function changeCurrentTab;
const DoctorReplyScreen({Key key, this.changeCurrentTab}) : super(key: key);
@override
_DoctorReplyScreenState createState() => _DoctorReplyScreenState();
}
class _DoctorReplyScreenState extends State<DoctorReplyScreen>
with SingleTickerProviderStateMixin {
TabController _tabController;
int _activeTab = 0;
int pageIndex = 1;
@override
void initState() {
super.initState();
_tabController = TabController(length: 2, vsync: this);
_tabController.addListener(_handleTabSelection);
}
@override
void dispose() {
super.dispose();
_tabController.dispose();
}
_handleTabSelection() {
setState(() {
_activeTab = _tabController.index;
});
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return WillPopScope(
onWillPop: () async {
widget.changeCurrentTab();
return false;
},
child: AppScaffold(
appBarTitle: TranslationBase.of(context).replay2,
isShowAppBar: false,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Scaffold(
extendBodyBehindAppBar: false,
appBar: PreferredSize(
preferredSize: Size.fromHeight(
MediaQuery.of(context).size.height * 0.070),
child: Container(
height: MediaQuery.of(context).size.height * 0.070,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Theme.of(context).dividerColor,
width: 0.5), //width: 0.7
),
color: Colors.white),
child: Center(
child: TabBar(
isScrollable: false,
controller: _tabController,
indicatorColor: Colors.transparent,
indicatorWeight: 1.0,
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor,
labelPadding: EdgeInsets.only(
top: 0, left: 0, right: 0, bottom: 0),
unselectedLabelColor: Colors.grey[800],
tabs: [
tabWidget(
screenSize,
_activeTab == 0,
"Not Replied",
),
tabWidget(
screenSize,
_activeTab == 1,
TranslationBase.of(context).all,
),
],
),
),
),
),
body: Column(
children: [
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController,
children: [
NotRepliedDoctorQuestions(),
AllDoctorQuestions(),
],
),
),
],
),
),
),
],
),
),
);
}
}
Widget tabWidget(Size screenSize, bool isActive, String title,
{int counter = -1}) {
return 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: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
title,
fontSize: SizeConfig.textMultiplier * 1.5,
color: isActive ? Colors.white : Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
if (counter != -1)
Container(
margin: EdgeInsets.all(4),
width: 15,
height: 15,
decoration: BoxDecoration(
color: isActive ? Colors.white : Color(0xFFD02127),
shape: BoxShape.circle,
),
child: Center(
child: FittedBox(
child: AppText(
"$counter",
fontSize: SizeConfig.textMultiplier * 1.5,
color: !isActive ? Colors.white : Color(0xFFD02127),
fontWeight: FontWeight.w700,
),
),
),
),
],
),
),
);
}

@ -31,14 +31,20 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
return Container( return Container(
child: CardWithBgWidget( child: CardWithBgWidget(
bgColor: bgColor: widget.reply.infoStatus == 99
widget.reply.status == 2 ? Colors.green[600] : Color(0xFFD02127), ? Color(0xFF2B353E)
: widget.reply.infoStatus == 4
? IN_PROGRESS_COLOR
: widget.reply.infoStatus == 3
? Color(0xFFD02127)
: Colors.green[600],
hasBorder: false, hasBorder: false,
widget: Container( widget: Container(
child: InkWell( child: InkWell(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if(widget.reply.infoStatus != 0)
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -49,18 +55,32 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
color: Colors.black), color: Colors.black),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: widget.reply.status == 2 text: widget.reply.infoStatus == 99
? TranslationBase.of(context).active ? TranslationBase.of(context).notReplied:widget.reply.infoStatus == 1
: widget.reply.status == 1 ? TranslationBase.of(context).replayCallStatus
? TranslationBase.of(context).onHold : widget.reply.infoStatus == 2
: TranslationBase.of(context).cancelled, ? TranslationBase.of(context).patientArrived
: widget.reply.infoStatus == 3
? TranslationBase.of(context)
.calledAndNoResponse
: widget.reply.infoStatus == 4
? TranslationBase.of(context)
.underProcess
: widget.reply.infoStatus == 6
? TranslationBase.of(context)
.textResponse
: '',
style: TextStyle( style: TextStyle(
color: widget.reply.status == 2 color: widget.reply.infoStatus == 99
? Colors.green[600] ? Color(0xFF2B353E)
: Color(0xFFD02127), : widget.reply.infoStatus == 4
? IN_PROGRESS_COLOR
: widget.reply.infoStatus == 3
? Color(0xFFD02127)
: Colors.green[600],
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 2.0 * SizeConfig.textMultiplier)), fontSize: 1.8 * SizeConfig.textMultiplier)),
], ],
), ),
), ),
@ -182,38 +202,16 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
CustomRow( CustomRow(
label: TranslationBase.of(context).fileNumber, label: TranslationBase.of(context).fileNumber,
value: widget.reply.patientID.toString(), value: widget.reply.patientID.toString(),
isCopyable:false,
), ),
CustomRow( CustomRow(
label: TranslationBase.of(context).age + " : ", label: TranslationBase.of(context).age + " : ",
isCopyable:false,
value: value:
"${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}",
), ),
CustomRow(
width: MediaQuery.of(context).size.width * .3,
label: TranslationBase.of(context).infoStatus +
":",
value: widget.reply.infoStatus == 1
? TranslationBase.of(context)
.replayCallStatus
: widget.reply.infoStatus == 2
? TranslationBase.of(context)
.patientArrived
: widget.reply.infoStatus == 3
? TranslationBase.of(context)
.calledAndNoResponse
: widget.reply.infoStatus == 4
? TranslationBase.of(context)
.underProcess
: widget.reply.infoStatus == 6
? TranslationBase.of(
context)
.textResponse
: '',
),
SizedBox( SizedBox(
height: 10, height: 8,
), ),
], ],
), ),
@ -227,27 +225,28 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: fontSize: 1.3 * SizeConfig.textMultiplier,
1.3 * SizeConfig.textMultiplier,
color: Color(0xFF575757)), color: Color(0xFF575757)),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of(context) text:
.requestType + TranslationBase.of(context).requestType +
": ", ": ",
style: TextStyle( style: TextStyle(
fontSize: SizeConfig fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * .getTextMultiplierBasedOnWidth() *
2.8, 2.8,
color: Color(0xFF575757), color: Color(0xFF575757),
//TranslationBase.of(context).doctorResponse + " : ", //TranslationBase.of(context).doctorResponse + " : ",
)), )),
new TextSpan( new TextSpan(
text: text:
"${widget.reply.requestTypeDescription}", "${widget.reply.requestTypeDescription}",
style: TextStyle( style: TextStyle(
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
)), )),

@ -0,0 +1,104 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_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/screens/doctor/doctor_replay/doctor_reply_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:flutter/material.dart';
import 'doctor_repaly_chat.dart';
class NotRepliedDoctorQuestions extends StatefulWidget {
final Function changeCurrentTab;
const NotRepliedDoctorQuestions({Key key, this.changeCurrentTab})
: super(key: key);
@override
_NotRepliedDoctorQuestionsState createState() =>
_NotRepliedDoctorQuestionsState();
}
class _NotRepliedDoctorQuestionsState extends State<NotRepliedDoctorQuestions> {
int pageIndex = 1;
@override
Widget build(BuildContext context) {
return BaseView<DoctorReplayViewModel>(
onModelReady: (model) {
model.getDoctorReply(isLocalBusy: false, isGettingNotReply: true);
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).replay2,
isShowAppBar: false,
body: model.listDoctorNotRepliedQuestions.isEmpty
? ErrorMessage(error: TranslationBase.of(context).noItem)
: Column(
children: [
Expanded(
child: Container(
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
child: NotificationListener(
child: ListView.builder(
scrollDirection: Axis.vertical,
itemCount:
model.listDoctorNotRepliedQuestions.length,
shrinkWrap: true,
itemBuilder: (BuildContext ctxt, int index) {
return Column(
children: [
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
DoctorReplayChat(
reply: model
.listDoctorNotRepliedQuestions[
index],
previousModel: model,
),
settings: RouteSettings(
name: 'DoctorReplayChat'),
));
},
child: DoctorReplyWidget(
reply:
model.listDoctorNotRepliedQuestions[
index]),
),
if (model.state == ViewState.BusyLocal &&
index ==
model.listDoctorNotRepliedQuestions
.length -
1)
DrAppCircularProgressIndeicator()
],
);
}),
onNotification: (t) {
if (t is ScrollUpdateNotification &&
t.metrics.pixels >=
t.metrics.maxScrollExtent - 50 &&
model.state != ViewState.BusyLocal) {
setState(() {
pageIndex++;
});
model.getDoctorReply(pageIndex: pageIndex, isGettingNotReply: true);
}
return;
},
),
),
),
],
),
),
);
}
}

@ -1,111 +0,0 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/doctor/doctor_repaly_chat.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/doctor/doctor_reply_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/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
/*
*@author: Mohammad Aljammal
*@Date:28/4/2020
*@param:
*@return:
*@desc: Doctor Reply Screen display data from GtMyPatientsQuestions service
*/
class DoctorReplyScreen extends StatefulWidget {
final Function changeCurrentTab;
const DoctorReplyScreen({Key key, this.changeCurrentTab}) : super(key: key);
@override
_DoctorReplyScreenState createState() => _DoctorReplyScreenState();
}
class _DoctorReplyScreenState extends State<DoctorReplyScreen> {
int pageIndex = 1;
@override
Widget build(BuildContext context) {
return BaseView<DoctorReplayViewModel>(
onModelReady: (model) {
model.getDoctorReply(isLocalBusy: false);
},
builder: (_, model, w) => WillPopScope(
onWillPop: () async {
widget.changeCurrentTab();
return false;
},
child: AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).replay2,
isShowAppBar: false,
body: model.listDoctorWorkingHoursTable.isEmpty
? DrAppEmbeddedError(error: TranslationBase.of(context).noItem)
: Column(
children: [
Expanded(
child: Container(
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
child: NotificationListener(
child: ListView.builder(
scrollDirection: Axis.vertical,
itemCount: model.listDoctorWorkingHoursTable.length,
shrinkWrap: true,
itemBuilder: (BuildContext ctxt, int index) {
return Column(
children: [
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
DoctorReplayChat(
reply:
model.listDoctorWorkingHoursTable[
index],
previousModel: model,
),
settings: RouteSettings(
name: 'DoctorReplayChat'),
));
},
child: DoctorReplyWidget(
reply: model
.listDoctorWorkingHoursTable[index]),
),
if(model.state == ViewState.BusyLocal && index == model.listDoctorWorkingHoursTable.length-1)
DrAppCircularProgressIndeicator()
],
);
}),
onNotification: (t) {
if (t is ScrollUpdateNotification && t.metrics.pixels >= t.metrics.maxScrollExtent - 50 &&
model.state != ViewState.BusyLocal) {
setState(() {
pageIndex++;
});
model.getDoctorReply(pageIndex: pageIndex);
}
return;
},
),
),
),
],
),
),
),
);
}
}

@ -1,75 +0,0 @@
import 'package:doctor_app_flutter/core/viewModel/referral_view_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/doctor/my_referral_patient_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import '../../widgets/shared/app_scaffold_widget.dart';
class MyReferralPatient extends StatefulWidget {
int expandedItemIndex = -1;
@override
_MyReferralPatientState createState() => _MyReferralPatientState();
}
class _MyReferralPatientState extends State<MyReferralPatient> {
@override
Widget build(BuildContext context) {
return BaseView<ReferralPatientViewModel>(
onModelReady: (model) => model.getMyReferralPatient(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).myReferralPatient,
body: model.listMyReferralPatientModel.length == 0
? Center(
child: AppText(
TranslationBase.of(context).errorNoSchedule,
color: Theme.of(context).errorColor,
),
)
: Container(
padding: EdgeInsetsDirectional.fromSTEB(20, 0, 20, 0),
child: ListView(
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 10,
),
Container(
child: Column(
children: [
...List.generate(
model.listMyReferralPatientModel.length,
(index) => MyReferralPatientWidget(
myReferralPatientModel: model
.listMyReferralPatientModel[index],
model: model,
expandClick: () {
setState(() {
if (widget.expandedItemIndex ==
index) {
widget.expandedItemIndex = -1;
} else {
widget.expandedItemIndex = index;
}
});
},
isExpand:
widget.expandedItemIndex == index,
),
)
],
),
),
],
),
],
),
),
));
}
}

@ -12,7 +12,7 @@ import 'package:doctor_app_flutter/screens/home/dashboard_swipe_widget.dart';
import 'package:doctor_app_flutter/screens/home/home_patient_card.dart'; import 'package:doctor_app_flutter/screens/home/home_patient_card.dart';
import 'package:doctor_app_flutter/screens/live_care/live_care_patient_screen.dart'; import 'package:doctor_app_flutter/screens/live_care/live_care_patient_screen.dart';
import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart';
import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart'; import 'package:doctor_app_flutter/screens/patients/In_patient/in_patient_screen.dart';
import 'package:doctor_app_flutter/screens/patients/out_patient/out_patient_screen.dart'; import 'package:doctor_app_flutter/screens/patients/out_patient/out_patient_screen.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart';
@ -371,7 +371,7 @@ class _HomeScreenState extends State<HomeScreen> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: PatientInPatientScreen( page: InPatientScreen(
specialClinic: model.getSpecialClinic( specialClinic: model.getSpecialClinic(
clinicId ?? projectsProvider.doctorClinicsList[0].clinicID), clinicId ?? projectsProvider.doctorClinicsList[0].clinicID),
), ),

@ -323,7 +323,11 @@ class _DischargedPatientState extends State<DischargedPatient> {
), ),
], ],
), ),
) ),
Icon(
Icons.arrow_forward,
size: 24,
),
], ],
) )
], ],

@ -1,213 +0,0 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.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/patient_card/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_container.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import '../../routes.dart';
class InPatientPage extends StatefulWidget {
final bool isMyInPatient;
final PatientSearchViewModel patientSearchViewModel;
InPatientPage(this.isMyInPatient, this.patientSearchViewModel);
@override
_InPatientPageState createState() => _InPatientPageState();
}
class _InPatientPageState extends State<InPatientPage> {
TextEditingController _searchController = TextEditingController();
bool isSortDes = false;
@override
void dispose() {
_searchController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
baseViewModel: widget.patientSearchViewModel,
isShowAppBar: false,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: MediaQuery.of(context).size.height * 0.070,
),
Container(
margin: EdgeInsets.all(16.0),
child: Stack(
children: [
AppTextFieldCustom(
hintText: TranslationBase.of(context).searchPatientName,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Colors.black,
),
onPressed: () {},
),
controller: _searchController,
onChanged: (value) {
widget.patientSearchViewModel.filterSearchResults(value);
}),
Positioned(
right: 35,
top:5,
child: IconButton(
icon: Icon(
isSortDes
? FontAwesomeIcons.sortAmountDown
: FontAwesomeIcons.sortAmountUp,
color: Colors.black,
),
iconSize: 20,
// padding: EdgeInsets.only(bottom: 30),
onPressed: () {
GifLoaderDialogUtils.showMyDialog(context);
widget.patientSearchViewModel.sortInPatient(isDes: isSortDes);
isSortDes = !isSortDes;
GifLoaderDialogUtils.hideDialog(context);
},
),
)
],
),
),
widget.patientSearchViewModel.state == ViewState.Idle?widget.patientSearchViewModel.filteredInPatientItems.length > 0
? (widget.isMyInPatient && widget.patientSearchViewModel.myIinPatientList.length ==0 )?NoData():Expanded(
child: Container(
margin: EdgeInsets.symmetric(horizontal: 16.0),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
...List.generate(
widget.patientSearchViewModel.filteredInPatientItems.length, (index) {
if (!widget.isMyInPatient)
return PatientCard(
patientInfo:
widget.patientSearchViewModel.filteredInPatientItems[index],
patientType: "1",
arrivalType: "1",
isInpatient: true,
isMyPatient: widget.patientSearchViewModel.filteredInPatientItems[index]
.doctorId ==
widget.patientSearchViewModel.doctorProfile.doctorID,
onTap: () {
FocusScopeNode currentFocus =
FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": widget.patientSearchViewModel.
filteredInPatientItems[index],
"patientType": "1",
"from": "0",
"to": "0",
"isSearch": false,
"isInpatient": true,
"arrivalType": "1",
"isMyPatient":widget.patientSearchViewModel.filteredInPatientItems[index]
.doctorId ==
widget.patientSearchViewModel.doctorProfile.doctorID,
});
},
);
else if (widget.patientSearchViewModel.filteredInPatientItems[index]
.doctorId ==
widget.patientSearchViewModel.doctorProfile.doctorID &&
widget.isMyInPatient)
return PatientCard(
patientInfo:
widget.patientSearchViewModel.filteredInPatientItems[index],
patientType: "1",
arrivalType: "1",
isInpatient: true,
isMyPatient: widget.patientSearchViewModel
.filteredInPatientItems[index]
.doctorId ==
widget.patientSearchViewModel.doctorProfile.doctorID,
onTap: () {
FocusScopeNode currentFocus =
FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": widget.patientSearchViewModel.filteredInPatientItems[index],
"patientType": "1",
"from": "0",
"to": "0",
"isSearch": false,
"isInpatient": true,
"arrivalType": "1",
"isMyPatient":widget.patientSearchViewModel.filteredInPatientItems[index]
.doctorId ==
widget.patientSearchViewModel.doctorProfile.doctorID,
});
},
);
else
return SizedBox();
}),
SizedBox(
height: 15,
)
],
),
),
),
)
: NoData(): Center(
child: Container(
height: 300,
width: 300,
),
),
],
),
);
}
}
class NoData extends StatelessWidget {
const NoData({
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Expanded(
child: SingleChildScrollView(
child: Container(
child: ErrorMessage(
error:
TranslationBase.of(context).noDataAvailable)),
),
);
}
}

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

@ -0,0 +1,20 @@
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:flutter/material.dart';
class NoData extends StatelessWidget {
const NoData({
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Expanded(
child: SingleChildScrollView(
child: Container(
child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable)),
),
);
}
}

@ -0,0 +1,311 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'NoData.dart';
import 'list_of_all_in_patient.dart';
import 'list_of_my_inpatient.dart';
class InPatientListPage extends StatefulWidget {
final bool isMyInPatient;
final PatientSearchViewModel patientSearchViewModel;
InPatientListPage(this.isMyInPatient, this.patientSearchViewModel);
@override
_InPatientListPageState createState() => _InPatientListPageState();
}
class _InPatientListPageState extends State<InPatientListPage> {
TextEditingController _searchController = TextEditingController();
bool isSortDes = false;
bool isAllClinic = true;
bool hasQuery = false;
bool showBottomSheet = false;
String selectedClinicName;
@override
void dispose() {
_searchController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
baseViewModel: widget.patientSearchViewModel,
isShowAppBar: false,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (!widget.isMyInPatient)
Container(
margin: EdgeInsets.only(left: 10.0, right: 10, top: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
child: Row(
children: [
Radio(
value: 1,
groupValue: isAllClinic ? 1 : 2,
onChanged: (value) {
setState(() {
setState(() {
isAllClinic = true;
showBottomSheet = false;
selectedClinicName = null;
});
widget.patientSearchViewModel
.setDefaultInPatientList();
});
},
activeColor: Colors.red,
),
AppText(
"${TranslationBase.of(context).allClinic}",
fontSize: 15,
),
],
),
onTap: () {
setState(() {
isAllClinic = true;
selectedClinicName = null;
showBottomSheet = false;
});
widget.patientSearchViewModel.setDefaultInPatientList();
},
),
InkWell(
onTap: () {
setState(() {
if (widget.patientSearchViewModel.InpatientClinicList
.length >
0) showBottomSheet = true;
});
},
child: Row(
children: [
Radio(
value: 2,
groupValue: isAllClinic ? 1 : 2,
onChanged: (value) {
setState(() {
setState(() {
if (widget.patientSearchViewModel
.InpatientClinicList.length >
0) showBottomSheet = true;
});
});
},
activeColor: Colors.red,
),
AppText(
selectedClinicName ?? TranslationBase.of(context).clinicSelect,
fontSize: 15,
),
Container(
margin: EdgeInsets.only(bottom: 10),
child: Icon(FontAwesomeIcons.sortDown))
],
)),
],
),
),
Container(
margin: EdgeInsets.only(
left: 16,
right: 16,
bottom: 16,
top: widget.isMyInPatient ? 15 : 5),
child: Stack(
children: [
AppTextFieldCustom(
hintText: TranslationBase.of(context).searchPatientName,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Colors.black,
),
onPressed: () {},
),
controller: _searchController,
onChanged: (value) {
setState(() {
hasQuery = true;
});
widget.patientSearchViewModel.filterSearchResults(value,
isAllClinic: isAllClinic,
isMyInPatient: widget.isMyInPatient);
}),
Positioned(
right: 35,
top: 5,
child: IconButton(
icon: Icon(
isSortDes
? FontAwesomeIcons.sortAmountDown
: FontAwesomeIcons.sortAmountUp,
color: Colors.black,
),
iconSize: 20,
// padding: EdgeInsets.only(bottom: 30),
onPressed: () {
GifLoaderDialogUtils.showMyDialog(context);
widget.patientSearchViewModel.sortInPatient(
isDes: isSortDes,
isAllClinic: isAllClinic,
isMyInPatient: widget.isMyInPatient);
isSortDes = !isSortDes;
GifLoaderDialogUtils.hideDialog(context);
},
),
)
],
),
),
widget.patientSearchViewModel.state == ViewState.Idle
? (widget.isMyInPatient &&
widget.patientSearchViewModel.myIinPatientList.length > 0)
? ListOfMyInpatient(
isAllClinic: isAllClinic,
hasQuery: hasQuery,
patientSearchViewModel: widget.patientSearchViewModel)
: widget.patientSearchViewModel.filteredInPatientItems
.length >
0
? (widget.isMyInPatient &&
widget.patientSearchViewModel.myIinPatientList
.length ==
0)
? NoData()
: ListOfAllInPatient(
isAllClinic: isAllClinic,
hasQuery: hasQuery,
patientSearchViewModel:
widget.patientSearchViewModel)
: NoData()
: Center(
child: Container(
height: 300,
width: 300,
),
),
],
),
bottomSheet: !showBottomSheet
? Container(
height: 0,
)
: Container(
decoration: BoxDecoration(
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
height: MediaQuery.of(context).size.height * 0.5,
padding: EdgeInsets.only(top: 13, left: 10, right: 10),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
InkWell(
onTap: () {
setState(() {
showBottomSheet = false;
});
},
child: Icon(DoctorApp.close_1,
size: SizeConfig.getTextMultiplierBasedOnWidth() *
4.5,
color: Color(0xFF2B353E)))
],
),
Row(
children: [
AppText(
"${TranslationBase.of(context).clinicSelect} :",
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 18,
),
],
),
SizedBox(
height: 10,
),
Expanded(
child: ListView.builder(
itemCount: widget
.patientSearchViewModel.InpatientClinicList.length,
scrollDirection: Axis.vertical,
physics: ScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return InkWell(
onTap: () {
setState(() {
isAllClinic = false;
showBottomSheet = false;
selectedClinicName = widget
.patientSearchViewModel
.InpatientClinicList[index];
});
widget.patientSearchViewModel.filterByClinic(
clinicName: widget.patientSearchViewModel
.InpatientClinicList[index]);
},
child: Row(
children: [
Radio(
value: widget.patientSearchViewModel
.InpatientClinicList[index],
groupValue: selectedClinicName,
onChanged: (value) {
setState(() {
setState(() {
isAllClinic = false;
showBottomSheet = false;
selectedClinicName = widget
.patientSearchViewModel
.InpatientClinicList[index];
});
widget.patientSearchViewModel
.filterByClinic(clinicName: value);
});
},
activeColor: Colors.red,
),
AppText(
widget.patientSearchViewModel
.InpatientClinicList[index],
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 15,
),
],
));
}),
),
SizedBox(
height: 20,
),
],
),
),
);
}
}

@ -0,0 +1,273 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/In_patient/InPatientHeader.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../DischargedPatientPage.dart';
import 'in_patient_list_page.dart';
class InPatientScreen extends StatefulWidget {
GetSpecialClinicalCareListResponseModel specialClinic;
InPatientScreen({Key key, this.specialClinic});
@override
_InPatientScreenState createState() => _InPatientScreenState();
}
class _InPatientScreenState extends State<InPatientScreen>
with SingleTickerProviderStateMixin {
TabController _tabController;
int _activeTab = 0;
int selectedMapId;
@override
void initState() {
super.initState();
_tabController = TabController(length: 3, vsync: this);
_tabController.addListener(_handleTabSelection);
}
@override
void dispose() {
super.dispose();
_tabController.dispose();
}
_handleTabSelection() {
setState(() {
_activeTab = _tabController.index;
});
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
PatientSearchRequestModel requestModel = PatientSearchRequestModel();
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context);
return BaseView<PatientSearchViewModel>(
onModelReady: (model) async {
model.clearPatientList();
if (widget.specialClinic != null) {
await model
.getSpecialClinicalCareMappingList(widget.specialClinic.clinicID);
requestModel.nursingStationID =
model.specialClinicalCareMappingList[0].nursingStationID;
}
requestModel.clinicID = 0;
await model.getInPatientList(requestModel);
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBar: InPatientHeader(),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (model.specialClinicalCareMappingList.isNotEmpty &&
widget.specialClinic != null &&
_activeTab != 2)
Container(
width: MediaQuery.of(context).size.width * .3,
child: DropdownButtonHideUnderline(
child: DropdownButton(
dropdownColor: Colors.white,
iconEnabledColor: Colors.black,
isExpanded: true,
value: selectedMapId == null
? model.specialClinicalCareMappingList[0].nursingStationID
: selectedMapId,
iconSize: 25,
elevation: 16,
selectedItemBuilder: (BuildContext context) {
return model.specialClinicalCareMappingList.map((item) {
return Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
padding: EdgeInsets.all(2),
margin: EdgeInsets.all(2),
decoration: new BoxDecoration(
color: Colors.red[800],
borderRadius: BorderRadius.circular(20),
),
constraints: BoxConstraints(
minWidth: 20,
minHeight: 20,
),
child: Center(
child: AppText(
model
.specialClinicalCareMappingList.length
.toString(),
color: Colors.white,
fontSize:
projectsProvider.isArabic ? 10 : 11,
textAlign: TextAlign.center,
),
)),
],
),
AppText(item.description,
fontSize: 12,
color: Colors.black,
fontWeight: FontWeight.bold,
textAlign: TextAlign.end),
],
);
}).toList();
},
onChanged: (newValue) async {
setState(() {
selectedMapId = newValue;
});
model.clearPatientList();
GifLoaderDialogUtils.showMyDialog(context);
PatientSearchRequestModel requestModel =
PatientSearchRequestModel(
nursingStationID: selectedMapId, clinicID: 0);
await model.getInPatientList(requestModel,
isLocalBusy: true);
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
},
items: model.specialClinicalCareMappingList.map((item) {
return DropdownMenuItem(
child: AppText(
item.description,
textAlign: TextAlign.left,
),
value: item.nursingStationID,
);
}).toList(),
)),
),
Expanded(
child: Scaffold(
extendBodyBehindAppBar: false,
appBar: PreferredSize(
preferredSize: Size.fromHeight(
MediaQuery.of(context).size.height * 0.070),
child: Container(
height: MediaQuery.of(context).size.height * 0.070,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Theme.of(context).dividerColor,
width: 0.5), //width: 0.7
),
color: Colors.white),
child: Center(
child: TabBar(
isScrollable: false,
controller: _tabController,
indicatorColor: Colors.transparent,
indicatorWeight: 1.0,
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor,
labelPadding: EdgeInsets.only(
top: 0, left: 0, right: 0, bottom: 0),
unselectedLabelColor: Colors.grey[800],
tabs: [
tabWidget(screenSize, _activeTab == 0,
TranslationBase.of(context).inPatientAll,
counter: model.inPatientList.length),
tabWidget(screenSize, _activeTab == 1,
TranslationBase.of(context).myInPatientTitle,
counter: model.myIinPatientList.length),
tabWidget(screenSize, _activeTab == 2,
TranslationBase.of(context).discharged),
],
),
),
),
),
body: Column(
children: [
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController,
children: [
InPatientListPage(false, model),
InPatientListPage(true, model),
DischargedPatient(),
],
),
),
],
),
),
),
],
),
),
);
}
Widget tabWidget(Size screenSize, bool isActive, String title,
{int counter = -1}) {
return 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: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
title,
fontSize: SizeConfig.textMultiplier * 1.5,
color: isActive ? Colors.white : Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
if (counter != -1)
Container(
margin: EdgeInsets.all(4),
width: 15,
height: 15,
decoration: BoxDecoration(
color: isActive ? Colors.white : Color(0xFFD02127),
shape: BoxShape.circle,
),
child: Center(
child: FittedBox(
child: AppText(
"$counter",
fontSize: SizeConfig.textMultiplier * 1.5,
color: !isActive ? Colors.white : Color(0xFFD02127),
fontWeight: FontWeight.w700,
),
),
),
),
],
),
),
);
}
}

@ -0,0 +1,85 @@
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart';
import 'package:flutter/material.dart';
import '../../../routes.dart';
import 'NoData.dart';
class ListOfAllInPatient extends StatelessWidget {
const ListOfAllInPatient({
Key key,
@required this.isAllClinic,
@required this.hasQuery,
this.patientSearchViewModel,
}) : super(key: key);
final bool isAllClinic;
final bool hasQuery;
final PatientSearchViewModel patientSearchViewModel;
@override
Widget build(BuildContext context) {
return Expanded(
child: Container(
margin: EdgeInsets.symmetric(horizontal: 16.0),
child: patientSearchViewModel.filteredInPatientItems.length == 0
? NoData()
: NotificationListener(
child: ListView.builder(
itemCount:
patientSearchViewModel.filteredInPatientItems.length,
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemBuilder: (context, index) {
return PatientCard(
patientInfo: patientSearchViewModel
.filteredInPatientItems[index],
patientType: "1",
arrivalType: "1",
isInpatient: true,
isMyPatient: patientSearchViewModel
.filteredInPatientItems[index].doctorId ==
patientSearchViewModel.doctorProfile.doctorID,
onTap: () {
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patientSearchViewModel
.filteredInPatientItems[index],
"patientType": "1",
"from": "0",
"to": "0",
"isSearch": false,
"isInpatient": true,
"arrivalType": "1",
"isMyPatient": patientSearchViewModel
.filteredInPatientItems[index].doctorId ==
patientSearchViewModel.doctorProfile.doctorID,
});
},
);
}),
onNotification: (notification) {
if (isAllClinic && !hasQuery) if (notification
is ScrollUpdateNotification) {
if (notification.metrics.pixels >= notification.metrics.maxScrollExtent - 50) {
patientSearchViewModel.addOnFilteredList();
}
if (notification.metrics.pixels <= notification.metrics.minScrollExtent - 50) {
patientSearchViewModel.removeOnFilteredList();
}
}
return;
},
),
),
);
}
}

@ -0,0 +1,66 @@
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart';
import 'package:flutter/material.dart';
import '../../../routes.dart';
import 'NoData.dart';
class ListOfMyInpatient extends StatelessWidget {
const ListOfMyInpatient({
Key key,
@required this.isAllClinic,
@required this.hasQuery,
this.patientSearchViewModel,
}) : super(key: key);
final bool isAllClinic;
final bool hasQuery;
final PatientSearchViewModel patientSearchViewModel;
@override
Widget build(BuildContext context) {
return Expanded(
child:Container(
margin: EdgeInsets.symmetric(horizontal: 16.0),
child: patientSearchViewModel.filteredMyInPatientItems.length == 0
? NoData():NotificationListener(
child: ListView.builder(
itemCount: patientSearchViewModel.filteredMyInPatientItems.length,
scrollDirection: Axis.vertical,
// physics: ScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return PatientCard(
patientInfo: patientSearchViewModel.filteredMyInPatientItems[index],
patientType: "1",
arrivalType: "1",
isInpatient: true,
isMyPatient: true,
onTap: () {
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
"patient":
patientSearchViewModel.filteredMyInPatientItems[index],
"patientType": "1",
"from": "0",
"to": "0",
"isSearch": false,
"isInpatient": true,
"arrivalType": "1",
"isMyPatient": true,
});
},
);
}),
onNotification: (t) {
return;
},
),
),
);
}
}

@ -1,329 +0,0 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.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/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'DischargedPatientPage.dart';
import 'InPatientPage.dart';
class PatientInPatientScreen extends StatefulWidget {
GetSpecialClinicalCareListResponseModel specialClinic;
PatientInPatientScreen({Key key, this.specialClinic});
@override
_PatientInPatientScreenState createState() => _PatientInPatientScreenState();
}
class _PatientInPatientScreenState extends State<PatientInPatientScreen>
with SingleTickerProviderStateMixin {
TabController _tabController;
int _activeTab = 0;
int selectedMapId;
@override
void initState() {
super.initState();
_tabController = TabController(length: 3, vsync: this);
_tabController.addListener(_handleTabSelection);
}
@override
void dispose() {
super.dispose();
_tabController.dispose();
}
_handleTabSelection() {
setState(() {
_activeTab = _tabController.index;
});
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery
.of(context)
.size;
PatientSearchRequestModel requestModel = PatientSearchRequestModel();
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context);
return BaseView<PatientSearchViewModel>(
onModelReady: (model) async {
model.clearPatientList();
if (widget.specialClinic != null) {
await model.getSpecialClinicalCareMappingList(widget.specialClinic.clinicID);
requestModel.nursingStationID =
model.specialClinicalCareMappingList[0].nursingStationID;
}
requestModel.clinicID = 0;
await model.getInPatientList(requestModel);
},
builder: (_, model, w) =>
AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
color: Colors.white,
),
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50),
child: Row(children: [
IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context),
),
Expanded(
child: AppText(
TranslationBase
.of(context)
.inPatient,
fontSize: SizeConfig.textMultiplier * 2.8,
fontWeight: FontWeight.bold,
color: Color(0xFF2B353E),
),
),
if (model.specialClinicalCareMappingList.isNotEmpty &&
widget.specialClinic != null &&
_activeTab != 2)
Container(
width: MediaQuery.of(context).size.width * .3,
child: DropdownButtonHideUnderline(
child: DropdownButton(
dropdownColor: Colors.white,
iconEnabledColor: Colors.black,
isExpanded: true,
value: selectedMapId == null ? model
.specialClinicalCareMappingList[0]
.nursingStationID : selectedMapId,
iconSize: 25,
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return model
.specialClinicalCareMappingList
.map((item) {
return Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment:
MainAxisAlignment.end,
children: <Widget>[
Column(
mainAxisAlignment:
MainAxisAlignment
.center,
children: [
Container(
padding:
EdgeInsets.all(2),
margin:
EdgeInsets.all(2),
decoration:
new BoxDecoration(
color:
Colors.red[800],
borderRadius:
BorderRadius
.circular(
20),
),
constraints:
BoxConstraints(
minWidth: 20,
minHeight: 20,
),
child: Center(
child: AppText(
model
.specialClinicalCareMappingList
.length
.toString(),
color:
Colors.white,
fontSize:
projectsProvider
.isArabic
? 10
: 11,
textAlign:
TextAlign
.center,
),
)),
],
),
AppText(item.description,
fontSize: 12,
color: Colors.black,
fontWeight:
FontWeight.bold,
textAlign: TextAlign.end),
],
);
}).toList();
},
onChanged: (newValue) async {
setState(() {
selectedMapId = newValue;
});
model.clearPatientList();
GifLoaderDialogUtils.showMyDialog(
context);
PatientSearchRequestModel requestModel = PatientSearchRequestModel(
nursingStationID: selectedMapId, clinicID: 0);
await model.getInPatientList(requestModel, isLocalBusy: true);
GifLoaderDialogUtils.hideDialog(
context);
if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
}
},
items: model
.specialClinicalCareMappingList
.map((item) {
return DropdownMenuItem(
child: AppText(
item.description,
textAlign: TextAlign.left,
),
value: item.nursingStationID,
);
}).toList(),
)),
)
]),
),
),
Expanded(
child: Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(
preferredSize: Size.fromHeight(
MediaQuery.of(context).size.height * 0.070),
child: Container(
height: MediaQuery.of(context).size.height * 0.070,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Theme.of(context).dividerColor,
width: 0.5), //width: 0.7
),
color: Colors.white),
child: Center(
child: TabBar(
isScrollable: false,
controller: _tabController,
indicatorColor: Colors.transparent,
indicatorWeight: 1.0,
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor,
labelPadding: EdgeInsets.only(
top: 0, left: 0, right: 0, bottom: 0),
unselectedLabelColor: Colors.grey[800],
tabs: [
tabWidget(screenSize, _activeTab == 0,
TranslationBase.of(context).inPatientAll,
counter: model.inPatientList.length),
tabWidget(
screenSize, _activeTab == 1, TranslationBase.of(context).inPatient,
counter: model.myIinPatientList.length),
tabWidget(screenSize, _activeTab == 2,
TranslationBase.of(context).discharged),
],
),
),
),
),
body: Column(
children: [
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController,
children: [
InPatientPage(false, model),
InPatientPage(true,model),
DischargedPatient(),
],
),
),
],
),
),
),
],
),
),
);
}
Widget tabWidget(Size screenSize, bool isActive, String title,
{int counter = -1}) {
return 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: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
title,
fontSize: SizeConfig.textMultiplier * 1.5,
color: isActive ? Colors.white : Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
if (counter != -1)
Container(
margin: EdgeInsets.all(4),
width: 15,
height: 15,
decoration: BoxDecoration(
color: isActive ? Colors.white : Color(0xFFD02127),
shape: BoxShape.circle,
),
child: Center(
child: FittedBox(
child: AppText(
"$counter",
fontSize: SizeConfig.textMultiplier * 1.5,
color: !isActive ? Colors.white : Color(0xFFD02127),
fontWeight: FontWeight.w700,
),
),
),
),
],
),
),
);
}
}

@ -38,6 +38,5 @@ class PatientSearchHeader extends StatelessWidget with PreferredSizeWidget {
} }
@override @override
Size get preferredSize => Size(double.maxFinite,65); Size get preferredSize => Size(double.maxFinite,65);
} }

@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/models/SOAP/order-procedure.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/screens/patients/profile/UCAF/page-stepper-widget.dart'; import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page-stepper-widget.dart';
import 'package:doctor_app_flutter/screens/patients/profile/UCAF/ucaf_pager_screen.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -22,34 +23,63 @@ import 'package:hexcolor/hexcolor.dart';
import '../../../../routes.dart'; import '../../../../routes.dart';
class UcafDetailScreen extends StatefulWidget { class UcafDetailScreen extends StatefulWidget {
final PatiantInformtion patient;
final UcafViewModel model;
final Function changeLoadingState;
UcafDetailScreen(this.patient, this.model, {this.changeLoadingState});
@override @override
_UcafDetailScreenState createState() => _UcafDetailScreenState(); _UcafDetailScreenState createState() => _UcafDetailScreenState(this.patient, this.model);
} }
class _UcafDetailScreenState extends State<UcafDetailScreen> { class _UcafDetailScreenState extends State<UcafDetailScreen> {
final PatiantInformtion patient;
final UcafViewModel model;
UcafViewModel ucafModel;
int _activeTap = 0; int _activeTap = 0;
_UcafDetailScreenState(this.patient, this.model);
@override @override
Widget build(BuildContext context) { void initState() {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; model.saveUCAFOnTap = () async{
PatiantInformtion patient = routeArgs['patient']; widget.changeLoadingState(true);
String patientType = routeArgs['patientType']; await ucafModel.postUCAF(patient);
String arrivalType = routeArgs['arrivalType']; widget.changeLoadingState(false);
if (ucafModel.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context)
.postUcafSuccessMsg);
Navigator.of(context).popUntil((route) {
return route.settings.name ==
PATIENTS_PROFILE;
});
} else {
DrAppToastMsg.showErrorToast(ucafModel.error);
}
};
super.initState();
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
return BaseView<UcafViewModel>( return BaseView<UcafViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
model.resetDataInFirst(); ucafModel = model;
model.resetDataInFirst(firstPage: false);
await model.getLanguage(); await model.getLanguage();
await model.getPatientAssessment(patient); await model.getPatientAssessment(patient);
widget.changeLoadingState(false);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: false,
appBar: PatientProfileAppBar(
patient),
appBarTitle: TranslationBase.of(context).ucaf,
body: Column( body: Column(
children: [ children: [
Expanded( Expanded(
@ -58,35 +88,6 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// PatientHeaderWidgetNoAvatar(patient),
Container(
margin: EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).patient}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
fontWeight: FontWeight.w600,
),
AppText(
"${TranslationBase.of(context).ucaf}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 3,
fontWeight: FontWeight.bold,
)
],
),
),
PageStepperWidget(
stepsCount: 2,
currentStepIndex: 2,
screenSize: screenSize,
),
SizedBox(
height: 10,
),
Container( Container(
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
vertical: 16, horizontal: 16), vertical: 16, horizontal: 16),
@ -107,64 +108,7 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
), ),
), ),
), ),
Container(
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
child: Row(
children: [
Expanded(
child: Container(
child: AppButton(
title: TranslationBase.of(context).cancel,
hasBorder: true,
vPadding: 8,
hPadding: 8,
borderColor: Colors.white,
color: Colors.white,
fontColor: HexColor("#B8382B"),
fontSize: 2.2,
onPressed: () {
Navigator.of(context).popUntil((route) {
return route.settings.name ==
PATIENTS_PROFILE;
});
},
),
),
),
SizedBox(
width: 8,
),
Expanded(
child: Container(
child: AppButton(
title: TranslationBase.of(context).save,
hasBorder: true,
vPadding: 8,
hPadding: 8,
borderColor: HexColor("#B8382B"),
color: HexColor("#B8382B"),
fontColor: Colors.white,
fontSize: 2.0,
onPressed: () async {
await model.postUCAF(patient);
if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context)
.postUcafSuccessMsg);
Navigator.of(context).popUntil((route) {
return route.settings.name ==
PATIENTS_PROFILE;
});
} else {
DrAppToastMsg.showErrorToast(model.error);
}
},
),
),
),
],
),
),
], ],
), ),
)); ));
@ -210,12 +154,18 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
onTap: () async { onTap: () async {
print(__treatmentSteps.indexOf(item)); print(__treatmentSteps.indexOf(item));
if (__treatmentSteps.indexOf(item) == 0) { if (__treatmentSteps.indexOf(item) == 0) {
widget.changeLoadingState(true);
await model.getPatientAssessment(patient); await model.getPatientAssessment(patient);
widget.changeLoadingState(false);
} else if (__treatmentSteps.indexOf(item) == 1) { } else if (__treatmentSteps.indexOf(item) == 1) {
widget.changeLoadingState(true);
await model.getPrescription(patient); await model.getPrescription(patient);
widget.changeLoadingState(false);
} }
if (__treatmentSteps.indexOf(item) == 2) { if (__treatmentSteps.indexOf(item) == 2) {
widget.changeLoadingState(true);
await model.getOrderProcedures(patient); await model.getOrderProcedures(patient);
widget.changeLoadingState(false);
} }
setState(() { setState(() {
_activeTap = __treatmentSteps.indexOf(item); _activeTap = __treatmentSteps.indexOf(item);
@ -234,10 +184,15 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
case 0: case 0:
if (model.patientAssessmentList != null) { if (model.patientAssessmentList != null) {
return [ return [
...List.generate( ListView.builder(
model.patientAssessmentList.length, itemCount: model.patientAssessmentList.length,
(index) => DiagnosisWidget( scrollDirection: Axis.vertical,
model, model.patientAssessmentList[index])).toList() physics: ScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return DiagnosisWidget(
model, model.patientAssessmentList[index]);
})
]; ];
} else { } else {
return [ return [
@ -247,22 +202,30 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
break; break;
case 1: case 1:
return [ return [
...List.generate( ListView.builder(
model.prescriptionList != null itemCount: model.prescriptionList != null
? model.prescriptionList.entityList.length ? model.prescriptionList.entityList.length
: 0, : 0,
(index) => MedicationWidget( scrollDirection: Axis.vertical,
model, model.prescriptionList.entityList[index])).toList() physics: ScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return MedicationWidget(
model, model.prescriptionList.entityList[index]);
})
]; ];
break; break;
case 2: case 2:
if (model.orderProcedures != null) { if (model.orderProcedures != null) {
return [ return [
...List.generate( ListView.builder(
model.orderProcedures.length, itemCount: model.orderProcedures.length,
(index) => scrollDirection: Axis.vertical,
ProceduresWidget(model, model.orderProcedures[index])) physics: ScrollPhysics(),
.toList() shrinkWrap: true,
itemBuilder: (context, index) {
return ProceduresWidget(model, model.orderProcedures[index]);
})
]; ];
} else { } else {
return [ return [
@ -276,6 +239,7 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
]; ];
} }
} }
} }
class DiagnosisWidget extends StatelessWidget { class DiagnosisWidget extends StatelessWidget {

@ -19,11 +19,20 @@ import 'package:hexcolor/hexcolor.dart';
import '../../../../routes.dart'; import '../../../../routes.dart';
class UCAFInputScreen extends StatefulWidget { class UCAFInputScreen extends StatefulWidget {
final PatiantInformtion patient;
final Function changeLoadingState;
UCAFInputScreen(this.patient, {this.changeLoadingState});
@override @override
_UCAFInputScreenState createState() => _UCAFInputScreenState(); _UCAFInputScreenState createState() => _UCAFInputScreenState(this.patient);
} }
class _UCAFInputScreenState extends State<UCAFInputScreen> { class _UCAFInputScreenState extends State<UCAFInputScreen> {
final PatiantInformtion patient;
_UCAFInputScreenState(this.patient);
bool _inPatient = false; bool _inPatient = false;
bool _emergencyCase = false; bool _emergencyCase = false;
final _durationOfIllnessController = TextEditingController(); final _durationOfIllnessController = TextEditingController();
@ -53,21 +62,15 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
final screenSize = MediaQuery.of(context).size;
return BaseView<UcafViewModel>( return BaseView<UcafViewModel>(
onModelReady: (model) => model.getUCAFData(patient), onModelReady: (model) async {
model.resetDataInFirst();
await model.getUCAFData(patient);
widget.changeLoadingState(false);
},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: false,
appBar: PatientProfileAppBar(
patient),
appBarTitle: TranslationBase.of(context).ucaf,
body: model.patientVitalSignsHistory.length > 0 && body: model.patientVitalSignsHistory.length > 0 &&
model.patientChiefComplaintList != null && model.patientChiefComplaintList != null &&
model.patientChiefComplaintList.length > 0 model.patientChiefComplaintList.length > 0
@ -79,31 +82,6 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// PatientHeaderWidgetNoAvatar(patient), // PatientHeaderWidgetNoAvatar(patient),
Container(
margin: EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).patient}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
fontWeight: FontWeight.w600,
),
AppText(
"${TranslationBase.of(context).ucaf}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 3,
fontWeight: FontWeight.bold,
)
],
),
),
PageStepperWidget(
stepsCount: 2,
currentStepIndex: 1,
screenSize: screenSize,
),
Container( Container(
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
vertical: 0, horizontal: 16), vertical: 0, horizontal: 16),
@ -263,7 +241,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
), ),
/* SizedBox( /* SizedBox(
height: 4, height: 4,
), ),
AppText( AppText(
@ -323,7 +301,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
SizedBox( SizedBox(
height: 8, height: 8,
), ),
/* AppTextFieldCustom( /* AppTextFieldCustom(
hintText: TranslationBase.of(context).other, hintText: TranslationBase.of(context).other,
dropDownText: TranslationBase.of(context).none, dropDownText: TranslationBase.of(context).none,
enabled: false, enabled: false,
@ -400,21 +378,6 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
), ),
), ),
), ),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: AppButton(
title: TranslationBase.of(context).next,
color: HexColor("#D02127"),
onPressed: () {
Navigator.of(context).pushNamed(PATIENT_UCAF_DETAIL,
arguments: {
'patient': patient,
'patientType': patientType,
'arrivalType': arrivalType
});
},
),
),
], ],
) )
: Center( : Center(
@ -428,9 +391,10 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: AppText( child: AppText(
model.patientVitalSignsHistory.length == 0 model.patientVitalSignsHistory.length == 0
? TranslationBase.of(context).vitalSignEmptyMsg ? TranslationBase.of(context).vitalSignEmptyMsg
: TranslationBase.of(context).chiefComplaintEmptyMsg, : TranslationBase.of(context)
.chiefComplaintEmptyMsg,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: HexColor("#B8382B"), color: HexColor("#B8382B"),

@ -0,0 +1,214 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.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/patients/profile/UCAF/page-stepper-widget.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/material.dart';
import '../../../../routes.dart';
import 'UCAF-detail-screen.dart';
import 'UCAF-input-screen.dart';
class UCAFPagerScreen extends StatefulWidget {
const UCAFPagerScreen({Key key}) : super(key: key);
@override
_UCAFPagerScreenState createState() => _UCAFPagerScreenState();
}
class _UCAFPagerScreenState extends State<UCAFPagerScreen>
with TickerProviderStateMixin {
PageController _controller;
int _currentIndex = 0;
bool _isLoading = true;
PatiantInformtion patient;
String patientType;
String arrivalType;
changePageViewIndex(pageIndex, {isChangeState = true}) {
if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true);
_controller.jumpToPage(pageIndex);
setState(() {
_currentIndex = pageIndex;
});
}
void changeLoadingState(bool isLoading) {
setState(() {
_isLoading = isLoading;
});
}
@override
void initState() {
_controller = new PageController();
super.initState();
}
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient'];
patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType'];
final screenSize = MediaQuery.of(context).size;
return BaseView<UcafViewModel>(
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
isLoading: _isLoading,
appBar: PatientProfileAppBar(patient),
appBarTitle: TranslationBase.of(context).ucaf,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// PatientHeaderWidgetNoAvatar(patient),
Container(
margin: EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).patient}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
fontWeight: FontWeight.w600,
),
AppText(
"${TranslationBase.of(context).ucaf}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 3,
fontWeight: FontWeight.bold,
)
],
),
),
PageStepperWidget(
stepsCount: 2,
currentStepIndex: _currentIndex + 1,
screenSize: screenSize,
),
SizedBox(
height: 10,
),
Expanded(
child: Container(
color: Theme.of(context).scaffoldBackgroundColor,
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
UCAFInputScreen(
patient,
changeLoadingState: changeLoadingState,
),
UcafDetailScreen(
patient,
model,
changeLoadingState: changeLoadingState,
),
]),
),
),
],
),
),
),
_isLoading
? Container(
height: 0,
)
: ucafButtons(model),
],
),
));
}
Widget ucafButtons(UcafViewModel model) {
switch (_currentIndex) {
case 0:
return Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: AppButton(
title: TranslationBase.of(context).next,
color: Color(0xFFD02127),
onPressed: () {
changePageViewIndex(1);
// Navigator.of(context).pushNamed(PATIENT_UCAF_DETAIL, arguments: {
// 'patient': patient,
// 'patientType': patientType,
// 'arrivalType': arrivalType
// });
},
),
);
case 1:
return Container(
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
child: Row(
children: [
Expanded(
child: Container(
child: AppButton(
title: TranslationBase.of(context).cancel,
hasBorder: true,
vPadding: 8,
hPadding: 8,
borderColor: Colors.white,
color: Colors.white,
fontColor: Color(0xFFB8382B),
fontSize: 2.2,
onPressed: () {
Navigator.of(context).popUntil((route) {
return route.settings.name == PATIENTS_PROFILE;
});
},
),
),
),
SizedBox(
width: 8,
),
Expanded(
child: Container(
child: AppButton(
title: TranslationBase.of(context).save,
hasBorder: true,
vPadding: 8,
hPadding: 8,
borderColor: Color(0xFFB8382B),
color: Color(0xFFB8382B),
fontColor: Colors.white,
fontSize: 2.0,
onPressed: () {
model.saveUCAFOnTap();
},
),
),
),
],
),
);
default:
return Container();
}
}
}

@ -121,43 +121,6 @@ class LabResultWidget extends StatelessWidget {
(index) => Column( (index) => Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: FlowChartPage(
filterName:
patientLabResultList[index].description,
patientLabOrder: patientLabOrder,
patient: patient,
isInpatient: isInpatient,
),
// page: LabResultHistoryPage(
// filterName: patientLabResultList[index].description,
// patientLabOrder: patientLabOrder,
// patient: patient,
// ),
),
);
},
// child: AppText(
// " (show details)",
// color: Colors.blue,
// fontSize: 12,
// ),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
AppText(
TranslationBase.of(context).showMoreBtn,
textDecoration: TextDecoration.underline,
color: Colors.blue,
fontSize: 12,
),
],
),
),
Row( Row(
children: [ children: [
Expanded( Expanded(
@ -191,20 +154,67 @@ class LabResultWidget extends StatelessWidget {
), ),
), ),
Expanded( Expanded(
child: Container( child: Column(
padding: EdgeInsets.all(10), children: [
color: Colors.white, Container(
child: Center( padding: EdgeInsets.all(10),
child: AppText( color: Colors.white,
patientLabResultList[index].referanceRange, child: Center(
textAlign: TextAlign.center, child: AppText(
isCopyable: true, patientLabResultList[index].referanceRange,
textAlign: TextAlign.center,
isCopyable: true,
),
),
), ),
), SizedBox(
height: 12,
),
InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: FlowChartPage(
filterName:
patientLabResultList[index].description,
patientLabOrder: patientLabOrder,
patient: patient,
isInpatient: isInpatient,
),
// page: LabResultHistoryPage(
// filterName: patientLabResultList[index].description,
// patientLabOrder: patientLabOrder,
// patient: patient,
// ),
),
);
},
// child: AppText(
// " (show details)",
// color: Colors.blue,
// fontSize: 12,
// ),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
TranslationBase.of(context).showMoreBtn,
textDecoration: TextDecoration.underline,
color: Colors.blue,
fontSize: 12,
),
],
),
)
],
), ),
), ),
], ],
), ),
// SizedBox(
// height: 12,
// ),
Divider(), Divider(),
], ],
)) ))

@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrde
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
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/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -136,37 +137,44 @@ class _LabsHomePageState extends State<LabsHomePage> {
Radius.circular(8.0), Radius.circular(8.0),
), ),
color: Colors.white), color: Colors.white),
child: Row( child: Stack(
children: [ children: [
Container( Positioned(
width: 20, bottom: 1,
height: 160, top: 1,
decoration: BoxDecoration( left: 1,
color: model.patientLabOrdersList[index].isLiveCareAppointment child: Container(
? Colors.red[900] width: 20,
: !model.patientLabOrdersList[index].isInOutPatient decoration: BoxDecoration(
? Colors.black color: model.patientLabOrdersList[index].isLiveCareAppointment
: Color(0xffa9a089), ? Colors.red[900]
borderRadius: BorderRadius.only( : !model.patientLabOrdersList[index].isInOutPatient
topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), ? Colors.black
bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), : Color(0xffa9a089),
topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), borderRadius: BorderRadius.only(
bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)), topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0),
bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)),
),
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(
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),
),
)),
), ),
Expanded( Container(
color: Colors.white,
padding: EdgeInsets.all(0),
margin: EdgeInsets.only(left: 20),
child: DoctorCard( child: DoctorCard(
isNoMargin: true, isNoMargin: true,
onTap: () => Navigator.push( onTap: () => Navigator.push(

@ -212,7 +212,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
), ),
], ],
), ),
if ((isInpatient) if ((isInpatient && !isDischargedPatient)
? true ? true
: isFromLiveCare : isFromLiveCare
? patient.episodeNo != null ? patient.episodeNo != null

@ -18,7 +18,8 @@ import 'my-referral-patient-screen.dart';
class MyReferralInPatientScreen extends StatefulWidget { class MyReferralInPatientScreen extends StatefulWidget {
@override @override
_MyReferralInPatientScreenState createState() => _MyReferralInPatientScreenState(); _MyReferralInPatientScreenState createState() =>
_MyReferralInPatientScreenState();
} }
class _MyReferralInPatientScreenState extends State<MyReferralInPatientScreen> { class _MyReferralInPatientScreenState extends State<MyReferralInPatientScreen> {
@ -76,51 +77,87 @@ class _MyReferralInPatientScreenState extends State<MyReferralInPatientScreen> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
...List.generate( ListView.builder(
model.myReferralPatients.length, itemCount: model.myReferralPatients.length,
(index) => InkWell( scrollDirection: Axis.vertical,
onTap: () { physics: ScrollPhysics(),
if(patientType == PatientType.OUT_PATIENT) { shrinkWrap: true,
Navigator.push( itemBuilder: (context, index) {
context, return InkWell(
FadePage( onTap: () {
page: MyReferralDetailScreen(referralPatient: model.myReferralPatients[index]), if (patientType ==
), PatientType.OUT_PATIENT) {
); Navigator.push(
} else{ context,
Navigator.push( FadePage(
context, page: MyReferralDetailScreen(
FadePage( referralPatient: model
page: ReferralPatientDetailScreen(model.myReferralPatients[index], model), .myReferralPatients[index]),
), ),
); );
} } else {
Navigator.push(
}, context,
child: PatientReferralItemWidget( FadePage(
referralStatus: model.getReferralStatusNameByCode( page: ReferralPatientDetailScreen(
model.myReferralPatients[index].referralStatus, context), model.myReferralPatients[index],
referralStatusCode: model.myReferralPatients[index].referralStatus, model),
patientName: model.myReferralPatients[index].patientName, ),
patientGender: model.myReferralPatients[index].gender, );
referredDate: AppDateUtils.getDayMonthYearDateFormatted( }
model.myReferralPatients[index].referralDate), },
referredTime: AppDateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate), child: PatientReferralItemWidget(
patientID: "${model.myReferralPatients[index].patientID}", referralStatus:
isSameBranch: false, model.getReferralStatusNameByCode(
isReferral: true, model.myReferralPatients[index]
isReferralClinic: true, .referralStatus,
referralClinic: "${model.myReferralPatients[index].referringClinicDescription}", context),
remark: model.myReferralPatients[index].referringDoctorRemarks, referralStatusCode: model
nationality: model.myReferralPatients[index].nationalityName, .myReferralPatients[index]
nationalityFlag: model.myReferralPatients[index].nationalityFlagURL, .referralStatus,
doctorAvatar: model.myReferralPatients[index].doctorImageURL, patientName: model
referralDoctorName: model.myReferralPatients[index].referringDoctorName, .myReferralPatients[index]
clinicDescription: model.myReferralPatients[index].referringClinicDescription, .patientName,
infoIcon: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black), patientGender: model
), .myReferralPatients[index].gender,
), referredDate: AppDateUtils
), .getDayMonthYearDateFormatted(model
.myReferralPatients[index]
.referralDate),
referredTime: AppDateUtils.getTimeHHMMA(
model.myReferralPatients[index]
.referralDate),
patientID:
"${model.myReferralPatients[index].patientID}",
isSameBranch: false,
isReferral: true,
isReferralClinic: true,
referralClinic:
"${model.myReferralPatients[index].referringClinicDescription}",
remark: model.myReferralPatients[index]
.referringDoctorRemarks,
nationality: model
.myReferralPatients[index]
.nationalityName,
nationalityFlag: model
.myReferralPatients[index]
.nationalityFlagURL,
doctorAvatar: model
.myReferralPatients[index]
.doctorImageURL,
referralDoctorName: model
.myReferralPatients[index]
.referringDoctorName,
clinicDescription: model
.myReferralPatients[index]
.referringClinicDescription,
infoIcon: Icon(
FontAwesomeIcons.arrowRight,
size: 25,
color: Colors.black),
),
);
})
], ],
), ),
), ),

@ -13,7 +13,6 @@ import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class ReferredPatientScreen extends StatefulWidget { class ReferredPatientScreen extends StatefulWidget {
@override @override
_ReferredPatientScreenState createState() => _ReferredPatientScreenState(); _ReferredPatientScreenState createState() => _ReferredPatientScreenState();
} }
@ -69,79 +68,87 @@ class _ReferredPatientScreenState extends State<ReferredPatientScreen> {
), ),
) )
: Expanded( : Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
// DoctorApplication.svc/REST/GtMyReferredPatient // DoctorApplication.svc/REST/GtMyReferredPatient
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
...List.generate( ListView.builder(
model.listMyReferredPatientModel.length, itemCount:
(index) => InkWell( model.listMyReferredPatientModel.length,
onTap: () { scrollDirection: Axis.vertical,
Navigator.push( physics: ScrollPhysics(),
context, shrinkWrap: true,
FadePage( itemBuilder: (context, index) {
page: ReferredPatientDetailScreen( return InkWell(
model.getReferredPatientItem(index), this.patientType), onTap: () {
), Navigator.push(
); context,
}, FadePage(
child: PatientReferralItemWidget( page: ReferredPatientDetailScreen(
referralStatus: model model.getReferredPatientItem(index),
.getReferredPatientItem(index) this.patientType),
.referralStatusDesc, ),
referralStatusCode: model );
.getReferredPatientItem(index) },
.referralStatus, child: PatientReferralItemWidget(
patientName: referralStatus: model
"${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", .getReferredPatientItem(index)
patientGender: .referralStatusDesc,
model.getReferredPatientItem(index).gender, referralStatusCode: model
referredDate: .getReferredPatientItem(index)
AppDateUtils.convertDateFromServerFormat( .referralStatus,
model patientName:
.getReferredPatientItem(index) "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}",
.referralDate, patientGender: model
"dd/MM/yyyy"), .getReferredPatientItem(index)
referredTime: .gender,
AppDateUtils.convertDateFromServerFormat( referredDate: AppDateUtils
model .convertDateFromServerFormat(
.getReferredPatientItem(index) model
.referralDate, .getReferredPatientItem(index)
"hh:mm a"), .referralDate,
patientID: "dd/MM/yyyy"),
"${model.getReferredPatientItem(index).patientID}", referredTime: AppDateUtils
isSameBranch: model .convertDateFromServerFormat(
.getReferredPatientItem(index) model
.isReferralDoctorSameBranch, .getReferredPatientItem(index)
isReferral: false, .referralDate,
remark: model "hh:mm a"),
.getReferredPatientItem(index) patientID:
.referringDoctorRemarks, "${model.getReferredPatientItem(index).patientID}",
nationality: model isSameBranch: model
.getReferredPatientItem(index) .getReferredPatientItem(index)
.nationalityName, .isReferralDoctorSameBranch,
nationalityFlag: model isReferral: false,
.getReferredPatientItem(index) remark: model
.nationalityFlagURL, .getReferredPatientItem(index)
doctorAvatar: model .referringDoctorRemarks,
.getReferredPatientItem(index) nationality: model
.doctorImageURL, .getReferredPatientItem(index)
referralDoctorName: .nationalityName,
"${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}", nationalityFlag: model
clinicDescription: model .getReferredPatientItem(index)
.getReferredPatientItem(index) .nationalityFlagURL,
.referralClinicDescription, doctorAvatar: model
infoIcon: Icon(FontAwesomeIcons.arrowRight, .getReferredPatientItem(index)
size: 25, color: Colors.black), .doctorImageURL,
), referralDoctorName:
), "${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}",
clinicDescription: model
.getReferredPatientItem(index)
.referralClinicDescription,
infoIcon: Icon(FontAwesomeIcons.arrowRight,
size: 25, color: Colors.black),
),
);
},
), ),
], ],
), ),
), ),
), ),
), ),
], ],
), ),
), ),

@ -1,7 +1,6 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.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/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';

@ -21,7 +21,7 @@ class SOAPStepHeader extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: SizeConfig.isHeightVeryShort?30: 15,), SizedBox(height: SizeConfig.isHeightVeryShort?30:SizeConfig.isHeightShort?35: 15,),
AppText( AppText(
TranslationBase.of(context).createNew, TranslationBase.of(context).createNew,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge? 3: 4), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge? 3: 4),

@ -1,7 +1,6 @@
// ignore: must_be_immutable // ignore: must_be_immutable
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';

@ -1,16 +1,9 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart';
import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart';
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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart';
@ -33,13 +26,18 @@ class UpdateSubjectivePage extends StatefulWidget {
final int currentIndex; final int currentIndex;
UpdateSubjectivePage( UpdateSubjectivePage(
{Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex}); {Key key,
this.changePageViewIndex,
this.patientInfo,
this.changeLoadingState,
this.currentIndex});
@override @override
_UpdateSubjectivePageState createState() => _UpdateSubjectivePageState(); _UpdateSubjectivePageState createState() => _UpdateSubjectivePageState();
} }
class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements SubjectiveCallBack { class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
implements SubjectiveCallBack {
bool isChiefExpand = false; bool isChiefExpand = false;
bool isHistoryExpand = false; bool isHistoryExpand = false;
bool isAllergiesExpand = false; bool isAllergiesExpand = false;
@ -55,7 +53,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
widget.changeLoadingState(true); widget.changeLoadingState(true);
if (model.patientHistoryList.isNotEmpty) { if (model.patientHistoryList.isNotEmpty) {
model.patientHistoryList.forEach((element) { model.patientHistoryList.forEach((element) {
if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) { if (element.historyType ==
MasterKeysService.HistoryFamily.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey( MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistoryFamily, masterKeys: MasterKeysService.HistoryFamily,
id: element.historyId, id: element.historyId,
@ -63,11 +62,15 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory( SoapUtils.generateMySelectedHistory(
history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false); history: history,
isChecked: element.isChecked,
remark: element.remarks,
isLocal: false);
myHistoryList.add(mySelectedHistory); myHistoryList.add(mySelectedHistory);
} }
} }
if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) { if (element.historyType ==
MasterKeysService.HistoryMedical.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey( MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistoryMedical, masterKeys: MasterKeysService.HistoryMedical,
id: element.historyId, id: element.historyId,
@ -75,11 +78,15 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory( SoapUtils.generateMySelectedHistory(
history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false); history: history,
isChecked: element.isChecked,
remark: element.remarks,
isLocal: false);
myHistoryList.add(mySelectedHistory); myHistoryList.add(mySelectedHistory);
} }
} }
if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) { if (element.historyType ==
MasterKeysService.HistorySports.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey( MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistorySports, masterKeys: MasterKeysService.HistorySports,
id: element.historyId, id: element.historyId,
@ -87,11 +94,15 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory( SoapUtils.generateMySelectedHistory(
history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false); history: history,
isChecked: element.isChecked,
remark: element.remarks,
isLocal: false);
myHistoryList.add(mySelectedHistory); myHistoryList.add(mySelectedHistory);
} }
} }
if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) { if (element.historyType ==
MasterKeysService.HistorySurgical.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey( MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistorySurgical, masterKeys: MasterKeysService.HistorySurgical,
id: element.historyId, id: element.historyId,
@ -99,7 +110,10 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
if (history != null) { if (history != null) {
MySelectedHistory mySelectedHistory = MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory( SoapUtils.generateMySelectedHistory(
history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false); history: history,
isChecked: element.isChecked,
remark: element.remarks,
isLocal: false);
myHistoryList.add(mySelectedHistory); myHistoryList.add(mySelectedHistory);
} }
} }
@ -108,15 +122,19 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
} }
getAllergies(SOAPViewModel model) async { getAllergies(SOAPViewModel model) async {
if (model.patientAllergiesList.isNotEmpty) { if (model.patientAllergiesList.isNotEmpty) {
model.patientAllergiesList.forEach((element) { model.patientAllergiesList.forEach((element) {
MasterKeyModel selectedAllergy = model.getOneMasterKey( MasterKeyModel selectedAllergy = model.getOneMasterKey(
masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); masterKeys: MasterKeysService.Allergies,
id: element.allergyDiseaseId,
typeId: element.allergyDiseaseType);
MasterKeyModel selectedAllergySeverity; MasterKeyModel selectedAllergySeverity;
if (element.severity == 0) { if (element.severity == 0) {
selectedAllergySeverity = MasterKeyModel( selectedAllergySeverity = MasterKeyModel(
id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: ''); id: 0,
typeId: MasterKeysService.AllergySeverity.getMasterKeyService(),
nameAr: '',
nameEn: '');
} else { } else {
selectedAllergySeverity = model.getOneMasterKey( selectedAllergySeverity = model.getOneMasterKey(
masterKeys: MasterKeysService.AllergySeverity, masterKeys: MasterKeysService.AllergySeverity,
@ -124,15 +142,17 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
); );
} }
MySelectedAllergy mySelectedAllergy = SoapUtils.generateMySelectedAllergy( MySelectedAllergy mySelectedAllergy =
allergy: selectedAllergy, SoapUtils.generateMySelectedAllergy(
isChecked: element.isChecked, allergy: selectedAllergy,
createdBy: element.createdBy, isChecked: element.isChecked,
remark: element.remarks, createdBy: element.createdBy,
isLocal: false, remark: element.remarks,
allergySeverity: selectedAllergySeverity); isLocal: false,
allergySeverity: selectedAllergySeverity);
if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy); if (selectedAllergy != null && selectedAllergySeverity != null)
myAllergiesList.add(mySelectedAllergy);
}); });
} }
} }
@ -148,11 +168,14 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
if (model.patientChiefComplaintList.isNotEmpty) { if (model.patientChiefComplaintList.isNotEmpty) {
isChiefExpand = true; isChiefExpand = true;
complaintsController.text = Helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint); complaintsController.text = Helpers.parseHtmlString(
model.patientChiefComplaintList[0].chiefComplaint);
illnessController.text = model.patientChiefComplaintList[0].hopi; illnessController.text = model.patientChiefComplaintList[0].hopi;
medicationController.text = !(model.patientChiefComplaintList[0].currentMedication).isNotEmpty medicationController.text =
? model.patientChiefComplaintList[0].currentMedication + '\n \n' !(model.patientChiefComplaintList[0].currentMedication).isNotEmpty
: model.patientChiefComplaintList[0].currentMedication; ? model.patientChiefComplaintList[0].currentMedication +
'\n \n'
: model.patientChiefComplaintList[0].currentMedication;
} }
if (widget.patientInfo.admissionNo == null) { if (widget.patientInfo.admissionNo == null) {
await getHistory(model); await getHistory(model);
@ -200,7 +223,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
isExpanded: isChiefExpand, isExpanded: isChiefExpand,
), ),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2), height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 4 : 2),
), ),
if (widget.patientInfo.admissionNo == null) if (widget.patientInfo.admissionNo == null)
ExpandableSOAPWidget( ExpandableSOAPWidget(
@ -212,12 +236,15 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
}); });
}, },
child: Column( child: Column(
children: [UpdateHistoryWidget(myHistoryList: myHistoryList)], children: [
UpdateHistoryWidget(myHistoryList: myHistoryList)
],
), ),
isExpanded: isHistoryExpand, isExpanded: isHistoryExpand,
), ),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2), height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 4 : 2),
), ),
if (widget.patientInfo.admissionNo == null) if (widget.patientInfo.admissionNo == null)
ExpandableSOAPWidget( ExpandableSOAPWidget(
@ -241,7 +268,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
isExpanded: isAllergiesExpand, isExpanded: isAllergiesExpand,
), ),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : 10), height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 20 : 10),
), ),
], ],
), ),
@ -253,7 +281,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
} }
addSubjectiveInfo( addSubjectiveInfo(
{SOAPViewModel model, List<MySelectedAllergy> myAllergiesList, List<MySelectedHistory> myHistoryList}) async { {SOAPViewModel model,
List<MySelectedAllergy> myAllergiesList,
List<MySelectedHistory> myHistoryList}) async {
if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus(); if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus();
widget.changeLoadingState(true); widget.changeLoadingState(true);
formKey.currentState.save(); formKey.currentState.save();
@ -265,22 +295,15 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
if (complaintsController.text.isNotEmpty && if (complaintsController.text.isNotEmpty &&
illnessController.text.isNotEmpty && illnessController.text.isNotEmpty &&
complaintsController.text.length > 25) { complaintsController.text.length > 25) {
await postChiefComplaint(model: model); await model.postSubjectServices(
if (model.state == ViewState.ErrorLocal) { patientInfo: widget.patientInfo,
Helpers.showErrorToast(model.error); complaintsText: complaintsController.text,
} medicationText: medicationController.text,
if (myHistoryList.length != 0) { illnessText: illnessController.text,
await postHistories(model: model, myHistoryList: myHistoryList); myHistoryList: myHistoryList,
if (model.state == ViewState.ErrorLocal) { myAllergiesList: myAllergiesList,
Helpers.showErrorToast(model.error); );
}
}
if (myAllergiesList.length != 0) {
await postAllergy(myAllergiesList: myAllergiesList, model: model);
if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error);
}
}
widget.changeLoadingState(true); widget.changeLoadingState(true);
widget.changePageViewIndex(1); widget.changePageViewIndex(1);
@ -311,112 +334,11 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
} }
} }
postAllergy(
{List<MySelectedAllergy> myAllergiesList, SOAPViewModel model}) async {
PostAllergyRequestModel postAllergyRequestModel =
new PostAllergyRequestModel();
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
myAllergiesList.forEach((allergy) {
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM ==
null)
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(
ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.typeId,
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
severity: allergy.selectedAllergySeverity.id,
remarks: allergy.remark,
createdBy: allergy.createdBy ?? doctorProfile.doctorID,
createdOn: DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
isChecked: allergy.isChecked,
isUpdatedByNurse: false));
});
if (model.patientAllergiesList.isEmpty) {
await model.postAllergy(postAllergyRequestModel);
} else {
await model.patchAllergy(postAllergyRequestModel);
}
if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error);
}
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
doctorID: '',
editedBy: '');
await model.getPatientAllergy(generalGetReqForSOAP, isLocalBusy: true);
if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error);
}
}
postHistories(
{List<MySelectedHistory> myHistoryList, SOAPViewModel model}) async {
PostHistoriesRequestModel postHistoriesRequestModel =
new PostHistoriesRequestModel(doctorID: '');
myHistoryList.forEach((history) {
if (postHistoriesRequestModel.listMedicalHistoryVM == null)
postHistoriesRequestModel.listMedicalHistoryVM = [];
postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
remarks: "",
historyId: history.selectedHistory.id,
historyType: history.selectedHistory.typeId,
isChecked: history.isChecked,
));
});
if (model.patientHistoryList.isEmpty) {
await model.postHistories(postHistoriesRequestModel);
} else {
await model.patchHistories(postHistoriesRequestModel);
}
if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error);
}
}
postChiefComplaint({SOAPViewModel model}) async {
formKey.currentState.save();
if (formKey.currentState.validate()) {
PostChiefComplaintRequestModel postChiefComplaintRequestModel = new PostChiefComplaintRequestModel(
admissionNo: widget.patientInfo.admissionNo != null ? int.parse(widget.patientInfo.admissionNo) : null,
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo ?? 0,
appointmentNo: widget.patientInfo.appointmentNo ?? 0,
chiefComplaint: complaintsController.text,
currentMedication: medicationController.text,
hopi: illnessController.text,
isLactation: false,
ispregnant: false,
doctorID: '',
numberOfWeeks: 0);
if (model.patientChiefComplaintList.isEmpty) {
postChiefComplaintRequestModel.editedBy = '';
await model.postChiefComplaint(postChiefComplaintRequestModel);
} else {
postChiefComplaintRequestModel.editedBy = '';
await model.patchChiefComplaint(postChiefComplaintRequestModel);
}
}
}
@override @override
Function nextFunction(model) { Function nextFunction(model) {
addSubjectiveInfo(model: model, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList); addSubjectiveInfo(
model: model,
myAllergiesList: myAllergiesList,
myHistoryList: myHistoryList);
} }
} }

@ -91,7 +91,8 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
TranslationBase.of(context).direction, TranslationBase.of(context).direction,
color: Colors.grey, color: Colors.grey,
), ),
Expanded(child: AppText(" " + prescriptions.directionID.toString() ?? '')), Expanded(
child: AppText(" " + prescriptions.directionDescription.toString() ?? '')),
], ],
), ),
Row( Row(
@ -100,7 +101,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
TranslationBase.of(context).route, TranslationBase.of(context).route,
color: Colors.grey, color: Colors.grey,
), ),
AppText(" " + prescriptions.routeId.toString() ?? ''), AppText(" " + prescriptions.routeDescription.toString() ?? ''),
], ],
), ),
Row( Row(
@ -109,7 +110,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
TranslationBase.of(context).refill, TranslationBase.of(context).refill,
color: Colors.grey, color: Colors.grey,
), ),
Expanded(child: AppText(" " + prescriptions.refillID.toString() ?? '')), Expanded(child: AppText(" " + prescriptions.refillDescription.toString() ?? '')),
], ],
), ),
Row( Row(
@ -150,7 +151,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
'UOM', 'UOM',
color: Colors.grey, color: Colors.grey,
), ),
AppText(" " + prescriptions.unitofMeasurement.toString() ?? ''), AppText(" " + prescriptions.uomDescription.toString() ?? ''),
], ],
), ),
Row( Row(
@ -177,18 +178,18 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
TranslationBase.of(context).processed, TranslationBase.of(context).processed,
color: Colors.grey, color: Colors.grey,
), ),
// AppText(" " + prescriptions.editedBy.toString() ?? ''), AppText(" " + prescriptions.doctorName.toString() ?? ''),
],
),
Row(
children: [
AppText(
TranslationBase.of(context).dailyDoses,
color: Colors.grey,
),
AppText(" " + prescriptions.dose.toString() ?? ''),
], ],
), ),
// Row(
// children: [
// AppText(
// TranslationBase.of(context).num,
// color: Colors.grey,
// ),
// AppText(" " + prescriptions.dose.toString() ?? ''),
// ],
// ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),

@ -196,7 +196,7 @@ class PrescriptionsPage extends StatelessWidget {
appointmentDate: AppDateUtils.getDateTimeFromServerFormat( appointmentDate: AppDateUtils.getDateTimeFromServerFormat(
model.medicationForInPatient[index].prescriptionDatetime, model.medicationForInPatient[index].prescriptionDatetime,
), ),
createdBy: model.medicationForInPatient[index].createdBy.toString(), createdBy: model.medicationForInPatient[index].doctorName.toString(),
)); ));
}), }),
if (model.medicationForInPatient.length == 0) if (model.medicationForInPatient.length == 0)

@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/screens/procedures/procedure_checkout_screen.
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -46,10 +47,8 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => onModelReady: (model) => model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId()),
model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId()), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold(
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: false, isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
body: Column( body: Column(
@ -57,97 +56,100 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
Container( Container(
height: MediaQuery.of(context).size.height * 0.070, height: MediaQuery.of(context).size.height * 0.070,
), ),
if (model.templateList.length != 0) (model.templateList.length != 0)
Expanded( ? Expanded(
child: EntityListCheckboxSearchFavProceduresWidget( child: EntityListCheckboxSearchFavProceduresWidget(
isProcedure: !(widget.procedureType == ProcedureType.PRESCRIPTION), isProcedure: !(widget.procedureType == ProcedureType.PRESCRIPTION),
model: model, model: model,
removeFavProcedure: (item) { removeFavProcedure: (item) {
setState(() { setState(() {
entityList.remove(item); entityList.remove(item);
}); });
}, },
addFavProcedure: (history) { addFavProcedure: (history) {
setState(() { setState(() {
entityList.add(history); entityList.add(history);
}); });
}, },
isEntityFavListSelected: (master) => isEntityFavListSelected: (master) => isEntityListSelected(master),
isEntityListSelected(master), groupProcedures: groupProcedures,
groupProcedures: groupProcedures, selectProcedures: (selectedProcedure) {
selectProcedures: (selectedProcedure) { setState(() {
setState(() { groupProcedures = selectedProcedure;
groupProcedures = selectedProcedure; });
}); },
}, ),
), )
), : Container(
Container( child: Padding(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), padding: EdgeInsets.symmetric(vertical: 50.0),
child: Wrap( child: AppText('You Don\'t have favorite prescription'),
alignment: WrapAlignment.center, ),
children: <Widget>[
AppButton(
title: widget.procedureType.getAddButtonTitle(context) ??
TranslationBase.of(context).addSelectedProcedures,
color: Color(0xff359846),
fontWeight: FontWeight.w700,
onPressed: () {
if(widget.procedureType == ProcedureType.PRESCRIPTION){
if (groupProcedures == null) {
DrAppToastMsg.showErrorToast(
'Please Select item ',
);
return;
}
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PrescriptionCheckOutScreen(
patient: widget.patient,
model: widget.prescriptionModel,
groupProcedures: groupProcedures,
), settings: RouteSettings(name: 'PrescriptionCheckOutScreen')
),
);
} else {
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
.fillTheMandatoryProcedureDetails,
);
return;
}
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ProcedureCheckOutScreen(
items: entityList,
model: model,
patient: widget.patient,
addButtonTitle: widget.procedureType.getAddButtonTitle(context),
toolbarTitle: widget.procedureType.getToolbarLabel(context),
), settings: RouteSettings(name: 'ProcedureCheckOutScreen')
),
);
}
},
), ),
],
),
),
], ],
), ),
bottomSheet: Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: widget.procedureType.getAddButtonTitle(context) ??
TranslationBase.of(context).addSelectedProcedures,
color: Color(0xff359846),
disabled: model.templateList.length == 0 ? true : false,
fontWeight: FontWeight.w700,
onPressed: () {
if (widget.procedureType == ProcedureType.PRESCRIPTION) {
if (groupProcedures == null) {
DrAppToastMsg.showErrorToast(
'Please Select item ',
);
return;
}
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PrescriptionCheckOutScreen(
patient: widget.patient,
model: widget.prescriptionModel,
groupProcedures: groupProcedures,
),
settings: RouteSettings(name: 'PrescriptionCheckOutScreen')),
);
} else {
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).fillTheMandatoryProcedureDetails,
);
return;
}
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ProcedureCheckOutScreen(
items: entityList,
model: model,
patient: widget.patient,
addButtonTitle: widget.procedureType.getAddButtonTitle(context),
toolbarTitle: widget.procedureType.getToolbarLabel(context),
),
settings: RouteSettings(name: 'ProcedureCheckOutScreen')),
);
}
},
),
],
),
),
), ),
); );
} }
bool isEntityListSelected(ProcedureTempleteDetailsModel masterKey) { bool isEntityListSelected(ProcedureTempleteDetailsModel masterKey) {
Iterable<ProcedureTempleteDetailsModel> history = entityList.where( Iterable<ProcedureTempleteDetailsModel> history = entityList.where(
(element) => (element) => masterKey.templateID == element.templateID && masterKey.procedureName == element.procedureName);
masterKey.templateID == element.templateID &&
masterKey.procedureName == element.procedureName);
if (history.length > 0) { if (history.length > 0) {
return true; return true;
} }

@ -35,12 +35,9 @@ class ProcedureScreen extends StatelessWidget {
bool isFromLiveCare = routeArgs['isFromLiveCare']; bool isFromLiveCare = routeArgs['isFromLiveCare'];
bool isInpatient = routeArgs['isInpatient']; bool isInpatient = routeArgs['isInpatient'];
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getProcedure( onModelReady: (model) =>
mrn: patient.patientId, model.getProcedure(mrn: patient.patientId, patientType: patientType, appointmentNo: patient.appointmentNo),
patientType: patientType, builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold(
),
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.grey[100], backgroundColor: Colors.grey[100],
baseViewModel: model, baseViewModel: model,
@ -56,8 +53,7 @@ class ProcedureScreen extends StatelessWidget {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
if (model.procedureList.length == 0 && if (model.procedureList.length == 0 && patient.patientStatusType != 43)
patient.patientStatusType != 43)
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
@ -77,8 +73,7 @@ class ProcedureScreen extends StatelessWidget {
], ],
), ),
), ),
if (patient.patientStatusType != null && if (patient.patientStatusType != null && patient.patientStatusType == 43)
patient.patientStatusType == 43)
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
@ -98,20 +93,19 @@ class ProcedureScreen extends StatelessWidget {
], ],
), ),
), ),
if ((patient.patientStatusType != null && if ((patient.patientStatusType != null && patient.patientStatusType == 43) ||
patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null)) (isFromLiveCare && patient.appointmentNo != null))
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => BaseAddProcedureTabPage( builder: (context) => BaseAddProcedureTabPage(
patient: patient, patient: patient,
model: model, model: model,
procedureType: ProcedureType.PROCEDURE, procedureType: ProcedureType.PROCEDURE,
), settings: RouteSettings(name: 'AddProcedureTabPage') ),
), settings: RouteSettings(name: 'AddProcedureTabPage')),
); );
}, },
child: Container( child: Container(
@ -159,32 +153,21 @@ class ProcedureScreen extends StatelessWidget {
...List.generate( ...List.generate(
model.procedureList[0].rowcount, model.procedureList[0].rowcount,
(index) => ProcedureCard( (index) => ProcedureCard(
categoryID: categoryID: model.procedureList[0].entityList[index].categoryID,
model.procedureList[0].entityList[index].categoryID,
entityList: model.procedureList[0].entityList[index], entityList: model.procedureList[0].entityList[index],
onTap: () { onTap: () {
if (model.procedureList[0].entityList[index].categoryID == if (model.procedureList[0].entityList[index].categoryID == 2 ||
2 ||
model.procedureList[0].entityList[index].categoryID == 4) model.procedureList[0].entityList[index].categoryID == 4)
updateProcedureForm(context, updateProcedureForm(context,
model: model, model: model,
patient: patient, patient: patient,
remarks: model remarks: model.procedureList[0].entityList[index].remarks,
.procedureList[0].entityList[index].remarks, orderType: model.procedureList[0].entityList[index].orderType.toString(),
orderType: model orderNo: model.procedureList[0].entityList[index].orderNo,
.procedureList[0].entityList[index].orderType procedureName: model.procedureList[0].entityList[index].procedureName,
.toString(), categoreId: model.procedureList[0].entityList[index].categoryID.toString(),
orderNo: model procedureId: model.procedureList[0].entityList[index].procedureId,
.procedureList[0].entityList[index].orderNo, limetNo: model.procedureList[0].entityList[index].lineItemNo);
procedureName: model.procedureList[0]
.entityList[index].procedureName,
categoreId: model
.procedureList[0].entityList[index].categoryID
.toString(),
procedureId: model.procedureList[0]
.entityList[index].procedureId,
limetNo: model.procedureList[0].entityList[index]
.lineItemNo);
// } else // } else
// Helpers.showErrorToast( // Helpers.showErrorToast(
// 'You Cant Update This Procedure'); // 'You Cant Update This Procedure');
@ -194,8 +177,7 @@ class ProcedureScreen extends StatelessWidget {
), ),
), ),
if (model.state == ViewState.ErrorLocal || if (model.state == ViewState.ErrorLocal ||
(model.procedureList.isNotEmpty && (model.procedureList.isNotEmpty && model.procedureList[0].entityList.isEmpty))
model.procedureList[0].entityList.isEmpty))
Center( Center(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -206,9 +188,7 @@ class ProcedureScreen extends StatelessWidget {
Image.asset('assets/images/no-data.png'), Image.asset('assets/images/no-data.png'),
Padding( Padding(
padding: const EdgeInsets.all(22.0), padding: const EdgeInsets.all(22.0),
child: AppText(model.procedureList.isEmpty child: AppText(model.procedureList.isEmpty ? model.error : 'No Procedure Found '),
? model.error
: 'No Procedure Found '),
) )
], ],
), ),

@ -22,6 +22,7 @@ import 'package:provider/provider.dart';
class AddSickLeavScreen extends StatelessWidget { class AddSickLeavScreen extends StatelessWidget {
PatiantInformtion patient; PatiantInformtion patient;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context); ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context);
@ -31,8 +32,10 @@ class AddSickLeavScreen extends StatelessWidget {
bool isInpatient = routeArgs['isInpatient']; bool isInpatient = routeArgs['isInpatient'];
return BaseView<SickLeaveViewModel>( return BaseView<SickLeaveViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
await model.getSickLeavePatient(patient.patientMRN ?? patient.patientId); await model
await model.getSickLeaveDoctor(patient.patientMRN ?? patient.patientId); .getSickLeavePatient(patient.patientMRN ?? patient.patientId);
await model
.getSickLeaveDoctor(patient.patientMRN ?? patient.patientId);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
@ -79,17 +82,21 @@ class AddSickLeavScreen extends StatelessWidget {
}, },
child: Container( child: Container(
width: SizeConfig.screenWidth, width: SizeConfig.screenWidth,
margin: EdgeInsets.only(left: 20, right: 20, top: 10, bottom: 10), margin: EdgeInsets.only(
left: 20, right: 20, top: 10, bottom: 10),
padding: EdgeInsets.all(20), padding: EdgeInsets.all(20),
decoration: decoration: BoxDecoration(
BoxDecoration(borderRadius: BorderRadius.circular(10), color: HexColor('#EAEAEA')), borderRadius: BorderRadius.circular(10),
color: HexColor('#EAEAEA')),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Container( Container(
child: Container( child: Container(
decoration: decoration: BoxDecoration(
BoxDecoration(color: Colors.grey, borderRadius: BorderRadius.circular(10)), color: Colors.grey,
borderRadius:
BorderRadius.circular(10)),
padding: EdgeInsets.all(3), padding: EdgeInsets.all(3),
child: IconButton( child: IconButton(
icon: Icon( icon: Icon(
@ -106,7 +113,9 @@ class AddSickLeavScreen extends StatelessWidget {
), ),
)), )),
Padding( Padding(
child: AppText(TranslationBase.of(context).noSickLeaveApplied, child: AppText(
TranslationBase.of(context)
.noSickLeaveApplied,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 16, fontSize: 16,
@ -122,7 +131,8 @@ class AddSickLeavScreen extends StatelessWidget {
: SizedBox(), : SizedBox(),
model.getAllSIckLeavePatient.length > 0 model.getAllSIckLeavePatient.length > 0
? Column( ? Column(
children: model.getAllSIckLeavePatient.map<Widget>((SickLeavePatientModel item) { children: model.getAllSIckLeavePatient
.map<Widget>((SickLeavePatientModel item) {
return RoundedContainer( return RoundedContainer(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
child: Column( child: Column(
@ -141,7 +151,8 @@ class AddSickLeavScreen extends StatelessWidget {
// ))), // ))),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 4, flex: 4,
@ -150,7 +161,8 @@ class AddSickLeavScreen extends StatelessWidget {
// MainAxisAlignment.start, // MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
padding: EdgeInsets.all(3), padding: EdgeInsets.all(3),
@ -168,7 +180,8 @@ class AddSickLeavScreen extends StatelessWidget {
// : TranslationBase // : TranslationBase
// .of(context) // .of(context)
// .all, // .all,
fontWeight: FontWeight.bold, fontWeight:
FontWeight.bold,
// color: item.status == 1 // color: item.status == 1
// ? Colors.yellow[800] // ? Colors.yellow[800]
// : item.status == 2 // : item.status == 2
@ -179,25 +192,48 @@ class AddSickLeavScreen extends StatelessWidget {
), ),
Row( Row(
children: [ children: [
AppText(TranslationBase.of(context).daysSickleave + ": "), AppText(TranslationBase
.of(context)
.daysSickleave +
": "),
AppText( AppText(
item.sickLeaveDays.toString() ?? item.noOfDays.toString(), (item.sickLeaveDays
fontWeight: FontWeight.bold, .toString() !=
null &&
item.sickLeaveDays
.toString() !=
"null")
? item.sickLeaveDays
.toString()
: item.noOfDays
.toString(),
fontWeight:
FontWeight.bold,
), ),
], ],
), ),
Row( Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context).startDate + ' ' ?? "", TranslationBase.of(
context)
.startDate +
' ' ??
"",
), ),
Flexible( Flexible(
child: AppText( child: AppText(
AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.getDayMonthYearDateFormatted(item
item.startDate.contains("/Date(") .startDate
? AppDateUtils.convertStringToDate(item.startDate) .contains(
: DateTime.parse(item.startDate)), "/Date(")
fontWeight: FontWeight.bold, ? AppDateUtils
.convertStringToDate(item
.startDate)
: DateTime.parse(
item.startDate)),
fontWeight:
FontWeight.bold,
), ),
) )
], ],
@ -205,18 +241,30 @@ class AddSickLeavScreen extends StatelessWidget {
Row( Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context).endDate + ' ' ?? "", TranslationBase.of(
context)
.endDate +
' ' ??
"",
), ),
Flexible( Flexible(
child: AppText( child: AppText(
AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.getDayMonthYearDateFormatted(item
item.startDate.contains("/Date(") .startDate
? AppDateUtils.convertStringToDate(item.endDate ?? "") .contains(
.add(Duration( "/Date(")
days: item.noOfDays ?? item.sickLeaveDays)) ? AppDateUtils.convertStringToDate(
: DateTime.parse(item.startDate ?? "") item.endDate ??
.add(Duration(days: item.noOfDays ?? ""))), "")
fontWeight: FontWeight.bold, .add(Duration(
days: item.noOfDays ??
item
.sickLeaveDays))
: DateTime.parse(
item.startDate ?? "")
.add(Duration(days: item.noOfDays ?? ""))),
fontWeight:
FontWeight.bold,
), ),
) )
], ],
@ -246,7 +294,8 @@ class AddSickLeavScreen extends StatelessWidget {
Image.asset('assets/images/no-data.png'), Image.asset('assets/images/no-data.png'),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: AppText(TranslationBase.of(context).noSickLeave), child: AppText(
TranslationBase.of(context).noSickLeave),
) )
], ],
), ),
@ -255,7 +304,8 @@ class AddSickLeavScreen extends StatelessWidget {
])))); ]))));
} }
openSickLeave(BuildContext context, isExtend, {GetAllSickLeaveResponse extendedData}) { openSickLeave(BuildContext context, isExtend,
{GetAllSickLeaveResponse extendedData}) {
// showModalBottomSheet( // showModalBottomSheet(
// context: context, // context: context,
// builder: (context) { // builder: (context) {
@ -265,9 +315,13 @@ class AddSickLeavScreen extends StatelessWidget {
context, context,
FadePage( FadePage(
page: SickLeaveScreen( page: SickLeaveScreen(
appointmentNo: appointmentNo: isExtend == true
isExtend == true ? extendedData.appointmentNo : patient.appointmentNo, //extendedData.appointmentNo, ? extendedData.appointmentNo
patientMRN: isExtend == true ? extendedData.patientMRN : patient.patientMRN, : patient.appointmentNo,
//extendedData.appointmentNo,
patientMRN: isExtend == true
? extendedData.patientMRN
: patient.patientMRN,
isExtended: isExtend, isExtended: isExtend,
extendedData: extendedData, extendedData: extendedData,
patient: patient))); patient: patient)));

@ -91,6 +91,7 @@ class TranslationBase {
String get inPatient => localizedValues['inPatient'][locale.languageCode]; String get inPatient => localizedValues['inPatient'][locale.languageCode];
String get myInPatient => localizedValues['myInPatient'][locale.languageCode]; String get myInPatient => localizedValues['myInPatient'][locale.languageCode];
String get myInPatientTitle => localizedValues['myInPatientTitle'][locale.languageCode];
String get inPatientLabel => localizedValues['inPatientLabel'][locale.languageCode]; String get inPatientLabel => localizedValues['inPatientLabel'][locale.languageCode];
String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode]; String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode];
@ -1102,6 +1103,8 @@ class TranslationBase {
String get textResponse => localizedValues['textResponse'][locale.languageCode]; String get textResponse => localizedValues['textResponse'][locale.languageCode];
String get special => localizedValues['special'][locale.languageCode]; String get special => localizedValues['special'][locale.languageCode];
String get requestType => localizedValues['requestType'][locale.languageCode]; String get requestType => localizedValues['requestType'][locale.languageCode];
String get allClinic => localizedValues['allClinic'][locale.languageCode];
String get notReplied => localizedValues['notReplied'][locale.languageCode];
} }

@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'ShowTimer.dart'; import 'ShowTimer.dart';
@ -81,8 +82,7 @@ class PatientCard extends StatelessWidget {
? Row( ? Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).arrivedP,
.arrivedP,
color: Colors.green, color: Colors.green,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -102,12 +102,8 @@ class PatientCard extends StatelessWidget {
width: 8, width: 8,
), ),
AppText( AppText(
patientInfo.status == 2 patientInfo.status == 2 ? 'Confirmed' : 'Booked',
? 'Confirmed' color: patientInfo.status == 2 ? Colors.green : Colors.grey,
: 'Booked',
color: patientInfo.status == 2
? Colors.green
: Colors.grey,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 10, fontSize: 10,
@ -118,8 +114,7 @@ class PatientCard extends StatelessWidget {
? Row( ? Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).notArrived,
.notArrived,
color: Colors.red[800], color: Colors.red[800],
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -139,27 +134,19 @@ class PatientCard extends StatelessWidget {
width: 8, width: 8,
), ),
AppText( AppText(
patientInfo.status == 2 patientInfo.status == 2 ? 'Confirmed' : 'Booked',
? 'Confirmed' color: patientInfo.status == 2 ? Colors.green : Colors.grey,
: 'Booked',
color: patientInfo.status == 2
? Colors.green
: Colors.grey,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 10, fontSize: 10,
), ),
], ],
) )
: !isFromSearch && : !isFromSearch && !isFromLiveCare && patientInfo.patientStatusType == null
!isFromLiveCare &&
patientInfo.patientStatusType ==
null
? Row( ? Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).notArrived,
.notArrived,
color: Colors.red[800], color: Colors.red[800],
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -179,13 +166,8 @@ class PatientCard extends StatelessWidget {
width: 8, width: 8,
), ),
AppText( AppText(
patientInfo.status == 2 patientInfo.status == 2 ? 'Booked' : 'Confirmed',
? 'Booked' color: patientInfo.status == 2 ? Colors.grey : Colors.green,
: 'Confirmed',
color:
patientInfo.status == 2
? Colors.grey
: Colors.green,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: 12,
@ -195,17 +177,13 @@ class PatientCard extends StatelessWidget {
: SizedBox(), : SizedBox(),
this.arrivalType == '1' this.arrivalType == '1'
? AppText( ? AppText(
patientInfo.startTime != null patientInfo.startTime != null ? patientInfo.startTime : patientInfo.startTimes,
? patientInfo.startTime
: patientInfo.startTimes,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
) )
: patientInfo.arrivedOn != null : patientInfo.arrivedOn != null
? AppText( ? AppText(
AppDateUtils.getDayMonthYearDate( AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(
AppDateUtils
.convertStringToDate(
patientInfo.arrivedOn, patientInfo.arrivedOn,
)) + )) +
" " + " " +
@ -214,10 +192,8 @@ class PatientCard extends StatelessWidget {
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontSize: 15, fontSize: 15,
) )
: (patientInfo.appointmentDate != : (patientInfo.appointmentDate != null &&
null && patientInfo.appointmentDate.isNotEmpty)
patientInfo
.appointmentDate.isNotEmpty)
? AppText( ? AppText(
"${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate( "${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(
patientInfo.appointmentDate, patientInfo.appointmentDate,
@ -256,13 +232,10 @@ class PatientCard extends StatelessWidget {
// width: MediaQuery.of(context).size.width*0.51, // width: MediaQuery.of(context).size.width*0.51,
child: AppText( child: AppText(
isFromLiveCare isFromLiveCare
? Helpers.capitalize( ? Helpers.capitalize(patientInfo.fullName)
patientInfo.fullName) : (Helpers.capitalize(patientInfo.firstName) +
: (Helpers.capitalize(
patientInfo.firstName) +
" " + " " +
Helpers.capitalize( Helpers.capitalize(patientInfo.lastName)),
patientInfo.lastName)),
fontSize: 16, fontSize: 16,
color: Color(0xff2e303a), color: Color(0xff2e303a),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -300,25 +273,19 @@ class PatientCard extends StatelessWidget {
fontSize: 14, fontSize: 14,
textOverflow: TextOverflow.ellipsis, textOverflow: TextOverflow.ellipsis,
), ),
patientInfo.nationality != null || patientInfo.nationality != null || patientInfo.nationalityId != null
patientInfo.nationalityId != null
? ClipRRect( ? ClipRRect(
borderRadius: borderRadius: BorderRadius.circular(20.0),
BorderRadius.circular(20.0), child: CachedNetworkImage(
child: Image.network( imageUrl: patientInfo.nationalityFlagURL != null
patientInfo.nationalityFlagURL != null
? patientInfo.nationalityFlagURL ? patientInfo.nationalityFlagURL
: '', : '',
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, errorWidget: (context, url, error) => AppText(
Object exception, 'No Image',
StackTrace stackTrace) { fontSize: 10,
return AppText( ),
'No Image',
fontSize: 10,
);
},
)) ))
: SizedBox() : SizedBox()
], ],
@ -348,58 +315,74 @@ class PatientCard extends StatelessWidget {
width: 10, width: 10,
), ),
Expanded( Expanded(
child: Column( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Expanded(
CustomRow( child: Column(
label: TranslationBase.of(context).fileNumber, crossAxisAlignment: CrossAxisAlignment.start,
value: patientInfo.patientId.toString(),
),
//if (isInpatient)
CustomRow(
label: TranslationBase.of(context).age + " : ",
value:
"${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}",
),
if (isInpatient)
CustomRow(
label: patientInfo.admissionDate == null
? ""
: TranslationBase.of(context)
.admissionDate +
" : ",
value: patientInfo.admissionDate == null
? ""
: "${AppDateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}",
),
if (patientInfo.admissionDate != null)
CustomRow(
label: TranslationBase.of(context).numOfDays +
" : ",
value:
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}",
),
if (patientInfo.admissionDate != null)
CustomRow(
label:
TranslationBase.of(context).roomNo + " : ",
value: "${patientInfo.roomId}",
),
if (isFromLiveCare)
Column(
children: [ children: [
CustomRow( CustomRow(
label: TranslationBase.of(context).clinic + label:
" : ", TranslationBase.of(context).fileNumber,
value: patientInfo.clinicName, value: patientInfo.patientId.toString(),
), ),
], CustomRow(
), label:
])) TranslationBase.of(context).age + " : ",
value:
"${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}",
),
if (isInpatient)
CustomRow(
label: patientInfo.admissionDate == null
? ""
: TranslationBase.of(context).admissionDate + " : ",
value: patientInfo.admissionDate == null
? ""
: "${AppDateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}",
),
if (patientInfo.admissionDate != null)
CustomRow(
label: TranslationBase.of(context)
.numOfDays +
" : ",
value:
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}",
),
if (patientInfo.admissionDate != null)
CustomRow(
label:
TranslationBase.of(context).clinicName +
" : ",
value: "${patientInfo.clinicDescription}",
),
if (patientInfo.admissionDate != null)
CustomRow(
label:
TranslationBase.of(context).roomNo +
" : ",
value: "${patientInfo.roomId}",
),
if (isFromLiveCare)
Column(
children: [
CustomRow(
label: TranslationBase.of(context)
.clinic +
" : ",
value: patientInfo.clinicName,
),
],
),
]),
),
Icon(
Icons.arrow_forward,
size: 24,
),
],
))
]), ]),
isFromLiveCare isFromLiveCare
? Row( ? Row(
@ -416,36 +399,29 @@ class PatientCard extends StatelessWidget {
], ],
) )
: !isInpatient && !isFromSearch : !isInpatient && !isFromSearch
? Row( ? Row(mainAxisAlignment: MainAxisAlignment.end, children: [
mainAxisAlignment: MainAxisAlignment.end, Container(
children: [ padding: EdgeInsets.all(4),
child: Image.asset(
patientInfo.appointmentType == 'Regular' && patientInfo.visitTypeId == 100
? 'assets/images/livecare.png'
: patientInfo.appointmentType == 'Walkin'
? 'assets/images/walkin.png'
: 'assets/images/booked.png',
height: 25,
width: 35,
)),
])
: (isInpatient == true)
? Row(mainAxisAlignment: MainAxisAlignment.end, children: [
Container( Container(
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
child: Image.asset( child: Image.asset(
patientInfo.appointmentType == 'assets/images/inpatient.png',
'Regular' &&
patientInfo.visitTypeId == 100
? 'assets/images/livecare.png'
: patientInfo.appointmentType ==
'Walkin'
? 'assets/images/walkin.png'
: 'assets/images/booked.png',
height: 25, height: 25,
width: 35, width: 35,
)), )),
]) ])
: (isInpatient == true)
? Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
padding: EdgeInsets.all(4),
child: Image.asset(
'assets/images/inpatient.png',
height: 25,
width: 35,
)),
])
: SizedBox() : SizedBox()
], ],
), ),
@ -454,5 +430,3 @@ class PatientCard extends StatelessWidget {
)); ));
} }
} }

@ -1,13 +1,14 @@
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:cached_network_image/cached_network_image.dart';
class ProfileWelcomeWidget extends StatelessWidget { class ProfileWelcomeWidget extends StatelessWidget {
final Widget clinicWidget; final Widget clinicWidget;
final double height; final double height;
final bool isClinic; final bool isClinic;
ProfileWelcomeWidget(this.clinicWidget,
{this.height = 150, this.isClinic = false}); ProfileWelcomeWidget(this.clinicWidget, {this.height = 150, this.isClinic = false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -27,24 +28,23 @@ class ProfileWelcomeWidget extends StatelessWidget {
SizedBox( SizedBox(
width: 20, width: 20,
), ),
if(authenticationViewModel.doctorProfile!=null) if (authenticationViewModel.doctorProfile != null)
CircleAvatar( CircleAvatar(
// radius: (52) // radius: (52)
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
child: Image.network( child: CachedNetworkImage(
authenticationViewModel.doctorProfile.doctorImageURL, imageUrl: authenticationViewModel.doctorProfile.doctorImageURL,
fit: BoxFit.fill, fit: BoxFit.fill,
width: 75, width: 75,
height: 75, height: 75,
),
), ),
backgroundColor: Colors.transparent,
), ),
backgroundColor: Colors.transparent,
),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
], ],
)), )),
); );

@ -1,6 +1,5 @@
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -26,7 +25,7 @@ class CardWithBgWidget extends StatelessWidget {
Radius.circular(10.0), Radius.circular(10.0),
), ),
border: Border.all( border: Border.all(
color: hasBorder ? HexColor('#707070') : Colors.transparent, color: hasBorder ? Color(0xFF707070) : Colors.transparent,
width: hasBorder ? 0.30 : 0), width: hasBorder ? 0.30 : 0),
), ),
child: Material( child: Material(
@ -37,8 +36,7 @@ class CardWithBgWidget extends StatelessWidget {
Positioned( Positioned(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: bgColor ?? HexColor('#58434F'), color: bgColor ?? Color(0xFF58434F),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topRight: Radius.circular(10), topRight: Radius.circular(10),
bottomRight: Radius.circular(10),),), bottomRight: Radius.circular(10),),),
@ -52,8 +50,7 @@ class CardWithBgWidget extends StatelessWidget {
Positioned( Positioned(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: bgColor ?? HexColor('#58434F'), color: bgColor ?? Color(0xFF58434F),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(10), topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10),),), bottomLeft: Radius.circular(10),),),

@ -71,43 +71,48 @@ class _ListSelectDialogState extends State<ListSelectDialog> {
Widget createDialogList() { Widget createDialogList() {
return Container( return Container(
height: MediaQuery.of(context).size.height * 0.5, height: MediaQuery.of(context).size.height * 0.5,
child: SingleChildScrollView( child: Column(
child: Column( children: [
children: [ if (widget.searchWidget != null) widget.searchWidget,
if (widget.searchWidget != null) widget.searchWidget, if (widget.usingSearch)
if(widget.usingSearch) Container(
Container(
height: MediaQuery.of(context).size.height * 0.070, height: MediaQuery.of(context).size.height * 0.070,
child: TextField( child: TextField(
decoration: Helpers.textFieldSelectorDecoration( decoration: Helpers.textFieldSelectorDecoration(
widget.hintSearchText ?? TranslationBase widget.hintSearchText ?? TranslationBase.of(context).search, null, false,
.of(context) suffixIcon: Icon(
.search, null, false, suffixIcon: Icon(Icons.search,)), Icons.search,
enabled: true, )),
keyboardType: TextInputType.text, enabled: true,
onChanged: (value) { keyboardType: TextInputType.text,
filterSearchResults(value); onChanged: (value) {
}, filterSearchResults(value);
)), },
...items )),
.map((item) => RadioListTile( Expanded(
title: Text("${item[widget.attributeName].toString()}"), child: SingleChildScrollView(
groupValue: widget.selectedValue[widget.attributeValueId] child: Column(
.toString(), children: [
value: item[widget.attributeValueId].toString(), ...items
activeColor: Colors.blue.shade700, .map((item) => RadioListTile(
selected: item[widget.attributeValueId].toString() == title: Text("${item[widget.attributeName].toString()}"),
widget.selectedValue[widget.attributeValueId] groupValue: widget.selectedValue[widget.attributeValueId].toString(),
.toString(), value: item[widget.attributeValueId].toString(),
onChanged: (val) { activeColor: Colors.blue.shade700,
setState(() { selected: item[widget.attributeValueId].toString() ==
widget.selectedValue = item; widget.selectedValue[widget.attributeValueId].toString(),
}); onChanged: (val) {
}, setState(() {
)) widget.selectedValue = item;
.toList() });
], },
), ))
.toList()
],
),
),
),
],
), ),
); );
} }

@ -157,6 +157,7 @@ class DoctorCard extends StatelessWidget {
), ),
if (branch != null) if (branch != null)
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
TranslationBase.of(context).branch + TranslationBase.of(context).branch +
@ -164,9 +165,11 @@ class DoctorCard extends StatelessWidget {
fontSize: 14, fontSize: 14,
color: Colors.grey[500], color: Colors.grey[500],
), ),
AppText( Expanded(
branch, child: AppText(
fontSize: 14, branch,
fontSize: 14,
),
) )
], ],
) )

@ -7,7 +7,7 @@ class CustomRow extends StatelessWidget {
const CustomRow({ const CustomRow({
Key key, Key key,
this.label, this.label,
this.value, this.labelSize, this.valueSize, this.width, this.value, this.labelSize, this.valueSize, this.width, this.isCopyable= true,
}) : super(key: key); }) : super(key: key);
final String label; final String label;
@ -15,6 +15,7 @@ class CustomRow extends StatelessWidget {
final double labelSize; final double labelSize;
final double valueSize; final double valueSize;
final double width; final double width;
final bool isCopyable;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -35,7 +36,7 @@ class CustomRow extends StatelessWidget {
fontSize: valueSize??SizeConfig.getTextMultiplierBasedOnWidth() * 3, fontSize: valueSize??SizeConfig.getTextMultiplierBasedOnWidth() * 3,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
isCopyable: true, isCopyable: isCopyable,
), ),
], ],
); );

@ -96,6 +96,10 @@ dependencies:
# Html Editor Enhanced # Html Editor Enhanced
html_editor_enhanced: ^1.3.0 html_editor_enhanced: ^1.3.0
#Network Image
cached_network_image: ^2.5.0
# Badges # Badges
badges: ^1.1.4 badges: ^1.1.4

Loading…
Cancel
Save