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

 Conflicts:
	lib/core/service/home/auth_service.dart
	lib/core/viewModel/auth_view_model.dart
	lib/core/viewModel/imei_view_model.dart
	lib/locator.dart
	lib/screens/auth/login_screen.dart
	lib/screens/home/home_screen.dart
	lib/screens/patients/patient_search/patient_search_screen.dart
	lib/widgets/auth/verification_methods.dart
merge-requests/667/head
Elham Rababah 5 years ago
commit 56698a82fd

@ -71,10 +71,12 @@ class BaseAppClient {
await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
}
if (body['ProjectID'] != null &&
(body['ProjectID'] == 2 || body['ProjectID'] == 3)) {
body['PatientOutSA'] = true;
}
int projectID = await sharedPref.getInt(PROJECT_ID);
if(projectID ==2 || projectID == 3)
body['PatientOutSA'] = true;
else
body['PatientOutSA'] = false;
body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
print("URL : $url");
print("Body : ${json.encode(body)}");
@ -197,10 +199,11 @@ class BaseAppClient {
body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it
body['SessionID'] = SESSION_ID; //getSe
if (body['ProjectID'] != null &&
(body['ProjectID'] == 2 || body['ProjectID'] == 3)) {
int projectID = await sharedPref.getInt(PROJECT_ID);
if(projectID ==2 || projectID == 3)
body['PatientOutSA'] = true;
}
else
body['PatientOutSA'] = false;
print("URL : $url");
print("Body : ${json.encode(body)}");

@ -48,6 +48,7 @@ const Map<String, Map<String, String>> localizedValues = {
'service': {'en': 'Service', 'ar': 'خدمة'},
'referral': {'en': 'Referral', 'ar': 'الإحالة'},
'inPatient': {'en': 'InPatients', 'ar': 'مرضاي'},
'myInPatient': {'en': 'My\nInPatients', 'ar': 'مرضاي'},
'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'},
'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى'},
'operations': {'en': 'Operations', 'ar': 'عمليات'},
@ -481,8 +482,10 @@ const Map<String, Map<String, String>> localizedValues = {
'emergencyCase': {'en': "Emergency Case", 'ar': 'حالة طارئة'},
'durationOfIllness': {'en': "duration Of Illness", 'ar': 'مدة المرض'},
'chiefComplaintsAndSymptoms': {
'en': "CHIEF COMPLAINTS & OTHER SYMPTOMS",
'ar': 'شكاوى الرئيس وأعراض أخرى'
'en': "CHIEF COMPLAINTS",
'ar': 'شكاوى الرئيس'
// 'en': "CHIEF COMPLAINTS & OTHER SYMPTOMS",
// 'ar': 'شكاوى الرئيس وأعراض أخرى'
},
'patientFeelsPainInHisBackAndCough': {
'en': "Patient Feels pain in his back and cough",
@ -972,4 +975,7 @@ const Map<String, Map<String, String>> localizedValues = {
"none": {"en": "None", "ar": "لا شيء"},
"notRepliedYet": {"en": "Not Replied yet", "ar": "لم يرد بعد"},
"clearText": {"en": "Clear Text", "ar": "نص واضح"},
"medicalReportAdd": {"en": "Add Medical Report", "ar": "إضافة تقرير طبي"},
"medicalReportVerify": {"en": "Verify Medical Report", "ar": "تحقق من التقرير الطبي"},
"comments": {"en": "Comments", "ar": "تعليقات"},
};

@ -86,7 +86,7 @@ class Prescriptions {
clinicID = json['ClinicID'];
companyName = json['CompanyName'];
despensedStatus = json['Despensed_Status'];
dischargeDate = DateUtils.convertStringToDate(json['DischargeDate']);
dischargeDate = AppDateUtils.convertStringToDate(json['DischargeDate']);
dischargeNo = json['DischargeNo'];
doctorID = json['DoctorID'];
doctorImageURL = json['DoctorImageURL'];

@ -79,10 +79,10 @@ class PrescriptionsOrder {
status = json['Status'];
description = json['Description'];
descriptionN = json['DescriptionN'];
createdOn = DateUtils.convertStringToDate(json['CreatedOn']);
createdOn = AppDateUtils.convertStringToDate(json['CreatedOn']);
serviceID = json['ServiceID'];
createdBy = json['CreatedBy'];
editedOn = DateUtils.convertStringToDate(json['EditedOn']);
editedOn = AppDateUtils.convertStringToDate(json['EditedOn']);
editedBy = json['EditedBy'];
channel = json['Channel'];
clientRequestID = json['ClientRequestID'];

@ -95,7 +95,7 @@ class PatientLabOrders {
isRead = json['IsRead'];
nationalityFlagURL = json['NationalityFlagURL'];
noOfPatientsRate = json['NoOfPatientsRate'];
orderDate = DateUtils.convertStringToDate(json['OrderDate']);
orderDate = AppDateUtils.convertStringToDate(json['OrderDate']);
orderNo = json['OrderNo'].toString();
patientID = json['PatientID'].toString();
projectID = json['ProjectID'].toString();

@ -42,7 +42,7 @@ class PatientMuseResultsModel {
imageURL = json['ImageURL'];
createdBy = json['CreatedBy'];
createdOn = json['CreatedOn'];
createdOnDateTime = DateUtils.getDateTimeFromServerFormat(json['CreatedOn']);
createdOnDateTime = AppDateUtils.getDateTimeFromServerFormat(json['CreatedOn']);
}
Map<String, dynamic> toJson() {

@ -96,8 +96,8 @@ class FinalRadiology {
invoiceNo = json['InvoiceNo'];
doctorID = json['DoctorID'];
clinicID = json['ClinicID'];
orderDate = DateUtils.convertStringToDate(json['OrderDate']);
reportDate = DateUtils.convertStringToDate(json['ReportDate']);
orderDate = AppDateUtils.convertStringToDate(json['OrderDate']);
reportDate = AppDateUtils.convertStringToDate(json['ReportDate']);
reportData = json['ReportData'];
imageURL = json['ImageURL'];
procedureID = json['ProcedureID'];

@ -139,7 +139,7 @@ class DischargeReferralPatient {
referralClinic = json['ReferralClinic'];
referringClinic = json['ReferringClinic'];
referralStatus = json['ReferralStatus'];
referralDate = DateUtils.convertStringToDate(json['ReferralDate']);
referralDate = AppDateUtils.convertStringToDate(json['ReferralDate']);
referringDoctorRemarks = json['ReferringDoctorRemarks'];
referredDoctorRemarks = json['ReferredDoctorRemarks'];
referralResponseOn = json['ReferralResponseOn'];

@ -159,7 +159,7 @@ class MyReferralPatientModel {
referralClinic = json['ReferralClinic'];
referringClinic = json['ReferringClinic'];
referralStatus = json['ReferralStatus'];
referralDate = DateUtils.convertStringToDate(json['ReferralDate']);
referralDate = AppDateUtils.convertStringToDate(json['ReferralDate']);
referringDoctorRemarks = json['ReferringDoctorRemarks'];
referredDoctorRemarks = json['ReferredDoctorRemarks'];
referralResponseOn = json['ReferralResponseOn'];

@ -1,29 +0,0 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/PatientMuseResultsModel.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class PatientMuseService extends BaseService {
List<PatientMuseResultsModel> patientMuseResultsModelList = List();
getECGPatient({int patientType, int patientOutSA,int patientID}) async {
Map<String,dynamic> body = Map();
body['PatientType'] = patientType==7 ? 1: patientType;
body['PatientOutSA'] = patientOutSA;
body['PatientID'] = patientID;
hasError = false;
await baseAppClient.post(
GET_ECG,
onSuccess: (dynamic response, int statusCode) {
patientMuseResultsModelList.clear();
response['HIS_GetPatientMuseResultsList'].forEach((v) {
patientMuseResultsModelList.add(PatientMuseResultsModel.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: body
);
}
}

@ -1,14 +1,14 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/DischargeReferralPatient.dart';
import 'package:doctor_app_flutter/core/model/referral/DischargeReferralPatient.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
class DischargedPatientService extends BaseService {
List<PatiantInformtion> myDischargedPatients = List();
List<DischargeReferralPatient> myDischargeReferralPatients = List();
Future getDischargedPatient() async {
Future getDischargedPatient() async {
hasError = false;
Map<String, dynamic> body = Map();
await getDoctorProfile(isGetProfile: true);
@ -63,14 +63,14 @@ class DischargedPatientService extends BaseService {
myDischargeReferralPatients.clear();
await baseAppClient.post(GET_MY_DISCHARGE_PATIENT,
onSuccess: (dynamic response, int statusCode) {
if (response['List_MyDischargeReferralPatient'] != null) {
response['List_MyDischargeReferralPatient'].forEach((v) {
myDischargeReferralPatients.add(DischargeReferralPatient.fromJson(v));
});
}
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
if (response['List_MyDischargeReferralPatient'] != null) {
response['List_MyDischargeReferralPatient'].forEach((v) {
myDischargeReferralPatients.add(DischargeReferralPatient.fromJson(v));
});
}
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/MyReferralPatientModel.dart';
import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart';
@ -42,23 +42,25 @@ class MyReferralInPatientService extends BaseService {
);
}
Future replay(String referredDoctorRemarks, MyReferralPatientModel referral) async {
Future replay(
String referredDoctorRemarks, MyReferralPatientModel referral) async {
hasError = false;
await getDoctorProfile();
RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks();
RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks =
RequestAddReferredDoctorRemarks();
_requestAddReferredDoctorRemarks.projectID = referral.projectID;
_requestAddReferredDoctorRemarks.admissionNo = referral.admissionNo.toString();
_requestAddReferredDoctorRemarks.admissionNo =
referral.admissionNo.toString();
_requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo;
_requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks;
_requestAddReferredDoctorRemarks.referredDoctorRemarks =
referredDoctorRemarks;
_requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID;
_requestAddReferredDoctorRemarks.patientID = referral.patientID;
_requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor;
await baseAppClient.post(
ADD_REFERRED_DOCTOR_REMARKS,
body: _requestAddReferredDoctorRemarks.toJson(),
onSuccess: (dynamic body, int statusCode) {
},
onSuccess: (dynamic body, int statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;

@ -0,0 +1,25 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientMuseResultsModel.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class PatientMuseService extends BaseService {
List<PatientMuseResultsModel> patientMuseResultsModelList = List();
getECGPatient({int patientType, int patientOutSA, int patientID}) async {
Map<String, dynamic> body = Map();
body['PatientType'] = patientType == 7 ? 1 : patientType;
body['PatientOutSA'] = patientOutSA;
body['PatientID'] = patientID;
hasError = false;
await baseAppClient.post(GET_ECG,
onSuccess: (dynamic response, int statusCode) {
patientMuseResultsModelList.clear();
response['HIS_GetPatientMuseResultsList'].forEach((v) {
patientMuseResultsModelList.add(PatientMuseResultsModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -1,9 +1,8 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/ReferralRequest.dart';
import 'package:doctor_app_flutter/core/model/referral/ReferralRequest.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class ReferralService extends BaseService {
Future referralPatient(
{int admissionNo,
String roomID,

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
@ -7,8 +7,8 @@ class OutPatientService extends BaseService {
List<PatiantInformtion> _patientList = [];
List<PatiantInformtion> get patientList => _patientList;
Future getOutPatient(PatientSearchRequestModel patientSearchRequestModel) async {
Future getOutPatient(
PatientSearchRequestModel patientSearchRequestModel) async {
hasError = false;
await baseAppClient.post(
GET_MY_OUT_PATIENT,
@ -25,7 +25,9 @@ class OutPatientService extends BaseService {
body: patientSearchRequestModel.toJson(),
);
}
Future getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel) async {
Future getPatientFileInformation(
PatientSearchRequestModel patientSearchRequestModel) async {
hasError = false;
await baseAppClient.post(
PRM_SEARCH_PATIENT,

@ -9,7 +9,7 @@ import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patien
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart';
import 'base/lookup-service.dart';
import '../base/lookup-service.dart';
class PatientReferralService extends LookupService {
List<dynamic> projectsList = [];
@ -56,7 +56,8 @@ class PatientReferralService extends LookupService {
Map<String, dynamic> body = Map();
body['isSameBranch'] = false;
await baseAppClient.post(GET_REFERRAL_FACILITIES, onSuccess: (response, statusCode) async {
await baseAppClient.post(GET_REFERRAL_FACILITIES,
onSuccess: (response, statusCode) async {
projectsList = response['ProjectInfo'];
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -102,7 +103,8 @@ class PatientReferralService extends LookupService {
);
}
Future getDoctorsList(PatiantInformtion patient ,int clinicId, int branchId) async {
Future getDoctorsList(
PatiantInformtion patient, int clinicId, int branchId) async {
hasError = false;
DoctorsByClinicIdRequest _doctorsByClinicIdRequest =
DoctorsByClinicIdRequest();
@ -112,22 +114,16 @@ class PatientReferralService extends LookupService {
_doctorsByClinicIdRequest.patientID = patient.patientId;
_doctorsByClinicIdRequest.gender = patient.gender;
await baseAppClient.postPatient(
PATIENT_GET_DOCTOR_BY_CLINIC_Hospital,
onSuccess: (dynamic response, int statusCode) {
doctorsList.clear();
response['DoctorList'].forEach((v) {
doctorsList.add(ClinicDoctor.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _doctorsByClinicIdRequest.toJson(),
patient: patient
);
await baseAppClient.postPatient(PATIENT_GET_DOCTOR_BY_CLINIC_Hospital,
onSuccess: (dynamic response, int statusCode) {
doctorsList.clear();
response['DoctorList'].forEach((v) {
doctorsList.add(ClinicDoctor.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _doctorsByClinicIdRequest.toJson(), patient: patient);
}
Future getMyReferredPatient() async {
@ -215,7 +211,8 @@ class PatientReferralService extends LookupService {
);
}
Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async {
Future responseReferral(
PendingReferral pendingReferral, bool isAccepted) async {
hasError = false;
DoctorProfileModel doctorProfile = await getDoctorProfile();
@ -242,13 +239,8 @@ class PatientReferralService extends LookupService {
);
}
Future makeReferral(
PatiantInformtion patient,
String isoStringDate,
int projectID,
int clinicID,
int doctorID,
String remarks) async {
Future makeReferral(PatiantInformtion patient, String isoStringDate,
int projectID, int clinicID, int doctorID, String remarks) async {
hasError = false;
Map<String, dynamic> body = Map();
@ -304,8 +296,8 @@ class PatientReferralService extends LookupService {
);
}
Future verifyReferralDoctorRemarks(MyReferredPatientModel referredPatient) async {
Future verifyReferralDoctorRemarks(
MyReferredPatientModel referredPatient) async {
hasError = false;
Map<String, dynamic> body = Map();
@ -315,9 +307,7 @@ class PatientReferralService extends LookupService {
await baseAppClient.post(
Verify_Referral_Doctor_Remarks,
onSuccess: (dynamic response, int statusCode) {
},
onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
@ -14,7 +14,7 @@ class PatientInPatientService extends BaseService {
if (isMyInpatient) {
requestModel.doctorID = doctorProfile.doctorID;
}else {
} else {
requestModel.doctorID = 0;
}

@ -1,7 +1,7 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/insurance_approval_request_model.dart';
import 'package:doctor_app_flutter/core/model/insurance_approval.dart';
import 'package:doctor_app_flutter/core/model/insurance_approval_in_patient_model.dart';
import 'package:doctor_app_flutter/core/model/insurance/insurance_approval.dart';
import 'package:doctor_app_flutter/core/model/insurance/insurance_approval_in_patient_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';

@ -7,7 +7,7 @@ import 'package:doctor_app_flutter/core/model/labs/request_patient_lab_special_r
import 'package:doctor_app_flutter/core/model/labs/request_send_lab_report_email.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'base/base_service.dart';
import '../../base/base_service.dart';
class LabsService extends BaseService {
List<PatientLabOrders> patientLabOrdersList = List();
@ -25,16 +25,16 @@ class LabsService extends BaseService {
body['isDentalAllowedBackend'] = false;
url = GET_Patient_LAB_ORDERS;
}
patientLabOrdersList=[];
patientLabOrdersList = [];
patientLabOrdersList.clear();
await baseAppClient.postPatient(url, patient: patient,
onSuccess: (dynamic response, int statusCode) {
patientLabOrdersList=[];
patientLabOrdersList = [];
if (!isInpatient) {
response['ListPLO'].forEach((hospital) {
patientLabOrdersList.add(PatientLabOrders.fromJson(hospital));
});
var asd="";
var asd = "";
} else {
response['List_GetLabOreders'].forEach((hospital) {
patientLabOrdersList.add(PatientLabOrders.fromJson(hospital));
@ -69,14 +69,13 @@ class LabsService extends BaseService {
_requestPatientLabSpecialResult.orderNo = orderNo;
body = _requestPatientLabSpecialResult.toJson();
await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, patient: patient,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT,
patient: patient, onSuccess: (dynamic response, int statusCode) {
patientLabSpecialResult.clear();
response['ListPLSR'].forEach((hospital) {
patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
@ -84,7 +83,9 @@ class LabsService extends BaseService {
}
Future getPatientLabResult(
{PatientLabOrders patientLabOrder, PatiantInformtion patient, bool isInpatient}) async {
{PatientLabOrders patientLabOrder,
PatiantInformtion patient,
bool isInpatient}) async {
hasError = false;
String url = "";
@ -107,16 +108,15 @@ class LabsService extends BaseService {
patientLabSpecialResult.clear();
labResultList.clear();
if(isInpatient){
if (isInpatient) {
response['List_GetLabNormal'].forEach((hospital) {
labResultList.add(LabResult.fromJson(hospital));
});
}else {
} else {
response['ListPLR'].forEach((lab) {
labResultList.add(LabResult.fromJson(lab));
});
}
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;

@ -1,6 +1,6 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/medical_file_model.dart';
import 'package:doctor_app_flutter/core/model/medical_file_request_model.dart';
import 'package:doctor_app_flutter/core/model/medical_report/medical_file_model.dart';
import 'package:doctor_app_flutter/core/model/medical_report/medical_file_request_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class MedicalFileService extends BaseService {

@ -1,12 +1,12 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/Prescription_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_req_model.dart';
import 'package:doctor_app_flutter/core/model/calculate_box_request_model.dart';
import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/model/item_by_medicine_request_model.dart';
import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/prescription_req_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug_request_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/item_by_medicine_request_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/search_drug_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/search_drug_request_model.dart';
import 'package:doctor_app_flutter/core/service/base/lookup-service.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart';
@ -109,7 +109,7 @@ class PrescriptionService extends LookupService {
}, body: _drugRequestModel.toJson());
}
Future getMedicationList({String drug =''}) async {
Future getMedicationList({String drug = ''}) async {
hasError = false;
_drugRequestModel.search = ["$drug"];
await baseAppClient.post(SEARCH_DRUG,
@ -218,7 +218,7 @@ class PrescriptionService extends LookupService {
"Prescription": {
"objPatientInfo": {
"Gender": patient.gender == 1 ? 'Male' : 'Female',
"Age": DateUtils.convertDateFromServerFormat(
"Age": AppDateUtils.convertDateFromServerFormat(
patient.dateofBirth, 'dd/MM/yyyy')
},
"objVitalSign": {"Height": vital?.heightCm, "Weight": vital?.weightKg},

@ -12,7 +12,7 @@ import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:flutter/cupertino.dart';
import 'base/base_service.dart';
import '../../base/base_service.dart';
class PrescriptionsService extends BaseService {
List<Prescriptions> prescriptionsList = List();

@ -0,0 +1,57 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:flutter/cupertino.dart';
import '../../base/base_service.dart';
class RadiologyService extends BaseService {
List<FinalRadiology> finalRadiologyList = List();
String url = '';
Future getRadImageURL(
{int invoiceNo,
int lineItem,
int projectId,
@required PatiantInformtion patient}) async {
hasError = false;
final Map<String, dynamic> body = new Map<String, dynamic>();
body['InvoiceNo'] = invoiceNo;
body['LineItemNo'] = lineItem;
body['ProjectID'] = projectId;
await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient,
onSuccess: (dynamic response, int statusCode) {
url = response['Data'];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getPatientRadOrders(PatiantInformtion patient,
{isInPatient = false}) async {
String url = GET_PATIENT_ORDERS;
final Map<String, dynamic> body = new Map<String, dynamic>();
if (isInPatient) {
url = GET_IN_PATIENT_ORDERS;
body['ProjectID'] = patient.projectId;
}
hasError = false;
await baseAppClient.postPatient(url, patient: patient,
onSuccess: (dynamic response, int statusCode) {
finalRadiologyList = [];
String label = "ListRAD";
if (isInPatient) {
label = "List_GetRadOreders";
}
response[label].forEach((radiology) {
finalRadiologyList.add(FinalRadiology.fromJson(radiology));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -1,13 +1,12 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/sick_leave_patient_model.dart';
import 'package:doctor_app_flutter/core/model/sick_leave_patient_request_model.dart';
import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_model.dart';
import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_request_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.dart';
import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart';
import 'package:doctor_app_flutter/models/sickleave/extend_sick_leave_request.dart';
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
// import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
class SickLeaveService extends BaseService {
Map get sickLeavestatisitics => _statistics;
@ -31,7 +30,6 @@ class SickLeaveService extends BaseService {
dynamic get sickLeaveResponse => _sickLeaveResponse;
dynamic _sickLeaveResponse;
List<SickLeavePatientModel> getAllSickLeavePatient = List();
SickLeavePatientRequestModel _sickLeavePatientRequestModel =
@ -101,8 +99,8 @@ class SickLeaveService extends BaseService {
await baseAppClient.postPatient(
GET_SICK_LEAVE,
onSuccess: (dynamic response, int statusCode) {
// Future.value(response);
getAllSickLeavePatient=[];
// Future.value(response);
getAllSickLeavePatient = [];
response['List_SickLeave'].forEach((v) {
getAllSickLeavePatient.add(SickLeavePatientModel.fromJson(v));
});
@ -119,7 +117,7 @@ class SickLeaveService extends BaseService {
_sickLeavePatientRequestModel = SickLeavePatientRequestModel(
patientID: patientMRN, patientTypeID: 2, patientType: 1);
hasError = false;
getAllSickLeavePatient =[];
getAllSickLeavePatient = [];
getAllSickLeavePatient.clear();
await baseAppClient.postPatient(
GET_SICK_LEAVE_PATIENT,

@ -22,15 +22,15 @@ 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_progress_note_request_model.dart';
import 'base/lookup-service.dart';
import '../../base/lookup-service.dart';
class SOAPService extends LookupService {
List<GetChiefComplaintResModel> patientChiefComplaintList = [];
List<GetAllergiesResModel> patientAllergiesList = [];
List<GetHistoryResModel> patientHistoryList = [];
List<GetPhysicalExamResModel> patientPhysicalExamList = [];
List<GetPatientProgressNoteResModel> patientProgressNoteList = [];
List<GetAssessmentResModel> patientAssessmentList = [];
List<GetChiefComplaintResModel> patientChiefComplaintList = [];
List<GetAllergiesResModel> patientAllergiesList = [];
List<GetHistoryResModel> patientHistoryList = [];
List<GetPhysicalExamResModel> patientPhysicalExamList = [];
List<GetPatientProgressNoteResModel> patientProgressNoteList = [];
List<GetAssessmentResModel> patientAssessmentList = [];
int episodeID;
Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async {
@ -55,13 +55,12 @@ class SOAPService extends LookupService {
await baseAppClient.post(POST_EPISODE,
onSuccess: (dynamic response, int statusCode) {
print("Success");
episodeID = response['EpisodeID'];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: postEpisodeReqModel.toJson());
print("Success");
episodeID = response['EpisodeID'];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: postEpisodeReqModel.toJson());
}
Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async {
@ -69,11 +68,11 @@ class SOAPService extends LookupService {
await baseAppClient.post(POST_ALLERGY,
onSuccess: (dynamic response, int statusCode) {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: postAllergyRequestModel.toJson());
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: postAllergyRequestModel.toJson());
}
Future postHistories(
@ -81,11 +80,11 @@ class SOAPService extends LookupService {
hasError = false;
await baseAppClient.post(POST_HISTORY,
onSuccess: (dynamic response, int statusCode) {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: postHistoriesRequestModel.toJson());
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: postHistoriesRequestModel.toJson());
}
Future postChiefComplaint(
@ -93,7 +92,7 @@ class SOAPService extends LookupService {
hasError = false;
await baseAppClient.post(POST_CHIEF_COMPLAINT,
onSuccess: (dynamic response, int statusCode) {
print("Success");
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
@ -136,18 +135,16 @@ class SOAPService extends LookupService {
}, body: postAssessmentRequestModel.toJson());
}
Future patchAllergy(PostAllergyRequestModel patchAllergyRequestModel) async {
hasError = false;
await baseAppClient.post(PATCH_ALLERGY,
onSuccess: (dynamic response, int statusCode) {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: patchAllergyRequestModel.toJson());
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: patchAllergyRequestModel.toJson());
}
Future patchHistories(
@ -155,11 +152,11 @@ class SOAPService extends LookupService {
hasError = false;
await baseAppClient.post(PATCH_HISTORY,
onSuccess: (dynamic response, int statusCode) {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: patchHistoriesRequestModel.toJson());
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: patchHistoriesRequestModel.toJson());
}
Future patchChiefComplaint(
@ -167,11 +164,11 @@ class SOAPService extends LookupService {
hasError = false;
await baseAppClient.post(PATCH_CHIEF_COMPLAINT,
onSuccess: (dynamic response, int statusCode) {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: patchChiefComplaintRequestModel.toJson());
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: patchChiefComplaintRequestModel.toJson());
}
Future patchPhysicalExam(
@ -179,11 +176,11 @@ class SOAPService extends LookupService {
hasError = false;
await baseAppClient.post(PATCH_PHYSICAL_EXAM,
onSuccess: (dynamic response, int statusCode) {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: patchPhysicalExamRequestModel.toJson());
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: patchPhysicalExamRequestModel.toJson());
}
Future patchProgressNote(
@ -191,11 +188,11 @@ class SOAPService extends LookupService {
hasError = false;
await baseAppClient.post(PATCH_PROGRESS_NOTE,
onSuccess: (dynamic response, int statusCode) {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: patchProgressNoteRequestModel.toJson());
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: patchProgressNoteRequestModel.toJson());
}
Future patchAssessment(
@ -203,111 +200,106 @@ class SOAPService extends LookupService {
hasError = false;
await baseAppClient.post(PATCH_ASSESSMENT,
onSuccess: (dynamic response, int statusCode) {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: patchAssessmentRequestModel.toJson());
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: patchAssessmentRequestModel.toJson());
}
Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async {
hasError = false;
await baseAppClient.post (GET_ALLERGY,
await baseAppClient.post(GET_ALLERGY,
onSuccess: (dynamic response, int statusCode) {
print("Success");
patientAllergiesList.clear();
print("Success");
patientAllergiesList.clear();
response['List_Allergies']['entityList'].forEach((v) {
patientAllergiesList.add(GetAllergiesResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: generalGetReqForSOAP.toJson());
response['List_Allergies']['entityList'].forEach((v) {
patientAllergiesList.add(GetAllergiesResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: generalGetReqForSOAP.toJson());
}
Future getPatientHistories(
GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async {
Future getPatientHistories(GetHistoryReqModel getHistoryReqModel,
{bool isFirst = false}) async {
hasError = false;
await baseAppClient.post(GET_HISTORY,
onSuccess: (dynamic response, int statusCode) {
print("Success");
if (isFirst)
patientHistoryList.clear();
if (isFirst) patientHistoryList.clear();
response['List_History']['entityList'].forEach((v) {
patientHistoryList.add(GetHistoryResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getHistoryReqModel.toJson());
super.error = error;
}, body: getHistoryReqModel.toJson());
}
Future getPatientChiefComplaint(
GetChiefComplaintReqModel getChiefComplaintReqModel) async {
hasError = false;
await baseAppClient.post (GET_CHIEF_COMPLAINT,
await baseAppClient.post(GET_CHIEF_COMPLAINT,
onSuccess: (dynamic response, int statusCode) {
print("Success");
patientChiefComplaintList.clear();
response['List_ChiefComplaint']['entityList'].forEach((v) {
patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getChiefComplaintReqModel.toJson());
print("Success");
patientChiefComplaintList.clear();
response['List_ChiefComplaint']['entityList'].forEach((v) {
patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getChiefComplaintReqModel.toJson());
}
Future getPatientPhysicalExam(
GetPhysicalExamReqModel getPhysicalExamReqModel) async {
hasError = false;
await baseAppClient.post (GET_PHYSICAL_EXAM,
await baseAppClient.post(GET_PHYSICAL_EXAM,
onSuccess: (dynamic response, int statusCode) {
patientPhysicalExamList.clear();
response['PhysicalExamList']['entityList'].forEach((v) {
patientPhysicalExamList.add(GetPhysicalExamResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getPhysicalExamReqModel.toJson());
patientPhysicalExamList.clear();
response['PhysicalExamList']['entityList'].forEach((v) {
patientPhysicalExamList.add(GetPhysicalExamResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getPhysicalExamReqModel.toJson());
}
Future getPatientProgressNote(
GetGetProgressNoteReqModel getGetProgressNoteReqModel) async {
hasError = false;
await baseAppClient.post (GET_PROGRESS_NOTE,
await baseAppClient.post(GET_PROGRESS_NOTE,
onSuccess: (dynamic response, int statusCode) {
print("Success");
patientProgressNoteList.clear();
response['ProgressNoteList']['entityList'].forEach((v) {
patientProgressNoteList.add(GetPatientProgressNoteResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getGetProgressNoteReqModel.toJson());
print("Success");
patientProgressNoteList.clear();
response['ProgressNoteList']['entityList'].forEach((v) {
patientProgressNoteList.add(GetPatientProgressNoteResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getGetProgressNoteReqModel.toJson());
}
Future getPatientAssessment(
GetAssessmentReqModel getAssessmentReqModel) async {
hasError = false;
await baseAppClient.post (GET_ASSESSMENT,
await baseAppClient.post(GET_ASSESSMENT,
onSuccess: (dynamic response, int statusCode) {
print("Success");
patientAssessmentList.clear();
response['AssessmentList']['entityList'].forEach((v) {
patientAssessmentList.add(GetAssessmentResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getAssessmentReqModel.toJson());
print("Success");
patientAssessmentList.clear();
response['AssessmentList']['entityList'].forEach((v) {
patientAssessmentList.add(GetAssessmentResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getAssessmentReqModel.toJson());
}
}

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/prescription_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'package:doctor_app_flutter/core/service/base/lookup-service.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart';
@ -8,11 +8,10 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart';
class UcafService extends LookupService {
List<GetChiefComplaintResModel> patientChiefComplaintList = [];
List<GetChiefComplaintResModel> patientChiefComplaintList = [];
List<VitalSignHistory> patientVitalSignsHistory = [];
List<GetAssessmentResModel> patientAssessmentList = [];
List<OrderProcedure> orderProcedureList = [];
List<GetAssessmentResModel> patientAssessmentList = [];
List<OrderProcedure> orderProcedureList = [];
PrescriptionModel prescriptionList;
Future getPatientChiefComplaint(PatiantInformtion patient) async {
@ -23,27 +22,28 @@ class UcafService extends LookupService {
body['EpisodeID'] = patient.episodeNo;
body['DoctorID'] = "";
await baseAppClient.post (GET_CHIEF_COMPLAINT,
await baseAppClient.post(GET_CHIEF_COMPLAINT,
onSuccess: (dynamic response, int statusCode) {
print("Success");
patientChiefComplaintList.clear();
response['List_ChiefComplaint']['entityList'].forEach((v) {
patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
print("Success");
patientChiefComplaintList.clear();
response['List_ChiefComplaint']['entityList'].forEach((v) {
patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getInPatientVitalSignHistory(PatiantInformtion patient, bool isInPatient) async {
Future getInPatientVitalSignHistory(
PatiantInformtion patient, bool isInPatient) async {
hasError = false;
Map<String, dynamic> body = Map();
body['PatientID'] = patient.patientId;
body['PatientTypeID'] = 1;
if(isInPatient){
if (isInPatient) {
body['InOutPatientType'] = 1;
}else {
} else {
body['InOutPatientType'] = 2;
}
@ -104,17 +104,17 @@ class UcafService extends LookupService {
body['AppointmentNo'] = patient.appointmentNo;
body['EpisodeID'] = patient.episodeNo;
await baseAppClient.post (GET_ASSESSMENT,
await baseAppClient.post(GET_ASSESSMENT,
onSuccess: (dynamic response, int statusCode) {
print("Success");
patientAssessmentList.clear();
response['AssessmentList']['entityList'].forEach((v) {
patientAssessmentList.add(GetAssessmentResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
print("Success");
patientAssessmentList.clear();
response['AssessmentList']['entityList'].forEach((v) {
patientAssessmentList.add(GetAssessmentResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getPrescription(PatiantInformtion patient) async {
@ -129,11 +129,12 @@ class UcafService extends LookupService {
prescriptionList = null;
await baseAppClient.post(GET_PRESCRIPTION_LIST,
onSuccess: (dynamic response, int statusCode) {
prescriptionList = PrescriptionModel.fromJson(response['PrescriptionList']);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
prescriptionList =
PrescriptionModel.fromJson(response['PrescriptionList']);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getOrderProcedures(PatiantInformtion patient) async {
@ -143,17 +144,17 @@ class UcafService extends LookupService {
body['AppointmentNo'] = patient.appointmentNo;
body['EpisodeID'] = patient.episodeNo;
await baseAppClient.post (GET_ORDER_PROCEDURE,
await baseAppClient.post(GET_ORDER_PROCEDURE,
onSuccess: (dynamic response, int statusCode) {
print("Success");
orderProcedureList.clear();
response['OrderedProcedureList']['entityList'].forEach((v) {
orderProcedureList.add(OrderProcedure.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
print("Success");
orderProcedureList.clear();
response['OrderedProcedureList']['entityList'].forEach((v) {
orderProcedureList.add(OrderProcedure.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future postUCAF(PatiantInformtion patient) async {
@ -162,13 +163,12 @@ class UcafService extends LookupService {
body['PatientMRN'] = patient.patientMRN;
body['AppointmentNo'] = patient.appointmentNo;
await baseAppClient.post (POST_UCAF,
await baseAppClient.post(POST_UCAF,
onSuccess: (dynamic response, int statusCode) {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}
}

@ -1,59 +0,0 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:flutter/cupertino.dart';
import 'base/base_service.dart';
class RadiologyService extends BaseService {
List<FinalRadiology> finalRadiologyList = List();
String url = '';
Future getRadImageURL({int invoiceNo, int lineItem, int projectId,@required PatiantInformtion patient}) async {
hasError = false;
final Map<String, dynamic> body = new Map<String, dynamic>();
body['InvoiceNo'] = invoiceNo;
body['LineItemNo'] = lineItem;
body['ProjectID'] = projectId;
await baseAppClient.postPatient(GET_RAD_IMAGE_URL,
patient: patient,
onSuccess: (dynamic response, int statusCode) {
url = response['Data'];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getPatientRadOrders(PatiantInformtion patient , {isInPatient = false}) async {
String url = GET_PATIENT_ORDERS;
final Map<String, dynamic> body = new Map<String, dynamic>();
if(isInPatient) {
url = GET_IN_PATIENT_ORDERS;
body['ProjectID'] = patient.projectId;
}
hasError = false;
await baseAppClient.postPatient(url,
patient: patient,
onSuccess: (dynamic response, int statusCode) {
finalRadiologyList = [];
String label = "ListRAD";
if(isInPatient) {
label ="List_GetRadOreders";
}
response[label].forEach((radiology) {
finalRadiologyList.add(FinalRadiology.fromJson(radiology));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body:body);
}
}

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/DischargedPatientService.dart';
import 'package:doctor_app_flutter/core/service/patient/DischargedPatientService.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import '../../locator.dart';
@ -12,7 +12,6 @@ class DischargedPatientViewModel extends BaseViewModel {
List<PatiantInformtion> get myDischargedPatient =>
_dischargedPatientService.myDischargedPatients;
List<PatiantInformtion> filterData = [];
searchData(String str) {
@ -39,16 +38,16 @@ class DischargedPatientViewModel extends BaseViewModel {
}
}
Future getDischargedPatient() async {
setState(ViewState.Busy);
await _dischargedPatientService.getDischargedPatient();
if (_dischargedPatientService.hasError) {
error = _dischargedPatientService.error;
setState(ViewState.Error);
} else{
} else {
filterData = myDischargedPatient;
setState(ViewState.Idle);}
setState(ViewState.Idle);
}
}
Future gtMyDischargeReferralPatient() async {

@ -1,7 +1,7 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/insurance_approval.dart';
import 'package:doctor_app_flutter/core/model/insurance_approval_in_patient_model.dart';
import 'package:doctor_app_flutter/core/service/InsuranceCardService.dart';
import 'package:doctor_app_flutter/core/model/insurance/insurance_approval.dart';
import 'package:doctor_app_flutter/core/model/insurance/insurance_approval_in_patient_model.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/insurance/InsuranceCardService.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';

@ -1,15 +1,15 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/PatientMuseResultsModel.dart';
import 'package:doctor_app_flutter/core/service/PatientMuseService.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientMuseResultsModel.dart';
import 'package:doctor_app_flutter/core/service/patient/PatientMuseService.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import '../../locator.dart';
class PatientMuseViewModel extends BaseViewModel {
PatientMuseService _patientMuseService = locator<PatientMuseService>();
List<PatientMuseResultsModel> get patientMuseResultsModelList => _patientMuseService.patientMuseResultsModelList;
List<PatientMuseResultsModel> get patientMuseResultsModelList =>
_patientMuseService.patientMuseResultsModelList;
getECGPatient({int patientType, int patientOutSA, int patientID}) async {
setState(ViewState.Busy);

@ -1,9 +1,9 @@
import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/patient/out_patient_service.dart';
import 'package:doctor_app_flutter/core/service/patientInPatientService.dart';
import 'package:doctor_app_flutter/core/service/patient/patientInPatientService.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
@ -85,11 +85,12 @@ class PatientSearchViewModel extends BaseViewModel {
}
}
getPatientBasedOnDate (
{item, PatientSearchRequestModel patientSearchRequestModel, PatientType selectedPatientType,
bool isSearchWithKeyInfo,OutPatientFilterType outPatientFilterType })async {
getPatientBasedOnDate(
{item,
PatientSearchRequestModel patientSearchRequestModel,
PatientType selectedPatientType,
bool isSearchWithKeyInfo,
OutPatientFilterType outPatientFilterType}) async {
String dateTo;
String dateFrom;
if (OutPatientFilterType.Previous == outPatientFilterType) {
@ -97,24 +98,24 @@ class PatientSearchViewModel extends BaseViewModel {
DateTime.now().year, DateTime.now().month - 1, DateTime.now().day);
selectedToDate = DateTime(
DateTime.now().year, DateTime.now().month, DateTime.now().day - 1);
dateTo = DateUtils.convertDateToFormat(selectedToDate, 'yyyy-MM-dd');
dateFrom = DateUtils.convertDateToFormat(selectedFromDate, 'yyyy-MM-dd');
dateTo = AppDateUtils.convertDateToFormat(selectedToDate, 'yyyy-MM-dd');
dateFrom = AppDateUtils.convertDateToFormat(selectedFromDate, 'yyyy-MM-dd');
} else if (OutPatientFilterType.NextWeek == outPatientFilterType) {
dateTo = DateUtils.convertDateToFormat(
dateTo = AppDateUtils.convertDateToFormat(
DateTime(DateTime.now().year, DateTime.now().month,
DateTime.now().day + 6),
'yyyy-MM-dd');
dateFrom = DateUtils.convertDateToFormat(
dateFrom = AppDateUtils.convertDateToFormat(
DateTime(DateTime.now().year, DateTime.now().month,
DateTime.now().day + 1),
'yyyy-MM-dd');
} else {
dateFrom = DateUtils.convertDateToFormat(
dateFrom = AppDateUtils.convertDateToFormat(
DateTime(
DateTime.now().year, DateTime.now().month, DateTime.now().day),
'yyyy-MM-dd');
dateTo = DateUtils.convertDateToFormat(
dateTo = AppDateUtils.convertDateToFormat(
DateTime(
DateTime.now().year, DateTime.now().month, DateTime.now().day),
'yyyy-MM-dd');
@ -144,7 +145,7 @@ class PatientSearchViewModel extends BaseViewModel {
Future getInPatientList(PatientSearchRequestModel requestModel,
{bool isMyInpatient = false}) async {
await getDoctorProfile();
setState(ViewState.Busy);
setState(ViewState.Busy);
if (inPatientList.length == 0)
await _inPatientService.getInPatientList(requestModel, false);
@ -161,12 +162,11 @@ class PatientSearchViewModel extends BaseViewModel {
setState(ViewState.BusyLocal);
await getDoctorProfile();
filteredInPatientItems.clear();
if (inPatientList.length > 0)
filteredInPatientItems.addAll(inPatientList);
if (inPatientList.length > 0) filteredInPatientItems.addAll(inPatientList);
setState(ViewState.Idle);
}
void clearPatientList(){
void clearPatientList() {
_inPatientService.inPatientList = [];
_inPatientService.myInPatientList = [];
}

@ -1,8 +1,9 @@
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/model/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/service/SOAP_service.dart';
import 'package:doctor_app_flutter/core/service/prescription_service.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/soap/SOAP_service.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart';
@ -39,10 +40,10 @@ class SOAPViewModel extends BaseViewModel {
List<MasterKeyModel> get allergySeverityList =>
_SOAPService.allergySeverityList;
List<MasterKeyModel> get historyFamilyList => _SOAPService.historyFamilyList;
List<MasterKeyModel> get historyMedicalList => _SOAPService.historyMedicalList;
List<MasterKeyModel> get historyMedicalList =>
_SOAPService.historyMedicalList;
List<MasterKeyModel> get historySportList => _SOAPService.historySportList;
@ -82,8 +83,7 @@ class SOAPViewModel extends BaseViewModel {
List<GetAssessmentResModel> get patientAssessmentList =>
_SOAPService.patientAssessmentList;
int get episodeID =>
_SOAPService.episodeID;
int get episodeID => _SOAPService.episodeID;
get medicationStrengthList => _SOAPService.medicationStrengthListWithModel;
get medicationDoseTimeList => _SOAPService.medicationDoseTimeListWithModel;
@ -102,11 +102,12 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false}) async {
if(isBusyLocal){
Future getMasterLookup(MasterKeysService masterKeys,
{bool isBusyLocal = false}) async {
if (isBusyLocal) {
setState(ViewState.Busy);
} else
setState(ViewState.Busy);
}else
setState(ViewState.Busy);
await _SOAPService.getMasterLookup(masterKeys);
if (_SOAPService.hasError) {
error = _SOAPService.error;
@ -115,7 +116,6 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future postEpisode(PostEpisodeReqModel postEpisodeReqModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postEpisode(postEpisodeReqModel);
@ -136,7 +136,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future postHistories(PostHistoriesRequestModel postHistoriesRequestModel) async {
Future postHistories(
PostHistoriesRequestModel postHistoriesRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postHistories(postHistoriesRequestModel);
if (_SOAPService.hasError) {
@ -146,7 +147,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future postChiefComplaint(PostChiefComplaintRequestModel postChiefComplaintRequestModel) async {
Future postChiefComplaint(
PostChiefComplaintRequestModel postChiefComplaintRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postChiefComplaint(postChiefComplaintRequestModel);
if (_SOAPService.hasError) {
@ -156,7 +158,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future postPhysicalExam(PostPhysicalExamRequestModel postPhysicalExamRequestModel) async {
Future postPhysicalExam(
PostPhysicalExamRequestModel postPhysicalExamRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postPhysicalExam(postPhysicalExamRequestModel);
if (_SOAPService.hasError) {
@ -166,7 +169,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future postProgressNote(PostProgressNoteRequestModel postProgressNoteRequestModel) async {
Future postProgressNote(
PostProgressNoteRequestModel postProgressNoteRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postProgressNote(postProgressNoteRequestModel);
if (_SOAPService.hasError) {
@ -176,7 +180,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future postAssessment(PostAssessmentRequestModel postAssessmentRequestModel) async {
Future postAssessment(
PostAssessmentRequestModel postAssessmentRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postAssessment(postAssessmentRequestModel);
if (_SOAPService.hasError) {
@ -186,7 +191,6 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future patchAllergy(PostAllergyRequestModel patchAllergyRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.patchAllergy(patchAllergyRequestModel);
@ -197,7 +201,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future patchHistories(PostHistoriesRequestModel patchHistoriesRequestModel) async {
Future patchHistories(
PostHistoriesRequestModel patchHistoriesRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.patchHistories(patchHistoriesRequestModel);
if (_SOAPService.hasError) {
@ -207,7 +212,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future patchChiefComplaint(PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async {
Future patchChiefComplaint(
PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.patchChiefComplaint(patchChiefComplaintRequestModel);
if (_SOAPService.hasError) {
@ -217,7 +223,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future patchPhysicalExam(PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async {
Future patchPhysicalExam(
PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.patchPhysicalExam(patchPhysicalExamRequestModel);
if (_SOAPService.hasError) {
@ -227,7 +234,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future patchProgressNote(PostProgressNoteRequestModel patchProgressNoteRequestModel) async {
Future patchProgressNote(
PostProgressNoteRequestModel patchProgressNoteRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.patchProgressNote(patchProgressNoteRequestModel);
if (_SOAPService.hasError) {
@ -237,7 +245,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future patchAssessment(PatchAssessmentReqModel patchAssessmentRequestModel) async {
Future patchAssessment(
PatchAssessmentReqModel patchAssessmentRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.patchAssessment(patchAssessmentRequestModel);
if (_SOAPService.hasError) {
@ -259,7 +268,7 @@ class SOAPViewModel extends BaseViewModel {
if (isLocalBusy) {
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Error);
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
@ -271,16 +280,19 @@ class SOAPViewModel extends BaseViewModel {
masterKeys: MasterKeysService.Allergies,
id: element.allergyDiseaseId,
typeId: element.allergyDiseaseType);
if(selectedAllergy != null && element.isChecked)
allergiesString +=
(isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn )+ ' , ';
if (selectedAllergy != null && element.isChecked)
allergiesString +=
(isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn) +
' , ';
});
return allergiesString;
}
Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async {
Future getPatientHistories(GetHistoryReqModel getHistoryReqModel,
{bool isFirst = false}) async {
setState(ViewState.Busy);
await _SOAPService.getPatientHistories(getHistoryReqModel, isFirst: isFirst);
await _SOAPService.getPatientHistories(getHistoryReqModel,
isFirst: isFirst);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.Error);
@ -299,7 +311,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getPatientPhysicalExam(GetPhysicalExamReqModel getPhysicalExamReqModel) async {
Future getPatientPhysicalExam(
GetPhysicalExamReqModel getPhysicalExamReqModel) async {
setState(ViewState.Busy);
await _SOAPService.getPatientPhysicalExam(getPhysicalExamReqModel);
if (_SOAPService.hasError) {
@ -309,7 +322,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getPatientProgressNote(GetGetProgressNoteReqModel getGetProgressNoteReqModel) async {
Future getPatientProgressNote(
GetGetProgressNoteReqModel getGetProgressNoteReqModel) async {
setState(ViewState.Busy);
await _SOAPService.getPatientProgressNote(getGetProgressNoteReqModel);
if (_SOAPService.hasError) {
@ -339,6 +353,7 @@ class SOAPViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
}
// ignore: missing_return
MasterKeyModel getOneMasterKey(
{@required MasterKeysService masterKeys, dynamic id, int typeId}) {
@ -391,7 +406,8 @@ class SOAPViewModel extends BaseViewModel {
break;
case MasterKeysService.HistorySurgical:
List<MasterKeyModel> result = historySurgicalList.where((element) {
return element.id == id;}).toList();
return element.id == id;
}).toList();
if (result.isNotEmpty) {
return result.first;
}
@ -414,12 +430,12 @@ class SOAPViewModel extends BaseViewModel {
return result.first;
}
break;
// case MasterKeysService.physiotherapyGoals:
// listOfPhysiotherapyGoals.clear();
// entryList.forEach((v) {
// listOfPhysiotherapyGoals.add(MasterKeyModel.fromJson(v));
// });
// break;
// case MasterKeysService.physiotherapyGoals:
// listOfPhysiotherapyGoals.clear();
// entryList.forEach((v) {
// listOfPhysiotherapyGoals.add(MasterKeyModel.fromJson(v));
// });
// break;
case MasterKeysService.DiagnosisType:
List<MasterKeyModel> result = listOfDiagnosisType.where((element) {
@ -441,7 +457,7 @@ class SOAPViewModel extends BaseViewModel {
break;
case MasterKeysService.ICD10:
List<MasterKeyModel> result = listOfICD10.where((element) {
return element.code == id ;
return element.code == id;
}).toList();
if (result.isNotEmpty) {
return result.first;
@ -450,6 +466,4 @@ class SOAPViewModel extends BaseViewModel {
break;
}
}
}

@ -1,12 +1,44 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/dasboard_service.dart';
import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart';import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import '../../locator.dart';
import 'base_view_model.dart';
class DashboardViewModel extends BaseViewModel {
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
DashboardService _dashboardService = locator<DashboardService>();
get dashboardItemsList => _dashboardService.dashboardItemsList;
List<DashboardModel> get dashboardItemsList =>
_dashboardService.dashboardItemsList;
Future setFirebaseNotification(ProjectViewModel projectsProvider, AuthViewModel authProvider) async{
setState(ViewState.Busy);
await projectsProvider.getDoctorClinicsList();
// _firebaseMessaging.setAutoInitEnabled(true);
_firebaseMessaging.requestNotificationPermissions(
const IosNotificationSettings(
sound: true, badge: true, alert: true, provisional: true));
_firebaseMessaging.onIosSettingsRegistered
.listen((IosNotificationSettings settings) {
print("Settings registered: $settings");
});
_firebaseMessaging.getToken().then((String token) async {
if (token != '') {
DEVICE_TOKEN = token;
var request = await sharedPref.getObj(DOCTOR_PROFILE);
authProvider.insertDeviceImei(request).then((value) {
});
}
});
}
Future getDashboard() async {
setState(ViewState.Busy);
@ -17,4 +49,31 @@ class DashboardViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
}
Future changeClinic(int clinicId, AuthViewModel authProvider) async {
setState(ViewState.BusyLocal);
await getDoctorProfile();
ProfileReqModel docInfo = new ProfileReqModel(
doctorID: doctorProfile.doctorID,
clinicID: clinicId,
license: true,
projectID: doctorProfile.projectID,
tokenID: '',
languageID: 2);
await authProvider.getDocProfiles(docInfo.toJson()).then((res) async {
sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]);
setState(ViewState.Idle);
}).catchError((err) {
error = err;
setState(ViewState.ErrorLocal);
});
}
getPatientCount(DashboardModel inPatientCount) {
int value = 0;
inPatientCount.summaryoptions.forEach((result) => {value += result.value});
return value.toString();
}
}

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/doctor_reply_service.dart';
import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart';
import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart';
import '../../locator.dart';
@ -8,7 +8,8 @@ import 'base_view_model.dart';
class DoctorReplayViewModel extends BaseViewModel {
DoctorReplyService _doctorReplyService = locator<DoctorReplyService>();
List<ListGtMyPatientsQuestions> get listDoctorWorkingHoursTable => _doctorReplyService.listDoctorWorkingHoursTable;
List<ListGtMyPatientsQuestions> get listDoctorWorkingHoursTable =>
_doctorReplyService.listDoctorWorkingHoursTable;
Future getDoctorReply() async {
setState(ViewState.Busy);
@ -20,7 +21,8 @@ class DoctorReplayViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future replay(String referredDoctorRemarks, ListGtMyPatientsQuestions model) async {
Future replay(
String referredDoctorRemarks, ListGtMyPatientsQuestions model) async {
setState(ViewState.BusyLocal);
await _doctorReplyService.replay(referredDoctorRemarks, model);
if (_doctorReplyService.hasError) {

@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart';
import 'package:doctor_app_flutter/core/model/labs/lab_result.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart';
import 'package:doctor_app_flutter/core/service/labs_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/lab_order/labs_service.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
@ -116,10 +116,14 @@ class LabsViewModel extends BaseViewModel {
}
getPatientLabResult(
{PatientLabOrders patientLabOrder, PatiantInformtion patient, bool isInpatient}) async {
{PatientLabOrders patientLabOrder,
PatiantInformtion patient,
bool isInpatient}) async {
setState(ViewState.Busy);
await _labsService.getPatientLabResult(
patientLabOrder: patientLabOrder, patient: patient, isInpatient: isInpatient);
patientLabOrder: patientLabOrder,
patient: patient,
isInpatient: isInpatient);
if (_labsService.hasError) {
error = _labsService.error;
setState(ViewState.Error);
@ -131,17 +135,9 @@ class LabsViewModel extends BaseViewModel {
.toList();
if (patientLabOrdersClinic.length != 0) {
var value =
labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])]
.patientLabResultList
.where((e) =>
e.sampleCollectedOn == element.sampleCollectedOn &&
e.resultValue == element.resultValue)
.toList();
if (value.isEmpty)
labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])]
.patientLabResultList
.add(element);
labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])]
.patientLabResultList
.add(element);
} else {
labResultLists
.add(LabResultList(filterName: element.testCode, lab: element));

@ -1,6 +1,6 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/medical_file_model.dart';
import 'package:doctor_app_flutter/core/service/medical_file_service.dart';
import 'package:doctor_app_flutter/core/model/medical_report/medical_file_model.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/medical_report/medical_file_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';

@ -1,8 +1,9 @@
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/model/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/service/medicine_service.dart';
import 'package:doctor_app_flutter/core/service/prescription_service.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/medicine_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart';

@ -1,38 +1,43 @@
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/model/admissionRequest/admission-request.dart';
import 'package:doctor_app_flutter/core/service/patient-admission-request-service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import '../../locator.dart';
class AdmissionRequestViewModel extends BaseViewModel{
AdmissionRequestService _admissionRequestService = locator<AdmissionRequestService>();
class AdmissionRequestViewModel extends BaseViewModel {
AdmissionRequestService _admissionRequestService =
locator<AdmissionRequestService>();
List<dynamic> get clinicList => _admissionRequestService.clinicList;
List<dynamic> get doctorsList => _admissionRequestService.doctorsList;
List<dynamic> get speciality => _admissionRequestService.specialityList;
List<dynamic> get speciality => _admissionRequestService.specialityList;
List<dynamic> get floorList => _admissionRequestService.floorList;
List<dynamic> get floorList => _admissionRequestService.floorList;
List<dynamic> get wardList => _admissionRequestService.wardList;
List<dynamic> get wardList => _admissionRequestService.wardList;
List<dynamic> get roomCategoryList => _admissionRequestService.roomCategoryList;
List<dynamic> get roomCategoryList =>
_admissionRequestService.roomCategoryList;
List<dynamic> get admissionTypeList => _admissionRequestService.listOfAdmissionType;
List<dynamic> get admissionTypeList =>
_admissionRequestService.listOfAdmissionType;
List<dynamic> get diagnosisTypesList => _admissionRequestService.diagnosisTypesList;
List<dynamic> get diagnosisTypesList =>
_admissionRequestService.diagnosisTypesList;
List<dynamic> get allergiesList => _admissionRequestService.allergiesLookupList;
List<dynamic> get allergiesList =>
_admissionRequestService.allergiesLookupList;
List<dynamic> get dietTypesList => _admissionRequestService.dietTypesList;
List<dynamic> get dietTypesList => _admissionRequestService.dietTypesList;
List<dynamic> get icdCodes => _admissionRequestService.icdCodes;
List<dynamic> get icdCodes => _admissionRequestService.icdCodes;
List<dynamic> get listOfDiagnosisSelectionTypes => _admissionRequestService.listOfDiagnosisSelectionTypes;
List<dynamic> get listOfDiagnosisSelectionTypes =>
_admissionRequestService.listOfDiagnosisSelectionTypes;
AdmissionRequest admissionRequestData;
@ -131,7 +136,7 @@ class AdmissionRequestViewModel extends BaseViewModel{
setState(ViewState.Idle);
}
Future makeAdmissionRequest() async{
Future makeAdmissionRequest() async {
setState(ViewState.Busy);
await _admissionRequestService.makeAdmissionRequest(admissionRequestData);
if (_admissionRequestService.hasError) {
@ -151,4 +156,4 @@ class AdmissionRequestViewModel extends BaseViewModel{
setState(ViewState.Idle);
}
}
}
}

@ -1,11 +1,11 @@
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/model/DischargeReferralPatient.dart';
import 'package:doctor_app_flutter/core/model/MyReferralPatientModel.dart';
import 'package:doctor_app_flutter/core/service/DischargedPatientService.dart';
import 'package:doctor_app_flutter/core/service/MyReferralPatientService.dart';
import 'package:doctor_app_flutter/core/service/ReferralService.dart';
import 'package:doctor_app_flutter/core/service/patient-doctor-referral-service.dart';
import 'package:doctor_app_flutter/core/model/referral/DischargeReferralPatient.dart';
import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart';
import 'package:doctor_app_flutter/core/service/patient/DischargedPatientService.dart';
import 'package:doctor_app_flutter/core/service/patient/MyReferralPatientService.dart';
import 'package:doctor_app_flutter/core/service/patient/ReferralService.dart';
import 'package:doctor_app_flutter/core/service/patient/patient-doctor-referral-service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart';
@ -26,7 +26,8 @@ class PatientReferralViewModel extends BaseViewModel {
MyReferralInPatientService _myReferralService =
locator<MyReferralInPatientService>();
DischargedPatientService _dischargedPatientService = locator<DischargedPatientService>();
DischargedPatientService _dischargedPatientService =
locator<DischargedPatientService>();
List<DischargeReferralPatient> get myDischargeReferralPatient =>
_dischargedPatientService.myDischargeReferralPatients;
@ -165,9 +166,11 @@ class PatientReferralViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
}
Future replay(String referredDoctorRemarks, MyReferralPatientModel referral) async{
Future replay(
String referredDoctorRemarks, MyReferralPatientModel referral) async {
setState(ViewState.Busy);
await _myReferralService.replay(referredDoctorRemarks,referral);
await _myReferralService.replay(referredDoctorRemarks, referral);
if (_myReferralService.hasError) {
error = _myReferralService.error;
setState(ViewState.ErrorLocal);
@ -366,7 +369,8 @@ class PatientReferralViewModel extends BaseViewModel {
patient.roomId = referredPatient.roomID;
patient.bedId = referredPatient.bedID;
patient.nationalityName = referredPatient.nationalityName;
patient.nationalityFlagURL = '';// TODO from backend referredPatient.nationalityFlagURL;
patient.nationalityFlagURL =
''; // TODO from backend referredPatient.nationalityFlagURL;
patient.age = referredPatient.age;
patient.clinicDescription = referredPatient.clinicDescription;
return patient;

@ -1,8 +1,8 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.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/model/prescription_model.dart';
import 'package:doctor_app_flutter/core/service/patient-ucaf-service.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart';
@ -45,7 +45,7 @@ class UcafViewModel extends BaseViewModel {
String respirationBeatPerMinute = "0";
String bloodPressure = "0 / 0";
resetDataInFirst(){
resetDataInFirst() {
_ucafService.patientAssessmentList = [];
_ucafService.orderProcedureList = [];
_ucafService.prescriptionList = null;
@ -61,10 +61,10 @@ class UcafViewModel extends BaseViewModel {
String from;
String to;
if (from == null || from == "0") {
from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
if (to == null || to == "0") {
to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
to = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
// await _ucafService.getPatientVitalSignsHistory(patient, from, to);

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/patient-vital-signs-service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
@ -46,18 +46,16 @@ class VitalSignsViewModel extends BaseViewModel {
String to, bool isInPatient) async {
setState(ViewState.Busy);
if (from == null || from == "0") {
from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
if (to == null || to == "0") {
to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
to = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
if (isInPatient) {
await _vitalSignService.getPatientVitalSignsHistory(patient, from, to);
} else {
await _vitalSignService.getOutPatientVitalSignHistory(patient, from, to);
await _vitalSignService.getOutPatientVitalSignHistory(patient, from, to);
}
if (_vitalSignService.hasError) {
@ -97,11 +95,11 @@ class VitalSignsViewModel extends BaseViewModel {
oxygenation == null ||
oxygenation == 'null') {
oxygenation =
"${element.sAO2.toString()}";/* - ${element.fIO2.toString()}*/
"${element.sAO2.toString()}"; /* - ${element.fIO2.toString()}*/
}
if (painScore == null || painScore == "-") {
painScore = element.painScore.toString() != 'null'
? element.painScore.toString()
painScore = element.painScoreDesc.toString() != 'null'
? element.painScoreDesc.toString()
: "-";
painLocation = element.painLocation.toString() != 'null'
? element.painLocation.toString()

@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart';
import 'package:doctor_app_flutter/core/model/note/note_model.dart';
import 'package:doctor_app_flutter/core/model/note/update_note_model.dart';
import 'package:doctor_app_flutter/core/service/patient_service.dart';
import 'package:doctor_app_flutter/core/service/patient/patient_service.dart';
import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart';
import 'package:doctor_app_flutter/models/patient/lab_result/lab_result.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart';
@ -42,7 +42,8 @@ class PatientViewModel extends BaseViewModel {
get insuranceApporvalsList => _patientService.insuranceApporvalsList;
List<NoteModel> get patientProgressNoteList => _patientService.patientProgressNoteList;
List<NoteModel> get patientProgressNoteList =>
_patientService.patientProgressNoteList;
List<dynamic> get clinicsList => _patientService.clinicsList;
@ -65,7 +66,7 @@ class PatientViewModel extends BaseViewModel {
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else{
} else {
setState(ViewState.Idle);
}
return localRes;
@ -142,18 +143,18 @@ class PatientViewModel extends BaseViewModel {
}
Future getPatientProgressNote(patient, {bool isLocalBusy = false}) async {
if(isLocalBusy) {
if (isLocalBusy) {
setState(ViewState.BusyLocal);
}else{
} else {
setState(ViewState.Busy);
}
await _patientService.getPatientProgressNote(patient);
if (_patientService.hasError) {
error = _patientService.error;
if(isLocalBusy) {
if (isLocalBusy) {
setState(ViewState.ErrorLocal);
}else{
} else {
setState(ViewState.Error);
}
} else

@ -1,16 +1,19 @@
import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/Prescription_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart';
import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/service/prescription_service.dart';
import 'package:doctor_app_flutter/core/service/prescriptions_service.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescriptions_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart';
@ -59,7 +62,7 @@ class PrescriptionViewModel extends BaseViewModel {
getPrescriptionsInPatient(PatiantInformtion patient) async {
setState(ViewState.Busy);
error="";
error = "";
await _prescriptionsService.getPrescriptionInPatient(
mrn: patient.patientId, adn: patient.admissionNo);
if (_prescriptionsService.hasError) {

@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmac
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart';
import 'package:doctor_app_flutter/core/service/prescriptions_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescriptions_service.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:flutter/material.dart';
@ -19,16 +19,16 @@ class PrescriptionsViewModel extends BaseViewModel {
List<PrescriptionsList> _prescriptionsOrderListClinic = List();
List<PrescriptionsList> _prescriptionsOrderListHospital = List();
List<PrescriptionReport> get prescriptionReportList =>
_prescriptionsService.prescriptionReportList;
List<Prescriptions> get prescriptionsList =>
_prescriptionsService.prescriptionsList;
List<PharmacyPrescriptions> get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList ;
List<PrescriptionReportEnh> get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList;
List<PharmacyPrescriptions> get pharmacyPrescriptionsList =>
_prescriptionsService.pharmacyPrescriptionsList;
List<PrescriptionReportEnh> get prescriptionReportEnhList =>
_prescriptionsService.prescriptionReportEnhList;
List<PrescriptionsList> get prescriptionsOrderList =>
filterType == FilterType.Clinic
@ -48,6 +48,7 @@ class PrescriptionsViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
}
_getPrescriptionsOrders() async {
await _prescriptionsService.getPrescriptionsOrders();
if (_prescriptionsService.hasError) {
@ -97,15 +98,17 @@ class PrescriptionsViewModel extends BaseViewModel {
});
}
setFilterType(FilterType filterType) {
this.filterType = filterType;
notifyListeners();
}
getPrescriptionReport({Prescriptions prescriptions,@required PatiantInformtion patient}) async {
getPrescriptionReport(
{Prescriptions prescriptions,
@required PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionReport(prescriptions: prescriptions,patient: patient);
await _prescriptionsService.getPrescriptionReport(
prescriptions: prescriptions, patient: patient);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.ErrorLocal);
@ -114,11 +117,11 @@ class PrescriptionsViewModel extends BaseViewModel {
}
}
getListPharmacyForPrescriptions({int itemId,@required PatiantInformtion patient}) async {
getListPharmacyForPrescriptions(
{int itemId, @required PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _prescriptionsService.getListPharmacyForPrescriptions(itemId: itemId,patient: patient);
await _prescriptionsService.getListPharmacyForPrescriptions(
itemId: itemId, patient: patient);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.Error);
@ -127,11 +130,12 @@ class PrescriptionsViewModel extends BaseViewModel {
}
}
getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder,@required PatiantInformtion patient}) async {
getPrescriptionReportEnh(
{PrescriptionsOrder prescriptionsOrder,
@required PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder,patient: patient);
await _prescriptionsService.getPrescriptionReportEnh(
prescriptionsOrder: prescriptionsOrder, patient: patient);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.Error);
@ -139,7 +143,4 @@ class PrescriptionsViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
}
}

@ -11,9 +11,9 @@ import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_model
import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_request_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart';
import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart';
import 'package:doctor_app_flutter/core/service/labs_service.dart';
import 'package:doctor_app_flutter/core/service/procedure_service.dart';
import 'package:doctor_app_flutter/core/service/radiology_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/lab_order/labs_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/procedure/procedure_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/radiology/radiology_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
@ -43,7 +43,8 @@ class ProcedureViewModel extends BaseViewModel {
List<FinalRadiology> get radiologyList =>
_radiologyService.finalRadiologyList;
List<PatientLabOrders> get patientLabOrdersList => _labsService.patientLabOrdersList;
List<PatientLabOrders> get patientLabOrdersList =>
_labsService.patientLabOrdersList;
List<LabOrderResult> get labOrdersResultsList =>
_labsService.labOrdersResultsList;
@ -51,16 +52,14 @@ class ProcedureViewModel extends BaseViewModel {
List<PatientLabOrdersList> _patientLabOrdersListClinic = List();
List<PatientLabOrdersList> _patientLabOrdersListHospital = List();
Future getProcedure({int mrn,String patientType}) async {
Future getProcedure({int mrn, String patientType}) async {
hasError = false;
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
await _procedureService.getProcedure(mrn: mrn);
if (_procedureService.hasError) {
error = _procedureService.error;
if(patientType=="7")
if (patientType == "7")
setState(ViewState.ErrorLocal);
else
setState(ViewState.Error);
@ -135,15 +134,16 @@ class ProcedureViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
//await getProcedure(mrn: mrn);
}
void getPatientRadOrders(PatiantInformtion patient,{String patientType, bool isInPatient = false}) async {
void getPatientRadOrders(PatiantInformtion patient,
{String patientType, bool isInPatient = false}) async {
setState(ViewState.Busy);
await _radiologyService.getPatientRadOrders(patient, isInPatient:isInPatient);
await _radiologyService.getPatientRadOrders(patient,
isInPatient: isInPatient);
if (_radiologyService.hasError) {
error = _radiologyService.error;
if(patientType=="7")
if (patientType == "7")
setState(ViewState.ErrorLocal);
else
setState(ViewState.ErrorLocal);
@ -221,8 +221,6 @@ class ProcedureViewModel extends BaseViewModel {
List<LabResultList> labResultLists = List();
List<LabResultList> get labResultListsCoustom {
return labResultLists;
}
@ -232,7 +230,7 @@ class ProcedureViewModel extends BaseViewModel {
await _labsService.getPatientLabOrdersList(patient, isInpatient);
if (_labsService.hasError) {
error = _labsService.error;
setState(ViewState.Error);
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}

@ -1,7 +1,7 @@
import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart';
import 'package:doctor_app_flutter/core/service/radiology_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/radiology/radiology_service.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:flutter/foundation.dart';
@ -20,9 +20,11 @@ class RadiologyViewModel extends BaseViewModel {
? _finalRadiologyListClinic
: _finalRadiologyListHospital;
void getPatientRadOrders(PatiantInformtion patient, {isInPatient = false}) async {
void getPatientRadOrders(PatiantInformtion patient,
{isInPatient = false}) async {
setState(ViewState.Busy);
await _radiologyService.getPatientRadOrders(patient, isInPatient:isInPatient);
await _radiologyService.getPatientRadOrders(patient,
isInPatient: isInPatient);
if (_radiologyService.hasError) {
error = _radiologyService.error;
setState(ViewState.Error);

@ -1,14 +1,16 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/referral_patient_service.dart';
import 'package:doctor_app_flutter/core/service/patient/referral_patient_service.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart';
import '../../locator.dart';
import 'base_view_model.dart';
class ReferralPatientViewModel extends BaseViewModel {
ReferralPatientService _referralPatientService = locator<ReferralPatientService>();
ReferralPatientService _referralPatientService =
locator<ReferralPatientService>();
List<MyReferralPatientModel> get listMyReferralPatientModel => _referralPatientService.listMyReferralPatientModel;
List<MyReferralPatientModel> get listMyReferralPatientModel =>
_referralPatientService.listMyReferralPatientModel;
Future getMyReferralPatient() async {
setState(ViewState.Busy);
@ -20,7 +22,8 @@ class ReferralPatientViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future replay(String referredDoctorRemarks, MyReferralPatientModel model) async {
Future replay(
String referredDoctorRemarks, MyReferralPatientModel model) async {
setState(ViewState.BusyLocal);
await _referralPatientService.replay(referredDoctorRemarks, model);
if (_referralPatientService.hasError) {

@ -1,14 +1,16 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/referred_patient_service.dart';
import 'package:doctor_app_flutter/core/service/patient/referred_patient_service.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart';
import '../../locator.dart';
import 'base_view_model.dart';
class ReferredPatientViewModel extends BaseViewModel {
ReferredPatientService _referralPatientService = locator<ReferredPatientService>();
ReferredPatientService _referralPatientService =
locator<ReferredPatientService>();
List<MyReferredPatientModel> get listMyReferredPatientModel => _referralPatientService.listMyReferredPatientModel;
List<MyReferredPatientModel> get listMyReferredPatientModel =>
_referralPatientService.listMyReferredPatientModel;
Future getMyReferredPatient() async {
setState(ViewState.Busy);
@ -19,5 +21,4 @@ class ReferredPatientViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
}
}

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/schedule_service.dart';
import 'package:doctor_app_flutter/core/service/home/schedule_service.dart';
import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart';
import '../../locator.dart';
@ -8,7 +8,8 @@ import 'base_view_model.dart';
class ScheduleViewModel extends BaseViewModel {
ScheduleService _scheduleService = locator<ScheduleService>();
List<ListDoctorWorkingHoursTable> get listDoctorWorkingHoursTable => _scheduleService.listDoctorWorkingHoursTable;
List<ListDoctorWorkingHoursTable> get listDoctorWorkingHoursTable =>
_scheduleService.listDoctorWorkingHoursTable;
Future getDoctorSchedule() async {
setState(ViewState.Busy);

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/sickleave_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/sick_leave/sickleave_service.dart';
import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart';
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';

@ -1,7 +1,7 @@
import 'package:doctor_app_flutter/screens/QR_reader_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/doctor_reply_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/qr_reader/QR_reader_screen.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_drawer_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/bottom_nav_bar.dart';

@ -15,27 +15,34 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:get_it/get_it.dart';
import 'core/service/DischargedPatientService.dart';
import 'core/service/InsuranceCardService.dart';
import 'core/service/MyReferralPatientService.dart';
import 'core/service/PatientMuseService.dart';
import 'core/service/ReferralService.dart';
import 'core/service/SOAP_service.dart';
import 'core/service/doctor_reply_service.dart';
import 'core/service/home/auth_service.dart';
import 'core/service/home/dasboard_service.dart';
import 'core/service/patient/DischargedPatientService.dart';
import 'core/service/patient/patient_service.dart';
import 'core/service/patient_medical_file/insurance/InsuranceCardService.dart';
import 'core/service/patient/MyReferralPatientService.dart';
import 'core/service/patient/PatientMuseService.dart';
import 'core/service/patient/ReferralService.dart';
import 'core/service/patient_medical_file/medical_report/medical_file_service.dart';
import 'core/service/patient_medical_file/prescription/prescription_service.dart';
import 'core/service/patient_medical_file/procedure/procedure_service.dart';
import 'core/service/patient_medical_file/sick_leave/sickleave_service.dart';
import 'core/service/patient_medical_file/soap/SOAP_service.dart';
import 'core/service/home/doctor_reply_service.dart';
import 'core/service/hospitals/hospitals_service.dart';
import 'core/service/labs_service.dart';
import 'core/service/medicine_service.dart';
import 'core/service/patient-admission-request-service.dart';
import 'core/service/patient-doctor-referral-service.dart';
import 'core/service/patient-ucaf-service.dart';
import 'core/service/patient-vital-signs-service.dart';
import 'core/service/patient_medical_file/lab_order/labs_service.dart';
import 'core/service/patient_medical_file/prescription/medicine_service.dart';
import 'core/service/patient_medical_file/admission_request/patient-admission-request-service.dart';
import 'core/service/patient/patient-doctor-referral-service.dart';
import 'core/service/patient_medical_file/ucaf/patient-ucaf-service.dart';
import 'core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart';
import 'core/service/patient/out_patient_service.dart';
import 'core/service/patientInPatientService.dart';
import 'core/service/prescriptions_service.dart';
import 'core/service/radiology_service.dart';
import 'core/service/referral_patient_service.dart';
import 'core/service/referred_patient_service.dart';
import 'core/service/schedule_service.dart';
import 'core/service/patient/patientInPatientService.dart';
import 'core/service/patient_medical_file/prescription/prescriptions_service.dart';
import 'core/service/patient_medical_file/radiology/radiology_service.dart';
import 'core/service/patient/referral_patient_service.dart';
import 'core/service/patient/referred_patient_service.dart';
import 'core/service/home/schedule_service.dart';
import 'core/viewModel/DischargedPatientViewModel.dart';
import 'core/viewModel/InsuranceViewModel.dart';
import 'core/viewModel/PatientMuseViewModel.dart';

@ -15,7 +15,7 @@ class ListDoctorWorkingHoursTable {
});
ListDoctorWorkingHoursTable.fromJson(Map<String, dynamic> json) {
date = DateUtils.convertStringToDate(json['Date']);
date = AppDateUtils.convertStringToDate(json['Date']);
dayName = json['DayName'];
workingHours = json['WorkingHours'];
projectName = json['ProjectName'];

@ -70,7 +70,7 @@ class ListGtMyPatientsQuestions {
patientID = json['PatientID'];
doctorID = json['DoctorID'];
requestType = json['RequestType'];
requestDate = DateUtils.convertStringToDate(json['RequestDate']) ;
requestDate = AppDateUtils.convertStringToDate(json['RequestDate']) ;
requestTime = json['RequestTime'];
remarks = json['Remarks'];
status = json['Status'];

@ -62,7 +62,7 @@ class LabOrdersResModel {
status = json['Status'];
createdBy = json['CreatedBy'];
createdByN = json['CreatedByN'];
createdOn = DateUtils.convertStringToDate(json['CreatedOn']);
createdOn = AppDateUtils.convertStringToDate(json['CreatedOn']);
editedBy = json['EditedBy'];
editedByN = json['EditedByN'];
editedOn = json['EditedOn'];

@ -142,7 +142,7 @@ class MyReferralPatientModel {
referralResponseOn = json['ReferralResponseOn'];
priority = json['Priority'];
frequency = json['Frequency'];
mAXResponseTime = DateUtils.convertStringToDate(json['MAXResponseTime']);
mAXResponseTime = AppDateUtils.convertStringToDate(json['MAXResponseTime']);
age = json['Age'];
frequencyDescription = json['FrequencyDescription'];
genderDescription = json['GenderDescription'];

@ -125,7 +125,7 @@ class PrescriptionReportForInPatient {
orderNo = json['OrderNo'];
patientID = json['PatientID'];
pharmacyRemarks = json['PharmacyRemarks'];
prescriptionDatetime = DateUtils.convertStringToDate(json['PrescriptionDatetime']);
prescriptionDatetime = AppDateUtils.convertStringToDate(json['PrescriptionDatetime']);
prescriptionNo = json['PrescriptionNo'];
processedBy = json['ProcessedBy'];
projectID = json['ProjectID'];
@ -138,11 +138,11 @@ class PrescriptionReportForInPatient {
routeId = json['RouteId'];
routeN = json['RouteN'];
setupID = json['SetupID'];
startDatetime = DateUtils.convertStringToDate(json['StartDatetime']) ;
startDatetime = AppDateUtils.convertStringToDate(json['StartDatetime']) ;
status = json['Status'];
statusDescription = json['StatusDescription'];
statusDescriptionN = json['StatusDescriptionN'];
stopDatetime = DateUtils.convertStringToDate(json['StopDatetime']);
stopDatetime = AppDateUtils.convertStringToDate(json['StopDatetime']);
unitofMeasurement = json['UnitofMeasurement'];
unitofMeasurementDescription = json['UnitofMeasurementDescription'];
unitofMeasurementDescriptionN = json['UnitofMeasurementDescriptionN'];

@ -29,7 +29,7 @@ class VitalSignHistory {
var status;
bool isVitalsRequired;
var patientID;
var createdOn;
var createdOn;
var doctorID;
var clinicID;
var triageCategory;
@ -52,9 +52,9 @@ class VitalSignHistory {
var bloodPressureCuffLocationDesc;
var bloodPressureCuffSizeDesc;
var bloodPressurePatientPositionDesc;
var clinicName;
var doctorImageURL;
var doctorName;
var clinicName;
var doctorImageURL;
var doctorName;
var painScoreDesc;
var pulseRhythmDesc;
var respirationPatternDesc;

@ -170,7 +170,7 @@ class VitalSignResModel {
triageCategory = json['TriageCategory'];
gCScore = json['GCScore'];
lineItemNo = json['LineItemNo'];
vitalSignDate = json['VitalSignDate'] !=null? DateUtils.convertStringToDate(json['VitalSignDate']): new DateTime.now();
vitalSignDate = json['VitalSignDate'] !=null? AppDateUtils.convertStringToDate(json['VitalSignDate']): new DateTime.now();
actualTimeTaken = json['ActualTimeTaken'];
sugarLevel = json['SugarLevel'];
fBS = json['FBS'];

@ -164,14 +164,14 @@ class DoctorReplayChat extends StatelessWidget {
children: [
AppText(
reply.createdOn !=null?DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(reply.createdOn)):DateUtils.getDayMonthYearDateFormatted(DateTime.now()),
reply.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()),
fontWeight: FontWeight
.w600,
color: Colors.white,
fontSize: 14,
),
AppText(
reply.createdOn !=null?DateUtils.getHour(DateUtils.getDateTimeFromServerFormat(reply.createdOn)):DateUtils.getHour(DateTime.now()),
reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getHour(DateTime.now()),
fontSize: 14,
fontFamily: 'Poppins',
color: Colors.white,

@ -24,9 +24,9 @@ class _PatientArrivalScreen extends State<PatientArrivalScreen>
PatientMobileNumber: "0",
PatientIdentificationID: "0",
PatientID: 0,
From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd')
From: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd')
.toString(),
To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd')
To: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd')
.toString(),
LanguageID: 2,
stamp: "2020-03-02T13:56:39.170Z",

@ -0,0 +1,37 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
import 'package:doctor_app_flutter/widgets/dashboard/activity_button.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class DashboardSliderItemWidget extends StatelessWidget {
final DashboardModel item;
DashboardSliderItemWidget(this.item);
@override
Widget build(BuildContext context) {
return Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AppText(
item.kPIName,
fontSize: SizeConfig.textMultiplier * 2.2,
fontWeight: FontWeight.bold,
),
],
),
new Container(
height: 110,
child: ListView(
scrollDirection: Axis.horizontal,
children:
List.generate(item.summaryoptions.length, (int index) {
return GetActivityButton(item.summaryoptions[index]);
})))
],
);
}
}

@ -0,0 +1,260 @@
import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/dashboard/guage_chart.dart';
import 'package:doctor_app_flutter/widgets/dashboard/out_patient_stack.dart';
import 'package:doctor_app_flutter/widgets/dashboard/row_count.dart';
import 'package:doctor_app_flutter/widgets/dashboard/swiper_rounded_pagination.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:charts_flutter/flutter.dart' as charts;
class DashboardSwipeWidget extends StatefulWidget {
final List<DashboardModel> dashboardItemList;
final DashboardViewModel model;
final Function(int) sliderChange;
DashboardSwipeWidget(this.dashboardItemList, this.model, this.sliderChange);
@override
_DashboardSwipeWidgetState createState() => _DashboardSwipeWidgetState();
}
class _DashboardSwipeWidgetState extends State<DashboardSwipeWidget> {
int sliderActiveIndex = 0;
@override
Widget build(BuildContext context) {
return Container(
// height: MediaQuery.of(context).size.height * 0.35,
height: 230,
child: Swiper(
onIndexChanged: (index) {
if (mounted) {
setState(() {
sliderActiveIndex = index;
widget.sliderChange(index);
});
}
},
itemBuilder: (BuildContext context, int index) {
return getSwipeWidget(widget.dashboardItemList, index);
},
itemCount: 3,
// itemHeight: 300,
pagination: new SwiperCustomPagination(
builder: (BuildContext context, SwiperPluginConfig config) {
return new Stack(
alignment: Alignment.bottomCenter,
children: [
Positioned(
bottom: 0,
child: Center(
child: InkWell(
onTap: () {},
child: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
config.activeIndex == 0
? SwiperRoundedPagination(true)
: SwiperRoundedPagination(false),
config.activeIndex == 1
? SwiperRoundedPagination(true)
: SwiperRoundedPagination(false),
config.activeIndex == 2
? SwiperRoundedPagination(true)
: SwiperRoundedPagination(false),
],
),
),
),
),
)
],
);
}),
viewportFraction: 0.9,
// scale: 0.9,
// control: new SwiperControl(),
),
);
}
Widget getSwipeWidget(List<DashboardModel> dashboardItemList, int index) {
if (index == 1)
return RoundedContainer(
raduis: 16,
showBorder: true,
borderColor: Colors.white,
shadowWidth: 0.2,
shadowSpreadRadius: 3,
shadowDy: 1,
margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10),
child: Padding(
padding: const EdgeInsets.all(5.0),
child: GetOutPatientStack(dashboardItemList[1])));
if (index == 0)
return RoundedContainer(
raduis: 16,
showBorder: true,
borderColor: Colors.white,
shadowWidth: 0.2,
shadowSpreadRadius: 3,
shadowDy: 1,
margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10),
child: Padding(
padding: const EdgeInsets.all(5.0),
child: GetOutPatientStack(dashboardItemList[0])));
if (index == 2)
return RoundedContainer(
raduis: 16,
showBorder: true,
borderColor: Colors.white,
shadowWidth: 0.2,
shadowSpreadRadius: 3,
shadowDy: 1,
margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10),
child:
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Expanded(
flex: 1,
child: Row(
children: [
Expanded(
flex: 4,
child: Padding(
padding: const EdgeInsets.all(5.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.all(8),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.patients,
fontSize: 12,
fontWeight: FontWeight.bold,
fontHeight: 0.5,
),
AppText(
TranslationBase.of(context)
.referral,
fontSize: 22,
fontWeight: FontWeight.bold,
),
],
)),
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: RowCounts(
dashboardItemList[2]
.summaryoptions[0]
.kPIParameter,
dashboardItemList[2]
.summaryoptions[0]
.value,
Colors.black),
),
Expanded(
child: RowCounts(
dashboardItemList[2]
.summaryoptions[1]
.kPIParameter,
dashboardItemList[2]
.summaryoptions[1]
.value,
Colors.grey),
),
Expanded(
child: RowCounts(
dashboardItemList[2]
.summaryoptions[2]
.kPIParameter,
dashboardItemList[2]
.summaryoptions[2]
.value,
Colors.red),
),
],
),
)
],
)),
),
Expanded(
flex: 3,
child: Stack(children: [
Container(
child: GaugeChart(
_createReferralData(widget.dashboardItemList))),
Positioned(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
AppText(
widget.model
.getPatientCount(dashboardItemList[2])
.toString(),
fontSize: 28,
fontWeight: FontWeight.bold,
)
],
),
top: MediaQuery.of(context).size.height * 0.12,
left: 0,
right: 0)
]),
),
],
)),
]));
return Container();
}
static List<charts.Series<GaugeSegment, String>> _createReferralData(
List<DashboardModel> dashboardItemList) {
final data = [
new GaugeSegment(
dashboardItemList[2].summaryoptions[0].kPIParameter,
getValue(dashboardItemList[1].summaryoptions[0].value),
charts.MaterialPalette.black),
new GaugeSegment(
dashboardItemList[2].summaryoptions[1].kPIParameter,
getValue(dashboardItemList[1].summaryoptions[1].value),
charts.MaterialPalette.gray.shadeDefault),
new GaugeSegment(
dashboardItemList[2].summaryoptions[2].kPIParameter,
getValue(dashboardItemList[1].summaryoptions[2].value),
charts.MaterialPalette.red.shadeDefault),
];
return [
new charts.Series<GaugeSegment, String>(
id: 'Segments',
domainFn: (GaugeSegment segment, _) => segment.segment,
measureFn: (GaugeSegment segment, _) => segment.size,
data: data,
colorFn: (GaugeSegment segment, _) => segment.color,
)
];
}
static int getValue(value) {
return value == 0 ? 1 : value;
}
}

@ -26,8 +26,8 @@ class HomePageCard extends StatelessWidget {
child: Container(
width: 120,
height: MediaQuery.of(context).orientation == Orientation.portrait
? 130
: 250,
? 100
: 200,
margin: this.margin,
decoration: BoxDecoration(
color: !hasBorder
@ -41,16 +41,14 @@ class HomePageCard extends StatelessWidget {
: Border.all(width: 0.0, color: Colors.transparent),
image: imageName != null
? DecorationImage(
image: AssetImage('assets/images/dashboard/${imageName}'),
image: AssetImage('assets/images/dashboard/$imageName'),
fit: BoxFit.cover,
colorFilter: new ColorFilter.mode(
Colors.black.withOpacity(0.2), BlendMode.dstIn),
)
: null,
),
child: Center(
child: child,
),
child: child,
),
);
}

@ -0,0 +1,84 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/screens/home/home_page_card.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class HomePatientCard extends StatelessWidget {
final Color backgroundColor;
final IconData cardIcon;
final Color backgroundIconColor;
final String text;
final Color textColor;
final Function onTap;
HomePatientCard({
@required this.backgroundColor,
@required this.backgroundIconColor,
@required this.cardIcon,
@required this.text,
@required this.textColor,
@required this.onTap,
});
@override
Widget build(BuildContext context) {
return HomePageCard(
color: backgroundColor,
margin: EdgeInsets.all(4),
child: Container(
padding: EdgeInsets.all(8),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Stack(
children: [
Positioned(
bottom: 0.1,
right: 0.5,
width: 23.0,
height: 25.0,
child: Icon(
cardIcon,
size: 60,
color: backgroundIconColor,
),
),
Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(
cardIcon,
size: 30,
color: textColor,
),
SizedBox(
height: 4,
),
],
),
),
],
),
),
Expanded(
child: Container(
child: AppText(
text,
color: textColor,
textAlign: TextAlign.start,
fontSize: SizeConfig.textMultiplier * 1.6,
),
),
),
],
),
),
hasBorder: false,
onTap: onTap,
);
}
}

@ -1,9 +1,5 @@
import 'package:charts_flutter/flutter.dart' as charts;
import 'package:doctor_app_flutter/config/config.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/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
@ -13,39 +9,30 @@ import 'package:doctor_app_flutter/models/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/home/dashboard_slider-item-widget.dart';
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/medicine/medicine_search_screen.dart';
import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.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/profile/referral/patient_referral_screen.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.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/dashboard/activity_button.dart';
import 'package:doctor_app_flutter/widgets/dashboard/guage_chart.dart';
import 'package:doctor_app_flutter/widgets/dashboard/out_patient_stack.dart';
import 'package:doctor_app_flutter/widgets/dashboard/row_count.dart';
import 'package:doctor_app_flutter/widgets/dashboard/swiper_rounded_pagination.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:provider/provider.dart';
import 'package:sticky_headers/sticky_headers/widget.dart';
import '../../widgets/shared/app_texts_widget.dart';
import '../../widgets/shared/rounded_container_widget.dart';
import 'home_page_card.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Helpers helpers = Helpers();
class HomeScreen extends StatefulWidget {
HomeScreen({Key key, this.title}) : super(key: key);
@ -64,56 +51,25 @@ class _HomeScreenState extends State<HomeScreen> {
DoctorProfileModel profile;
bool isExpanded = false;
bool isInpatient = false;
var clinicName = [];
int sliderActiveIndex = 0;
var clinicId;
var _patientSearchFormValues;
AuthenticationViewModel authenticationViewModel;
void didChangeDependencies() async {
super.didChangeDependencies();
if (_isInit) {
projectsProvider = Provider.of<ProjectViewModel>(context);
authenticationViewModel = Provider.of<AuthenticationViewModel>(context);
projectsProvider.getDoctorClinicsList();
// _firebaseMessaging.setAutoInitEnabled(true);
_firebaseMessaging.requestNotificationPermissions(
const IosNotificationSettings(
sound: true, badge: true, alert: true, provisional: true));
_firebaseMessaging.onIosSettingsRegistered
.listen((IosNotificationSettings settings) {
print("Settings registered: $settings");
});
clinicName = await sharedPref.getObj(CLINIC_NAME);
print(clinicName);
_firebaseMessaging.getToken().then((String token) async {
if (token != '') {
DEVICE_TOKEN = token;
await authenticationViewModel.insertDeviceImei();
changeIsLoading(false);
}
});
}
_isInit = false;
}
BuildContext myContext;
@override
Widget build(BuildContext context) {
myContext = context;
projectsProvider = Provider.of(context);
FocusScopeNode currentFocus = FocusScope.of(context);
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context);
AuthViewModel authProvider = Provider.of<AuthViewModel>(context);
authenticationViewModel = Provider.of<AuthenticationViewModel>(context);
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
return BaseView<DashboardViewModel>(
onModelReady: (model) => model.getDashboard(),
onModelReady: (model) async {
await model.setFirebaseNotification(projectsProvider, authProvider);
await model.getDashboard();
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
@ -138,7 +94,6 @@ class _HomeScreenState extends State<HomeScreen> {
children: [
Container(
width: MediaQuery.of(context).size.width * .6,
// // height: 100,
child: projectsProvider.doctorClinicsList.length >
0
? Stack(
@ -164,36 +119,49 @@ class _HomeScreenState extends State<HomeScreen> {
mainAxisAlignment:
MainAxisAlignment.end,
children: <Widget>[
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: new Text(
projectsProvider
.doctorClinicsList
.length
.toString(),
style: new TextStyle(
color: Colors.white,
fontSize:
projectsProvider
.isArabic
? 10
: 11,
),
textAlign:
TextAlign.center,
),
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(
projectsProvider
.doctorClinicsList
.length
.toString(),
color:
Colors.white,
fontSize:
projectsProvider
.isArabic
? 10
: 11,
textAlign:
TextAlign
.center,
),
)),
],
),
AppText(item.clinicName,
fontSize: 12,
@ -205,10 +173,19 @@ class _HomeScreenState extends State<HomeScreen> {
);
}).toList();
},
onChanged: (newValue) {
onChanged: (newValue) async {
clinicId = newValue;
changeClinic(
newValue, context, model);
GifLoaderDialogUtils.showMyDialog(
context);
await model.changeClinic(
newValue, authProvider);
GifLoaderDialogUtils.hideDialog(
context);
if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
}
},
items: projectsProvider
.doctorClinicsList
@ -236,63 +213,17 @@ class _HomeScreenState extends State<HomeScreen> {
])),
content: Column(
children: [
Container(
height: MediaQuery.of(context).size.height * 0.35,
child: model.dashboardItemsList.length > 0
? new Swiper(
onIndexChanged: (index) {
if (mounted) {
setState(() {
sliderActiveIndex = index;
});
}
},
itemBuilder: (BuildContext context, int index) {
return getSwipeWidget(model)[index];
},
itemCount: 3,
itemHeight: 300,
pagination: new SwiperCustomPagination(builder:
(BuildContext context,
SwiperPluginConfig config) {
return new Stack(
alignment: Alignment.bottomCenter,
children: [
Positioned(
bottom: 0,
child: Center(
child: InkWell(
onTap: () {},
child: Container(
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
config.activeIndex == 0
? SwiperRoundedPagination(
true)
: SwiperRoundedPagination(
false),
config.activeIndex == 1
? SwiperRoundedPagination(
true)
: SwiperRoundedPagination(
false),
config.activeIndex == 2
? SwiperRoundedPagination(
true)
: SwiperRoundedPagination(
false),
],
)))))
]);
}),
viewportFraction: 0.9,
// scale: 0.9,
// control: new SwiperControl(),
)
: SizedBox()),
model.dashboardItemsList.length > 0
? DashboardSwipeWidget(
model.dashboardItemsList,
model,
(sliderIndex) {
setState(() {
sliderActiveIndex = sliderIndex;
});
},
)
: SizedBox(),
model.dashboardItemsList.length > 0
? FractionallySizedBox(
widthFactor: 0.90,
@ -304,111 +235,13 @@ class _HomeScreenState extends State<HomeScreen> {
height: 10,
),
sliderActiveIndex == 1
? Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
AppText(
model.dashboardItemsList[3]
.kPIName,
fontSize:
SizeConfig.textMultiplier *
2.2,
fontWeight: FontWeight.bold,
),
],
),
new Container(
height: 130,
child: new ListView(
scrollDirection:
Axis.horizontal,
children: new List.generate(
model
.dashboardItemsList[3]
.summaryoptions
.length, (int index) {
return GetActivityButton(model
.dashboardItemsList[3]
.summaryoptions[index]);
})))
],
)
? DashboardSliderItemWidget(
model.dashboardItemsList[3])
: sliderActiveIndex == 0
? Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
AppText(
model.dashboardItemsList[6]
.kPIName,
fontSize: SizeConfig
.textMultiplier *
2.2,
fontWeight: FontWeight.bold,
),
],
),
new Container(
height: 130,
child: new ListView(
scrollDirection: Axis
.horizontal,
children: new List
.generate(
model
.dashboardItemsList[
6]
.summaryoptions
.length,
(int index) {
return GetActivityButton(model
.dashboardItemsList[
6]
.summaryoptions[index]);
})))
],
)
: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
AppText(
model.dashboardItemsList[4]
.kPIName,
fontSize: SizeConfig
.textMultiplier *
2.2,
fontWeight: FontWeight.bold,
),
],
),
new Container(
height: 130,
child: new ListView(
scrollDirection: Axis
.horizontal,
children: new List
.generate(
model
.dashboardItemsList[
4]
.summaryoptions
.length,
(int index) {
return GetActivityButton(model
.dashboardItemsList[
4]
.summaryoptions[index]);
})))
],
),
? DashboardSliderItemWidget(
model.dashboardItemsList[6])
: DashboardSliderItemWidget(
model.dashboardItemsList[4]),
])))
: SizedBox(),
FractionallySizedBox(
@ -423,89 +256,46 @@ class _HomeScreenState extends State<HomeScreen> {
margin: EdgeInsets.only(top: 10),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 10,
),
Row(
children: <Widget>[
Container(
width: 150,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).patients,
style: TextStyle(
fontSize: 12,
height: .5,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins'),
),
Text(
TranslationBase.of(context).services,
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins'),
),
],
)),
Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).patients,
fontSize: 12,
fontWeight: FontWeight.bold,
fontHeight: .5,
),
AppText(
TranslationBase.of(context).services,
fontSize: 22,
fontWeight: FontWeight.bold,
),
],
),
)),
SizedBox(
height: 10,
),
new Container(
height: 130,
child: new ListView(
Container(
height: 120,
child: ListView(
scrollDirection: Axis.horizontal,
children: [
HomePageCard(
color: Color(0xffD02127),
margin: EdgeInsets.all(5),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(
top: 10, left: 10, right: 0),
child: Stack(
children: [
Positioned(
bottom: 0.1,
right: 0.5,
width: 23.0,
height: 25.0,
child: Icon(
DoctorApp.inpatient,
size: 65,
color: Colors.white12,
),
),
Icon(
DoctorApp.inpatient,
size: 32,
color: Colors.white,
),
],
)),
Container(
padding: EdgeInsets.all(10),
child: AppText(
"My\n"+TranslationBase.of(context).inPatient,
color: Colors.white,
textAlign: TextAlign.start,
fontSize: 15,
))
],
),
hasBorder: false,
HomePatientCard(
backgroundColor: Color(0xffD02127),
backgroundIconColor: Colors.white12,
cardIcon: DoctorApp.inpatient,
textColor: Colors.white,
text:
TranslationBase.of(context)
.myInPatient,
onTap: () {
Navigator.push(
context,
@ -515,54 +305,16 @@ class _HomeScreenState extends State<HomeScreen> {
);
},
),
HomePageCard(
color: Colors.grey[300],
margin: EdgeInsets.all(5),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(
top: 10, left: 10, right: 0),
child: Stack(
children: [
Positioned(
bottom: 0.1,
right: 0.5,
width: 23.0,
height: 25.0,
child: Icon(
DoctorApp
.arrival_patients,
size: 65,
color: Colors.white38,
),
),
Icon(
DoctorApp.arrival_patients,
size: 35,
color: Colors.black,
),
],
)),
Container(
padding: EdgeInsets.all(10),
child: AppText(
TranslationBase.of(context)
.myOutPatient,
color: Colors.black,
textAlign: TextAlign.start,
fontSize: 15,
))
],
),
hasBorder: false,
HomePatientCard(
backgroundColor: Colors.grey[300],
backgroundIconColor: Colors.white38,
cardIcon: DoctorApp.arrival_patients,
textColor: Colors.black,
text: TranslationBase.of(context)
.myOutPatient,
onTap: () {
String date =
DateUtils.convertDateToFormat(
AppDateUtils.convertDateToFormat(
DateTime(
DateTime.now().year,
DateTime.now().month,
@ -583,106 +335,30 @@ class _HomeScreenState extends State<HomeScreen> {
));
},
),
HomePageCard(
color: Color(0xff2B353E),
margin: EdgeInsets.all(5),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(
top: 10, left: 10, right: 0),
child: Stack(
children: [
Positioned(
bottom: 0.1,
right: 0.5,
width: 23.0,
height: 25.0,
child: Icon(
DoctorApp.referral_1,
size: 65,
color: Colors.white10
.withOpacity(0.1),
),
),
Icon(
DoctorApp.referral_1,
size: 35,
color: Colors.white,
),
],
)),
Container(
padding: EdgeInsets.all(10),
child: AppText(
TranslationBase.of(context)
.patientsreferral,
color: Colors.white,
textAlign: TextAlign.start,
fontSize: 15,
))
],
),
hasBorder: false,
HomePatientCard(
backgroundColor: Color(0xff2B353E),
backgroundIconColor: Colors.white10,
cardIcon: DoctorApp.referral_1,
textColor: Colors.white,
text: TranslationBase.of(context)
.patientsreferral,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
PatientReferralScreen(),
// MyReferredPatient(),
),
);
},
),
HomePageCard(
color: Color(0xffD02127),
margin: EdgeInsets.all(5),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(
top: 10, left: 10, right: 0),
child: Stack(
children: [
Positioned(
bottom: 0.1,
right: 0.5,
width: 23.0,
height: 25.0,
child: Icon(
DoctorApp.search,
size: 65,
color: Colors.white10,
),
),
Icon(
DoctorApp.search,
size: 35,
color: Colors.white,
),
],
)),
Container(
padding: EdgeInsets.all(10),
child: AppText(
TranslationBase.of(context)
.searchPatient,
color: Colors.white,
textAlign: TextAlign.start,
fontSize: 13,
))
],
),
hasBorder: false,
HomePatientCard(
backgroundColor: Color(0xffD02127),
backgroundIconColor: Colors.white10,
cardIcon: DoctorApp.search,
textColor: Colors.white,
text: TranslationBase.of(context)
.searchPatient,
onTap: () {
Navigator.push(
context,
@ -692,51 +368,13 @@ class _HomeScreenState extends State<HomeScreen> {
));
},
),
HomePageCard(
color: Color(0xffC9C9C9),
margin: EdgeInsets.all(5),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(
top: 10, left: 10, right: 0),
child: Stack(
children: [
Positioned(
bottom: 0.1,
right: 0.5,
width: 23.0,
height: 25.0,
child: Icon(
DoctorApp
.search_medicines,
color: Colors.black12,
size: 65,
),
),
Icon(
DoctorApp.search_medicines,
size: 40,
color: Color(0xff2B353E),
),
],
)),
Container(
padding: EdgeInsets.all(10),
child: AppText(
TranslationBase.of(context)
.searchMedicine,
color: Color(0xff2B353E),
textAlign: TextAlign.start,
fontSize: 13,
))
],
),
hasBorder: false,
HomePatientCard(
backgroundColor: Color(0xffC9C9C9),
backgroundIconColor: Colors.black12,
cardIcon: DoctorApp.search_medicines,
textColor: Color(0xff2B353E),
text: TranslationBase.of(context)
.searchMedicine,
onTap: () {
Navigator.push(
context,
@ -745,17 +383,8 @@ class _HomeScreenState extends State<HomeScreen> {
MedicineSearchScreen(),
));
},
)
),
])),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: 8,
),
],
),
SizedBox(
height: 20,
),
@ -771,206 +400,4 @@ class _HomeScreenState extends State<HomeScreen> {
),
);
}
static List<charts.Series<GaugeSegment, String>> _createReferralData(model) {
final data = [
new GaugeSegment(
model.dashboardItemsList[2].summaryoptions[0].kPIParameter,
getValue(model.dashboardItemsList[1].summaryoptions[0].value),
charts.MaterialPalette.black),
new GaugeSegment(
model.dashboardItemsList[2].summaryoptions[1].kPIParameter,
getValue(model.dashboardItemsList[1].summaryoptions[1].value),
charts.MaterialPalette.gray.shadeDefault),
new GaugeSegment(
model.dashboardItemsList[2].summaryoptions[2].kPIParameter,
getValue(model.dashboardItemsList[1].summaryoptions[2].value),
charts.MaterialPalette.red.shadeDefault),
];
return [
new charts.Series<GaugeSegment, String>(
id: 'Segments',
domainFn: (GaugeSegment segment, _) => segment.segment,
measureFn: (GaugeSegment segment, _) => segment.size,
data: data,
colorFn: (GaugeSegment segment, _) => segment.color,
)
];
}
static int getValue(value) {
return value == 0 ? 1 : value;
}
changeClinic(clinicId, BuildContext context, model) async {
GifLoaderDialogUtils.showMyDialog(context);
DoctorProfileModel doctorProfile = authenticationViewModel.doctorProfile;
ClinicModel clinic = ClinicModel(clinicID:clinicId, doctorID: doctorProfile.doctorID,projectID: doctorProfile.projectID, );
await authenticationViewModel.getDoctorProfileBasedOnClinic(clinic);
if(authenticationViewModel.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(authenticationViewModel.error);
}
GifLoaderDialogUtils.hideDialog(context);
}
changeIsLoading(bool val) {
setState(() {
this.isLoading = val;
});
}
getPatientCount(DashboardModel inPatientCount) {
int value = 0;
inPatientCount.summaryoptions.forEach((result) => {value += result.value});
return value.toString();
}
List<Widget> getSwipeWidget(model) {
return [
RoundedContainer(
height: MediaQuery.of(context).size.height * 0.35,
margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10),
child: Padding(
padding: const EdgeInsets.all(5.0),
child: GetOutPatientStack(model.dashboardItemsList[1]))),
RoundedContainer(
height: MediaQuery.of(context).size.height * 0.35,
margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10),
child: Padding(
padding: const EdgeInsets.all(5.0),
child: GetOutPatientStack(model.dashboardItemsList[0]))),
RoundedContainer(
height: MediaQuery.of(context).size.height * 0.35,
margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10),
child:
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Expanded(
flex: 1,
child: Row(
children: [
Expanded(
flex: 4,
child: Padding(
padding: const EdgeInsets.all(5.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: Padding(
padding: EdgeInsets.all(8),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context)
.patients,
style: TextStyle(
fontSize: 12,
height: .5,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins'),
),
Text(
TranslationBase.of(context)
.referral,
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins'),
),
],
))),
Expanded(
flex: 2,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
RowCounts(
model.dashboardItemsList[2]
.summaryoptions[0].kPIParameter,
model.dashboardItemsList[2]
.summaryoptions[0].value,
Colors.black),
RowCounts(
model.dashboardItemsList[2]
.summaryoptions[1].kPIParameter,
model.dashboardItemsList[2]
.summaryoptions[1].value,
Colors.grey),
RowCounts(
model.dashboardItemsList[2]
.summaryoptions[2].kPIParameter,
model.dashboardItemsList[2]
.summaryoptions[2].value,
Colors.red),
],
),
)
],
))),
Expanded(
flex: 3,
child: Stack(children: [
Container(
child: GaugeChart(_createReferralData(model))),
Positioned(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
AppText(
getPatientCount(model.dashboardItemsList[2])
.toString(),
fontSize: 30,
fontWeight: FontWeight.bold,
)
],
),
top: MediaQuery.of(context).size.height * 0.12,
left: 0,
right: 0)
]),
),
],
)),
])),
];
}
getRequestHeader(isInpatient) {
_patientSearchFormValues = PatientModel(
FirstName: "0",
MiddleName: "0",
LastName: "0",
PatientMobileNumber: "0",
PatientIdentificationID: "0",
PatientID: 0,
From: isInpatient == true
? '0'
: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd')
.toString(),
To: isInpatient == true
? '0'
: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd')
.toString(),
LanguageID: 2,
stamp: "2020-03-02T13:56:39.170Z",
IPAdress: "11.11.11.11",
VersionID: 1.2,
Channel: 9,
TokenID: "2Fi7HoIHB0eDyekVa6tCJg==",
SessionID: "5G0yXn0Jnq",
IsLoginForDoctorApp: true,
PatientOutSA: false);
}
}

@ -170,7 +170,7 @@ class _HealthSummaryPageState extends State<HealthSummaryPage> {
.timelines[index]
.doctorImage,
appointmentDate:
DateUtils.getDateTimeFromServerFormat(
AppDateUtils.getDateTimeFromServerFormat(
model.medicalFileList[0].entityList[0]
.timelines[index].date,
),

@ -113,7 +113,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
isMedicalFile: true,
episode: episode,
vistDate:
'${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(
'${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(
vistDate,
), isArabic: projectViewModel.isArabic)}',
),
@ -629,7 +629,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
": ",
),
AppText(
DateUtils.getDateFormatted(
AppDateUtils.getDateFormatted(
DateTime
.parse(
model

@ -3,7 +3,7 @@ import 'dart:math';
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/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/medicine_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/medicine/pharmacies_list_screen.dart';

@ -277,7 +277,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
style: TextStyle(fontSize: 14)),
new TextSpan(
text: model.filterData[index].admissionDate == null ? ""
: "${DateUtils.convertDateFromServerFormat(model.filterData[index].admissionDate.toString(), 'yyyy-MM-dd')}",
: "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].admissionDate.toString(), 'yyyy-MM-dd')}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 15)),
@ -301,7 +301,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
style: TextStyle(fontSize: 14)),
new TextSpan(
text: model.filterData[index].dischargeDate == null ? ""
: "${DateUtils.convertDateFromServerFormat(model.filterData[index].dischargeDate.toString(), 'yyyy-MM-dd')}",
: "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].dischargeDate.toString(), 'yyyy-MM-dd')}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 15)),
@ -316,7 +316,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
fontSize: 14,fontWeight: FontWeight.w300,
),
AppText(
"${DateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(DateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}",
"${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}",
fontSize: 15,
fontWeight: FontWeight.w700),
],
@ -332,11 +332,12 @@ class _DischargedPatientState extends State<DischargedPatient> {
)),
],
),
))
],
),
),
),],
),
),)
);
}

@ -100,8 +100,8 @@ class ECGPage extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
AppText('${DateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime,isArabic: projectViewModel.isArabic)}',color: Colors.black,fontWeight: FontWeight.w600,fontSize: 14,),
AppText('${DateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',fontWeight: FontWeight.w600,color: Colors.grey[700],fontSize: 14,),
AppText('${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime,isArabic: projectViewModel.isArabic)}',color: Colors.black,fontWeight: FontWeight.w600,fontSize: 14,),
AppText('${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',fontWeight: FontWeight.w600,color: Colors.grey[700],fontSize: 14,),
],
),
),

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.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/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -16,8 +16,8 @@ class PatientInPatientScreen extends StatefulWidget {
_PatientInPatientScreenState createState() => _PatientInPatientScreenState();
}
class _PatientInPatientScreenState extends State<PatientInPatientScreen> with SingleTickerProviderStateMixin{
class _PatientInPatientScreenState extends State<PatientInPatientScreen>
with SingleTickerProviderStateMixin {
TabController _tabController;
int _activeTab = 0;
@ -85,7 +85,8 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> with Si
child: Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(
preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070),
preferredSize: Size.fromHeight(
MediaQuery.of(context).size.height * 0.070),
child: Container(
height: MediaQuery.of(context).size.height * 0.070,
decoration: BoxDecoration(
@ -103,12 +104,18 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> with Si
indicatorWeight: 1.0,
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor,
labelPadding: EdgeInsets.only(top: 0, left:0, right: 0,bottom: 0),
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, "My InPatients", counter: model.myIinPatientList.length),
tabWidget(screenSize, _activeTab == 2, TranslationBase.of(context).discharged),
tabWidget(screenSize, _activeTab == 0,
TranslationBase.of(context).inPatientAll,
counter: model.inPatientList.length),
tabWidget(
screenSize, _activeTab == 1, "My InPatients",
counter: model.myIinPatientList.length),
tabWidget(screenSize, _activeTab == 2,
TranslationBase.of(context).discharged),
],
),
),
@ -137,15 +144,13 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> with Si
);
}
Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1}){
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 /*B8382B*/) : Color(0xFFEAEAEA),
isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4,
borderWidth: 0),
@ -164,9 +169,7 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> with Si
width: 15,
height: 15,
decoration: BoxDecoration(
color: isActive
? Colors.white
: Color(0xFFD02127),
color: isActive ? Colors.white : Color(0xFFD02127),
shape: BoxShape.circle,
),
child: Center(

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/DischargeReferralPatient.dart';
import 'package:doctor_app_flutter/core/model/referral/DischargeReferralPatient.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
@ -13,12 +13,12 @@ import 'package:flutter/material.dart';
import '../../routes.dart';
class ReferralDischargedPatientDetails extends StatelessWidget {
final DischargeReferralPatient referredPatient;
ReferralDischargedPatientDetails(this.referredPatient,);
ReferralDischargedPatientDetails(
this.referredPatient,
);
@override
Widget build(BuildContext context) {
@ -68,16 +68,19 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
InkWell(
onTap: () {
PatiantInformtion patient =
model.getPatientFromDischargeReferralPatient(referredPatient);
model.getPatientFromDischargeReferralPatient(
referredPatient);
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patient,
"patientType": "1",
"isInpatient": true,
"arrivalType": "1",
"isDischargedPatient":true,
"from": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
"to": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
"isDischargedPatient": true,
"from": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
"to": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
});
},
child: Icon(
@ -87,7 +90,6 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
)
]),
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -124,7 +126,9 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
: Colors.red[700],
),
AppText(
DateUtils.getDayMonthYearDateFormatted(referredPatient.referralDate,),
AppDateUtils.getDayMonthYearDateFormatted(
referredPatient.referralDate,
),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 2.0 * SizeConfig.textMultiplier,
@ -132,7 +136,6 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
@ -146,13 +149,13 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
),
Expanded(
child: AppText(
DateUtils.convertDateFromServerFormat(
AppDateUtils.convertDateFromServerFormat(
referredPatient.admissionDate,
"dd MMM,yyyy"),
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
@ -171,13 +174,13 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
),
Expanded(
child: AppText(
DateUtils.convertDateFromServerFormat(
AppDateUtils.convertDateFromServerFormat(
referredPatient.dischargeDate,
"dd MMM,yyyy"),
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
@ -196,11 +199,11 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
),
Expanded(
child: AppText(
"${DateUtils.convertStringToDate(referredPatient.dischargeDate).difference(DateUtils.convertStringToDate(referredPatient.admissionDate)).inDays+1}",
"${AppDateUtils.convertStringToDate(referredPatient.dischargeDate).difference(AppDateUtils.convertStringToDate(referredPatient.admissionDate)).inDays + 1}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
@ -223,20 +226,19 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
MainAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
@ -244,7 +246,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize:
1.7 * SizeConfig.textMultiplier,
1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
AppText(
@ -252,17 +254,16 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
],
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
@ -270,7 +271,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
MainAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).refClinic}: ",
@ -293,13 +294,13 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.frequency +
.frequency +
": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
@ -343,13 +344,12 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
@ -363,11 +363,12 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
),
Expanded(
child: AppText(
referredPatient.referringClinicDescription,
referredPatient
.referringClinicDescription,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
@ -390,13 +391,12 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
@ -414,15 +414,12 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
@ -438,7 +435,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
),
Expanded(
child: AppText(
DateUtils.convertDateFromServerFormat(
AppDateUtils.convertDateFromServerFormat(
referredPatient.mAXResponseTime,
"dd MMM,yyyy"),
fontFamily: 'Poppins',
@ -462,40 +459,40 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
width: 30,
),
),
//TODO from backend
// Container(
// margin: EdgeInsets.only(
// left: 0,
// top: 25,
// right: 0,
// bottom: 0),
// padding: EdgeInsets.only(
// left: 4.0, right: 4.0),
// child: referredPatient.doctorImageURL !=
// null
// ? ClipRRect(
// borderRadius:
// BorderRadius.circular(20.0),
// child: Image.network(
// referredPatient.doctorImageURL,
// height: 25,
// width: 30,
// errorBuilder:
// (BuildContext context,
// Object exception,
// StackTrace stackTrace) {
// return Text('No Image');
// },
// ))
// : Container(
// child: Image.asset(
// referredPatient.gender == 1
// ? 'assets/images/male_avatar.png'
// : 'assets/images/female_avatar.png',
// fit: BoxFit.cover,
// ),
// ),
// ),
//TODO from backend
// Container(
// margin: EdgeInsets.only(
// left: 0,
// top: 25,
// right: 0,
// bottom: 0),
// padding: EdgeInsets.only(
// left: 4.0, right: 4.0),
// child: referredPatient.doctorImageURL !=
// null
// ? ClipRRect(
// borderRadius:
// BorderRadius.circular(20.0),
// child: Image.network(
// referredPatient.doctorImageURL,
// height: 25,
// width: 30,
// errorBuilder:
// (BuildContext context,
// Object exception,
// StackTrace stackTrace) {
// return Text('No Image');
// },
// ))
// : Container(
// child: Image.asset(
// referredPatient.gender == 1
// ? 'assets/images/male_avatar.png'
// : 'assets/images/female_avatar.png',
// fit: BoxFit.cover,
// ),
// ),
// ),
Expanded(
flex: 4,
child: Container(
@ -575,13 +572,11 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
SizedBox(
height: 8,
),
],
),
),
),
),
],
),
),

@ -67,8 +67,8 @@ class _ReferralDischargedPatientPageState extends State<ReferralDischargedPatien
referralStatusCode: model.myDischargeReferralPatient[index].referralStatus,
patientName: model.myDischargeReferralPatient[index].firstName+" "+model.myDischargeReferralPatient[index].lastName,
patientGender: model.myDischargeReferralPatient[index].gender,
referredDate: DateUtils.getDayMonthYearDateFormatted(model.myDischargeReferralPatient[index].referralDate),
referredTime: DateUtils.getTimeHHMMA(model.myDischargeReferralPatient[index].referralDate),
referredDate: AppDateUtils.getDayMonthYearDateFormatted(model.myDischargeReferralPatient[index].referralDate),
referredTime: AppDateUtils.getTimeHHMMA(model.myDischargeReferralPatient[index].referralDate),
patientID: "${model.myDischargeReferralPatient[index].patientID}",
isSameBranch: false,
isReferral: true,

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save