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

@ -48,6 +48,7 @@ const Map<String, Map<String, String>> localizedValues = {
'service': {'en': 'Service', 'ar': 'خدمة'}, 'service': {'en': 'Service', 'ar': 'خدمة'},
'referral': {'en': 'Referral', 'ar': 'الإحالة'}, 'referral': {'en': 'Referral', 'ar': 'الإحالة'},
'inPatient': {'en': 'InPatients', 'ar': 'مرضاي'}, 'inPatient': {'en': 'InPatients', 'ar': 'مرضاي'},
'myInPatient': {'en': 'My\nInPatients', 'ar': 'مرضاي'},
'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'}, 'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'},
'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى'}, 'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى'},
'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'},
@ -481,8 +482,10 @@ const Map<String, Map<String, String>> localizedValues = {
'emergencyCase': {'en': "Emergency Case", 'ar': 'حالة طارئة'}, 'emergencyCase': {'en': "Emergency Case", 'ar': 'حالة طارئة'},
'durationOfIllness': {'en': "duration Of Illness", 'ar': 'مدة المرض'}, 'durationOfIllness': {'en': "duration Of Illness", 'ar': 'مدة المرض'},
'chiefComplaintsAndSymptoms': { 'chiefComplaintsAndSymptoms': {
'en': "CHIEF COMPLAINTS & OTHER SYMPTOMS", 'en': "CHIEF COMPLAINTS",
'ar': 'شكاوى الرئيس وأعراض أخرى' 'ar': 'شكاوى الرئيس'
// 'en': "CHIEF COMPLAINTS & OTHER SYMPTOMS",
// 'ar': 'شكاوى الرئيس وأعراض أخرى'
}, },
'patientFeelsPainInHisBackAndCough': { 'patientFeelsPainInHisBackAndCough': {
'en': "Patient Feels pain in his back and cough", 'en': "Patient Feels pain in his back and cough",
@ -972,4 +975,7 @@ const Map<String, Map<String, String>> localizedValues = {
"none": {"en": "None", "ar": "لا شيء"}, "none": {"en": "None", "ar": "لا شيء"},
"notRepliedYet": {"en": "Not Replied yet", "ar": "لم يرد بعد"}, "notRepliedYet": {"en": "Not Replied yet", "ar": "لم يرد بعد"},
"clearText": {"en": "Clear Text", "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']; clinicID = json['ClinicID'];
companyName = json['CompanyName']; companyName = json['CompanyName'];
despensedStatus = json['Despensed_Status']; despensedStatus = json['Despensed_Status'];
dischargeDate = DateUtils.convertStringToDate(json['DischargeDate']); dischargeDate = AppDateUtils.convertStringToDate(json['DischargeDate']);
dischargeNo = json['DischargeNo']; dischargeNo = json['DischargeNo'];
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
doctorImageURL = json['DoctorImageURL']; doctorImageURL = json['DoctorImageURL'];

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

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

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

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

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

@ -159,7 +159,7 @@ class MyReferralPatientModel {
referralClinic = json['ReferralClinic']; referralClinic = json['ReferralClinic'];
referringClinic = json['ReferringClinic']; referringClinic = json['ReferringClinic'];
referralStatus = json['ReferralStatus']; referralStatus = json['ReferralStatus'];
referralDate = DateUtils.convertStringToDate(json['ReferralDate']); referralDate = AppDateUtils.convertStringToDate(json['ReferralDate']);
referringDoctorRemarks = json['ReferringDoctorRemarks']; referringDoctorRemarks = json['ReferringDoctorRemarks'];
referredDoctorRemarks = json['ReferredDoctorRemarks']; referredDoctorRemarks = json['ReferredDoctorRemarks'];
referralResponseOn = json['ReferralResponseOn']; 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,5 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart'; 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/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
@ -8,7 +8,7 @@ class DischargedPatientService extends BaseService {
List<DischargeReferralPatient> myDischargeReferralPatients = List(); List<DischargeReferralPatient> myDischargeReferralPatients = List();
Future getDischargedPatient() async { Future getDischargedPatient() async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
await getDoctorProfile(isGetProfile: true); await getDoctorProfile(isGetProfile: true);
@ -63,14 +63,14 @@ class DischargedPatientService extends BaseService {
myDischargeReferralPatients.clear(); myDischargeReferralPatients.clear();
await baseAppClient.post(GET_MY_DISCHARGE_PATIENT, await baseAppClient.post(GET_MY_DISCHARGE_PATIENT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
if (response['List_MyDischargeReferralPatient'] != null) { if (response['List_MyDischargeReferralPatient'] != null) {
response['List_MyDischargeReferralPatient'].forEach((v) { response['List_MyDischargeReferralPatient'].forEach((v) {
myDischargeReferralPatients.add(DischargeReferralPatient.fromJson(v)); myDischargeReferralPatients.add(DischargeReferralPatient.fromJson(v));
}); });
} }
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
} }
} }

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart'; 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/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.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; hasError = false;
await getDoctorProfile(); await getDoctorProfile();
RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks(); RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks =
RequestAddReferredDoctorRemarks();
_requestAddReferredDoctorRemarks.projectID = referral.projectID; _requestAddReferredDoctorRemarks.projectID = referral.projectID;
_requestAddReferredDoctorRemarks.admissionNo = referral.admissionNo.toString(); _requestAddReferredDoctorRemarks.admissionNo =
referral.admissionNo.toString();
_requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo; _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo;
_requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks; _requestAddReferredDoctorRemarks.referredDoctorRemarks =
referredDoctorRemarks;
_requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID; _requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID;
_requestAddReferredDoctorRemarks.patientID = referral.patientID; _requestAddReferredDoctorRemarks.patientID = referral.patientID;
_requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor; _requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor;
await baseAppClient.post( await baseAppClient.post(
ADD_REFERRED_DOCTOR_REMARKS, ADD_REFERRED_DOCTOR_REMARKS,
body: _requestAddReferredDoctorRemarks.toJson(), body: _requestAddReferredDoctorRemarks.toJson(),
onSuccess: (dynamic body, int statusCode) { onSuccess: (dynamic body, int statusCode) {},
},
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -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/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'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class ReferralService extends BaseService { class ReferralService extends BaseService {
Future referralPatient( Future referralPatient(
{int admissionNo, {int admissionNo,
String roomID, String roomID,

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart'; 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/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.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> _patientList = [];
List<PatiantInformtion> get patientList => _patientList; List<PatiantInformtion> get patientList => _patientList;
Future getOutPatient(
Future getOutPatient(PatientSearchRequestModel patientSearchRequestModel) async { PatientSearchRequestModel patientSearchRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
GET_MY_OUT_PATIENT, GET_MY_OUT_PATIENT,
@ -25,7 +25,9 @@ class OutPatientService extends BaseService {
body: patientSearchRequestModel.toJson(), body: patientSearchRequestModel.toJson(),
); );
} }
Future getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel) async {
Future getPatientFileInformation(
PatientSearchRequestModel patientSearchRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
PRM_SEARCH_PATIENT, 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/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart'; import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart';
import 'base/lookup-service.dart'; import '../base/lookup-service.dart';
class PatientReferralService extends LookupService { class PatientReferralService extends LookupService {
List<dynamic> projectsList = []; List<dynamic> projectsList = [];
@ -56,7 +56,8 @@ class PatientReferralService extends LookupService {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isSameBranch'] = false; 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']; projectsList = response['ProjectInfo'];
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; 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; hasError = false;
DoctorsByClinicIdRequest _doctorsByClinicIdRequest = DoctorsByClinicIdRequest _doctorsByClinicIdRequest =
DoctorsByClinicIdRequest(); DoctorsByClinicIdRequest();
@ -112,22 +114,16 @@ class PatientReferralService extends LookupService {
_doctorsByClinicIdRequest.patientID = patient.patientId; _doctorsByClinicIdRequest.patientID = patient.patientId;
_doctorsByClinicIdRequest.gender = patient.gender; _doctorsByClinicIdRequest.gender = patient.gender;
await baseAppClient.postPatient(PATIENT_GET_DOCTOR_BY_CLINIC_Hospital,
await baseAppClient.postPatient( onSuccess: (dynamic response, int statusCode) {
PATIENT_GET_DOCTOR_BY_CLINIC_Hospital, doctorsList.clear();
onSuccess: (dynamic response, int statusCode) { response['DoctorList'].forEach((v) {
doctorsList.clear(); doctorsList.add(ClinicDoctor.fromJson(v));
response['DoctorList'].forEach((v) { });
doctorsList.add(ClinicDoctor.fromJson(v)); }, onFailure: (String error, int statusCode) {
}); hasError = true;
}, super.error = error;
onFailure: (String error, int statusCode) { }, body: _doctorsByClinicIdRequest.toJson(), patient: patient);
hasError = true;
super.error = error;
},
body: _doctorsByClinicIdRequest.toJson(),
patient: patient
);
} }
Future getMyReferredPatient() async { 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; hasError = false;
DoctorProfileModel doctorProfile = await getDoctorProfile(); DoctorProfileModel doctorProfile = await getDoctorProfile();
@ -242,13 +239,8 @@ class PatientReferralService extends LookupService {
); );
} }
Future makeReferral( Future makeReferral(PatiantInformtion patient, String isoStringDate,
PatiantInformtion patient, int projectID, int clinicID, int doctorID, String remarks) async {
String isoStringDate,
int projectID,
int clinicID,
int doctorID,
String remarks) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
@ -304,8 +296,8 @@ class PatientReferralService extends LookupService {
); );
} }
Future verifyReferralDoctorRemarks(
Future verifyReferralDoctorRemarks(MyReferredPatientModel referredPatient) async { MyReferredPatientModel referredPatient) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
@ -315,9 +307,7 @@ class PatientReferralService extends LookupService {
await baseAppClient.post( await baseAppClient.post(
Verify_Referral_Doctor_Remarks, Verify_Referral_Doctor_Remarks,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {},
},
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

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

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

@ -1,6 +1,6 @@
import 'package:doctor_app_flutter/config/config.dart'; 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_report/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_request_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class MedicalFileService extends BaseService { class MedicalFileService extends BaseService {

@ -1,12 +1,12 @@
import 'package:doctor_app_flutter/config/config.dart'; 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/calculate_box_request_model.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/model/item_by_medicine_request_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/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/search_drug/search_drug_model.dart';
import 'package:doctor_app_flutter/core/model/prescription_req_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/search_drug_request_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/service/base/lookup-service.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/GetAllergiesResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart';
@ -109,7 +109,7 @@ class PrescriptionService extends LookupService {
}, body: _drugRequestModel.toJson()); }, body: _drugRequestModel.toJson());
} }
Future getMedicationList({String drug =''}) async { Future getMedicationList({String drug = ''}) async {
hasError = false; hasError = false;
_drugRequestModel.search = ["$drug"]; _drugRequestModel.search = ["$drug"];
await baseAppClient.post(SEARCH_DRUG, await baseAppClient.post(SEARCH_DRUG,
@ -218,7 +218,7 @@ class PrescriptionService extends LookupService {
"Prescription": { "Prescription": {
"objPatientInfo": { "objPatientInfo": {
"Gender": patient.gender == 1 ? 'Male' : 'Female', "Gender": patient.gender == 1 ? 'Male' : 'Female',
"Age": DateUtils.convertDateFromServerFormat( "Age": AppDateUtils.convertDateFromServerFormat(
patient.dateofBirth, 'dd/MM/yyyy') patient.dateofBirth, 'dd/MM/yyyy')
}, },
"objVitalSign": {"Height": vital?.heightCm, "Weight": vital?.weightKg}, "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:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'base/base_service.dart'; import '../../base/base_service.dart';
class PrescriptionsService extends BaseService { class PrescriptionsService extends BaseService {
List<Prescriptions> prescriptionsList = List(); 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/config/config.dart';
import 'package:doctor_app_flutter/core/model/sick_leave_patient_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_patient_request_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/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.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/add_sickleave_request.dart';
import 'package:doctor_app_flutter/models/sickleave/extend_sick_leave_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/models/sickleave/get_all_sickleave_response.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
// import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
class SickLeaveService extends BaseService { class SickLeaveService extends BaseService {
Map get sickLeavestatisitics => _statistics; Map get sickLeavestatisitics => _statistics;
@ -31,7 +30,6 @@ class SickLeaveService extends BaseService {
dynamic get sickLeaveResponse => _sickLeaveResponse; dynamic get sickLeaveResponse => _sickLeaveResponse;
dynamic _sickLeaveResponse; dynamic _sickLeaveResponse;
List<SickLeavePatientModel> getAllSickLeavePatient = List(); List<SickLeavePatientModel> getAllSickLeavePatient = List();
SickLeavePatientRequestModel _sickLeavePatientRequestModel = SickLeavePatientRequestModel _sickLeavePatientRequestModel =
@ -101,8 +99,8 @@ class SickLeaveService extends BaseService {
await baseAppClient.postPatient( await baseAppClient.postPatient(
GET_SICK_LEAVE, GET_SICK_LEAVE,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
// Future.value(response); // Future.value(response);
getAllSickLeavePatient=[]; getAllSickLeavePatient = [];
response['List_SickLeave'].forEach((v) { response['List_SickLeave'].forEach((v) {
getAllSickLeavePatient.add(SickLeavePatientModel.fromJson(v)); getAllSickLeavePatient.add(SickLeavePatientModel.fromJson(v));
}); });
@ -119,7 +117,7 @@ class SickLeaveService extends BaseService {
_sickLeavePatientRequestModel = SickLeavePatientRequestModel( _sickLeavePatientRequestModel = SickLeavePatientRequestModel(
patientID: patientMRN, patientTypeID: 2, patientType: 1); patientID: patientMRN, patientTypeID: 2, patientType: 1);
hasError = false; hasError = false;
getAllSickLeavePatient =[]; getAllSickLeavePatient = [];
getAllSickLeavePatient.clear(); getAllSickLeavePatient.clear();
await baseAppClient.postPatient( await baseAppClient.postPatient(
GET_SICK_LEAVE_PATIENT, 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_physical_exam_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart';
import 'base/lookup-service.dart'; import '../../base/lookup-service.dart';
class SOAPService extends LookupService { class SOAPService extends LookupService {
List<GetChiefComplaintResModel> patientChiefComplaintList = []; List<GetChiefComplaintResModel> patientChiefComplaintList = [];
List<GetAllergiesResModel> patientAllergiesList = []; List<GetAllergiesResModel> patientAllergiesList = [];
List<GetHistoryResModel> patientHistoryList = []; List<GetHistoryResModel> patientHistoryList = [];
List<GetPhysicalExamResModel> patientPhysicalExamList = []; List<GetPhysicalExamResModel> patientPhysicalExamList = [];
List<GetPatientProgressNoteResModel> patientProgressNoteList = []; List<GetPatientProgressNoteResModel> patientProgressNoteList = [];
List<GetAssessmentResModel> patientAssessmentList = []; List<GetAssessmentResModel> patientAssessmentList = [];
int episodeID; int episodeID;
Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async {
@ -55,13 +55,12 @@ class SOAPService extends LookupService {
await baseAppClient.post(POST_EPISODE, await baseAppClient.post(POST_EPISODE,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success");
print("Success"); episodeID = response['EpisodeID'];
episodeID = response['EpisodeID']; }, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { hasError = true;
hasError = true; super.error = error;
super.error = error; }, body: postEpisodeReqModel.toJson());
}, body: postEpisodeReqModel.toJson());
} }
Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async {
@ -69,11 +68,11 @@ class SOAPService extends LookupService {
await baseAppClient.post(POST_ALLERGY, await baseAppClient.post(POST_ALLERGY,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: postAllergyRequestModel.toJson()); }, body: postAllergyRequestModel.toJson());
} }
Future postHistories( Future postHistories(
@ -81,11 +80,11 @@ class SOAPService extends LookupService {
hasError = false; hasError = false;
await baseAppClient.post(POST_HISTORY, await baseAppClient.post(POST_HISTORY,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: postHistoriesRequestModel.toJson()); }, body: postHistoriesRequestModel.toJson());
} }
Future postChiefComplaint( Future postChiefComplaint(
@ -93,7 +92,7 @@ class SOAPService extends LookupService {
hasError = false; hasError = false;
await baseAppClient.post(POST_CHIEF_COMPLAINT, await baseAppClient.post(POST_CHIEF_COMPLAINT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -136,18 +135,16 @@ class SOAPService extends LookupService {
}, body: postAssessmentRequestModel.toJson()); }, body: postAssessmentRequestModel.toJson());
} }
Future patchAllergy(PostAllergyRequestModel patchAllergyRequestModel) async { Future patchAllergy(PostAllergyRequestModel patchAllergyRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post(PATCH_ALLERGY, await baseAppClient.post(PATCH_ALLERGY,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: patchAllergyRequestModel.toJson()); }, body: patchAllergyRequestModel.toJson());
} }
Future patchHistories( Future patchHistories(
@ -155,11 +152,11 @@ class SOAPService extends LookupService {
hasError = false; hasError = false;
await baseAppClient.post(PATCH_HISTORY, await baseAppClient.post(PATCH_HISTORY,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: patchHistoriesRequestModel.toJson()); }, body: patchHistoriesRequestModel.toJson());
} }
Future patchChiefComplaint( Future patchChiefComplaint(
@ -167,11 +164,11 @@ class SOAPService extends LookupService {
hasError = false; hasError = false;
await baseAppClient.post(PATCH_CHIEF_COMPLAINT, await baseAppClient.post(PATCH_CHIEF_COMPLAINT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: patchChiefComplaintRequestModel.toJson()); }, body: patchChiefComplaintRequestModel.toJson());
} }
Future patchPhysicalExam( Future patchPhysicalExam(
@ -179,11 +176,11 @@ class SOAPService extends LookupService {
hasError = false; hasError = false;
await baseAppClient.post(PATCH_PHYSICAL_EXAM, await baseAppClient.post(PATCH_PHYSICAL_EXAM,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: patchPhysicalExamRequestModel.toJson()); }, body: patchPhysicalExamRequestModel.toJson());
} }
Future patchProgressNote( Future patchProgressNote(
@ -191,11 +188,11 @@ class SOAPService extends LookupService {
hasError = false; hasError = false;
await baseAppClient.post(PATCH_PROGRESS_NOTE, await baseAppClient.post(PATCH_PROGRESS_NOTE,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: patchProgressNoteRequestModel.toJson()); }, body: patchProgressNoteRequestModel.toJson());
} }
Future patchAssessment( Future patchAssessment(
@ -203,111 +200,106 @@ class SOAPService extends LookupService {
hasError = false; hasError = false;
await baseAppClient.post(PATCH_ASSESSMENT, await baseAppClient.post(PATCH_ASSESSMENT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: patchAssessmentRequestModel.toJson()); }, body: patchAssessmentRequestModel.toJson());
} }
Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async { Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async {
hasError = false; hasError = false;
await baseAppClient.post (GET_ALLERGY, await baseAppClient.post(GET_ALLERGY,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
patientAllergiesList.clear(); patientAllergiesList.clear();
response['List_Allergies']['entityList'].forEach((v) { response['List_Allergies']['entityList'].forEach((v) {
patientAllergiesList.add(GetAllergiesResModel.fromJson(v)); patientAllergiesList.add(GetAllergiesResModel.fromJson(v));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: generalGetReqForSOAP.toJson()); }, body: generalGetReqForSOAP.toJson());
} }
Future getPatientHistories( Future getPatientHistories(GetHistoryReqModel getHistoryReqModel,
GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async { {bool isFirst = false}) async {
hasError = false; hasError = false;
await baseAppClient.post(GET_HISTORY, await baseAppClient.post(GET_HISTORY,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
if (isFirst) if (isFirst) patientHistoryList.clear();
patientHistoryList.clear();
response['List_History']['entityList'].forEach((v) { response['List_History']['entityList'].forEach((v) {
patientHistoryList.add(GetHistoryResModel.fromJson(v)); patientHistoryList.add(GetHistoryResModel.fromJson(v));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: getHistoryReqModel.toJson()); }, body: getHistoryReqModel.toJson());
} }
Future getPatientChiefComplaint( Future getPatientChiefComplaint(
GetChiefComplaintReqModel getChiefComplaintReqModel) async { GetChiefComplaintReqModel getChiefComplaintReqModel) async {
hasError = false; hasError = false;
await baseAppClient.post (GET_CHIEF_COMPLAINT, await baseAppClient.post(GET_CHIEF_COMPLAINT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
patientChiefComplaintList.clear(); patientChiefComplaintList.clear();
response['List_ChiefComplaint']['entityList'].forEach((v) { response['List_ChiefComplaint']['entityList'].forEach((v) {
patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v)); patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: getChiefComplaintReqModel.toJson()); }, body: getChiefComplaintReqModel.toJson());
} }
Future getPatientPhysicalExam( Future getPatientPhysicalExam(
GetPhysicalExamReqModel getPhysicalExamReqModel) async { GetPhysicalExamReqModel getPhysicalExamReqModel) async {
hasError = false; hasError = false;
await baseAppClient.post (GET_PHYSICAL_EXAM, await baseAppClient.post(GET_PHYSICAL_EXAM,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
patientPhysicalExamList.clear(); patientPhysicalExamList.clear();
response['PhysicalExamList']['entityList'].forEach((v) { response['PhysicalExamList']['entityList'].forEach((v) {
patientPhysicalExamList.add(GetPhysicalExamResModel.fromJson(v)); patientPhysicalExamList.add(GetPhysicalExamResModel.fromJson(v));
}); });
}, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { hasError = true;
hasError = true; super.error = error;
super.error = error; }, body: getPhysicalExamReqModel.toJson());
}, body: getPhysicalExamReqModel.toJson());
} }
Future getPatientProgressNote( Future getPatientProgressNote(
GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { GetGetProgressNoteReqModel getGetProgressNoteReqModel) async {
hasError = false; hasError = false;
await baseAppClient.post (GET_PROGRESS_NOTE, await baseAppClient.post(GET_PROGRESS_NOTE,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
patientProgressNoteList.clear(); patientProgressNoteList.clear();
response['ProgressNoteList']['entityList'].forEach((v) { response['ProgressNoteList']['entityList'].forEach((v) {
patientProgressNoteList.add(GetPatientProgressNoteResModel.fromJson(v)); patientProgressNoteList.add(GetPatientProgressNoteResModel.fromJson(v));
}); });
}, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { hasError = true;
hasError = true; super.error = error;
super.error = error; }, body: getGetProgressNoteReqModel.toJson());
}, body: getGetProgressNoteReqModel.toJson());
} }
Future getPatientAssessment( Future getPatientAssessment(
GetAssessmentReqModel getAssessmentReqModel) async { GetAssessmentReqModel getAssessmentReqModel) async {
hasError = false; hasError = false;
await baseAppClient.post (GET_ASSESSMENT, await baseAppClient.post(GET_ASSESSMENT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
patientAssessmentList.clear(); patientAssessmentList.clear();
response['AssessmentList']['entityList'].forEach((v) { response['AssessmentList']['entityList'].forEach((v) {
patientAssessmentList.add(GetAssessmentResModel.fromJson(v)); patientAssessmentList.add(GetAssessmentResModel.fromJson(v));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: getAssessmentReqModel.toJson()); }, body: getAssessmentReqModel.toJson());
} }
} }

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

@ -1,7 +1,7 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/insurance_approval.dart'; import 'package:doctor_app_flutter/core/model/insurance/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_in_patient_model.dart';
import 'package:doctor_app_flutter/core/service/InsuranceCardService.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/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';

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

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

@ -1,8 +1,9 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.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/service/SOAP_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart';
import 'package:doctor_app_flutter/core/service/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/GetChiefComplaintReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart';
@ -39,10 +40,10 @@ class SOAPViewModel extends BaseViewModel {
List<MasterKeyModel> get allergySeverityList => List<MasterKeyModel> get allergySeverityList =>
_SOAPService.allergySeverityList; _SOAPService.allergySeverityList;
List<MasterKeyModel> get historyFamilyList => _SOAPService.historyFamilyList; List<MasterKeyModel> get historyFamilyList => _SOAPService.historyFamilyList;
List<MasterKeyModel> get historyMedicalList => _SOAPService.historyMedicalList; List<MasterKeyModel> get historyMedicalList =>
_SOAPService.historyMedicalList;
List<MasterKeyModel> get historySportList => _SOAPService.historySportList; List<MasterKeyModel> get historySportList => _SOAPService.historySportList;
@ -82,8 +83,7 @@ class SOAPViewModel extends BaseViewModel {
List<GetAssessmentResModel> get patientAssessmentList => List<GetAssessmentResModel> get patientAssessmentList =>
_SOAPService.patientAssessmentList; _SOAPService.patientAssessmentList;
int get episodeID => int get episodeID => _SOAPService.episodeID;
_SOAPService.episodeID;
get medicationStrengthList => _SOAPService.medicationStrengthListWithModel; get medicationStrengthList => _SOAPService.medicationStrengthListWithModel;
get medicationDoseTimeList => _SOAPService.medicationDoseTimeListWithModel; get medicationDoseTimeList => _SOAPService.medicationDoseTimeListWithModel;
@ -102,11 +102,12 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false}) async { Future getMasterLookup(MasterKeysService masterKeys,
if(isBusyLocal){ {bool isBusyLocal = false}) async {
if (isBusyLocal) {
setState(ViewState.Busy);
} else
setState(ViewState.Busy); setState(ViewState.Busy);
}else
setState(ViewState.Busy);
await _SOAPService.getMasterLookup(masterKeys); await _SOAPService.getMasterLookup(masterKeys);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
error = _SOAPService.error; error = _SOAPService.error;
@ -115,7 +116,6 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future postEpisode(PostEpisodeReqModel postEpisodeReqModel) async { Future postEpisode(PostEpisodeReqModel postEpisodeReqModel) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _SOAPService.postEpisode(postEpisodeReqModel); await _SOAPService.postEpisode(postEpisodeReqModel);
@ -136,7 +136,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future postHistories(PostHistoriesRequestModel postHistoriesRequestModel) async { Future postHistories(
PostHistoriesRequestModel postHistoriesRequestModel) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _SOAPService.postHistories(postHistoriesRequestModel); await _SOAPService.postHistories(postHistoriesRequestModel);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
@ -146,7 +147,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future postChiefComplaint(PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { Future postChiefComplaint(
PostChiefComplaintRequestModel postChiefComplaintRequestModel) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _SOAPService.postChiefComplaint(postChiefComplaintRequestModel); await _SOAPService.postChiefComplaint(postChiefComplaintRequestModel);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
@ -156,7 +158,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future postPhysicalExam(PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { Future postPhysicalExam(
PostPhysicalExamRequestModel postPhysicalExamRequestModel) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _SOAPService.postPhysicalExam(postPhysicalExamRequestModel); await _SOAPService.postPhysicalExam(postPhysicalExamRequestModel);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
@ -166,7 +169,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future postProgressNote(PostProgressNoteRequestModel postProgressNoteRequestModel) async { Future postProgressNote(
PostProgressNoteRequestModel postProgressNoteRequestModel) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _SOAPService.postProgressNote(postProgressNoteRequestModel); await _SOAPService.postProgressNote(postProgressNoteRequestModel);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
@ -176,7 +180,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future postAssessment(PostAssessmentRequestModel postAssessmentRequestModel) async { Future postAssessment(
PostAssessmentRequestModel postAssessmentRequestModel) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _SOAPService.postAssessment(postAssessmentRequestModel); await _SOAPService.postAssessment(postAssessmentRequestModel);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
@ -186,7 +191,6 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future patchAllergy(PostAllergyRequestModel patchAllergyRequestModel) async { Future patchAllergy(PostAllergyRequestModel patchAllergyRequestModel) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _SOAPService.patchAllergy(patchAllergyRequestModel); await _SOAPService.patchAllergy(patchAllergyRequestModel);
@ -197,7 +201,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future patchHistories(PostHistoriesRequestModel patchHistoriesRequestModel) async { Future patchHistories(
PostHistoriesRequestModel patchHistoriesRequestModel) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _SOAPService.patchHistories(patchHistoriesRequestModel); await _SOAPService.patchHistories(patchHistoriesRequestModel);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
@ -207,7 +212,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future patchChiefComplaint(PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async { Future patchChiefComplaint(
PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _SOAPService.patchChiefComplaint(patchChiefComplaintRequestModel); await _SOAPService.patchChiefComplaint(patchChiefComplaintRequestModel);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
@ -217,7 +223,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future patchPhysicalExam(PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async { Future patchPhysicalExam(
PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _SOAPService.patchPhysicalExam(patchPhysicalExamRequestModel); await _SOAPService.patchPhysicalExam(patchPhysicalExamRequestModel);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
@ -227,7 +234,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future patchProgressNote(PostProgressNoteRequestModel patchProgressNoteRequestModel) async { Future patchProgressNote(
PostProgressNoteRequestModel patchProgressNoteRequestModel) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _SOAPService.patchProgressNote(patchProgressNoteRequestModel); await _SOAPService.patchProgressNote(patchProgressNoteRequestModel);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
@ -237,7 +245,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future patchAssessment(PatchAssessmentReqModel patchAssessmentRequestModel) async { Future patchAssessment(
PatchAssessmentReqModel patchAssessmentRequestModel) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _SOAPService.patchAssessment(patchAssessmentRequestModel); await _SOAPService.patchAssessment(patchAssessmentRequestModel);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
@ -259,7 +268,7 @@ class SOAPViewModel extends BaseViewModel {
if (isLocalBusy) { if (isLocalBusy) {
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else
setState(ViewState.Error); setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
@ -271,16 +280,19 @@ class SOAPViewModel extends BaseViewModel {
masterKeys: MasterKeysService.Allergies, masterKeys: MasterKeysService.Allergies,
id: element.allergyDiseaseId, id: element.allergyDiseaseId,
typeId: element.allergyDiseaseType); typeId: element.allergyDiseaseType);
if(selectedAllergy != null && element.isChecked) if (selectedAllergy != null && element.isChecked)
allergiesString += allergiesString +=
(isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn )+ ' , '; (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn) +
' , ';
}); });
return allergiesString; return allergiesString;
} }
Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async { Future getPatientHistories(GetHistoryReqModel getHistoryReqModel,
{bool isFirst = false}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _SOAPService.getPatientHistories(getHistoryReqModel, isFirst: isFirst); await _SOAPService.getPatientHistories(getHistoryReqModel,
isFirst: isFirst);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
error = _SOAPService.error; error = _SOAPService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -299,7 +311,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getPatientPhysicalExam(GetPhysicalExamReqModel getPhysicalExamReqModel) async { Future getPatientPhysicalExam(
GetPhysicalExamReqModel getPhysicalExamReqModel) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _SOAPService.getPatientPhysicalExam(getPhysicalExamReqModel); await _SOAPService.getPatientPhysicalExam(getPhysicalExamReqModel);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
@ -309,7 +322,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getPatientProgressNote(GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { Future getPatientProgressNote(
GetGetProgressNoteReqModel getGetProgressNoteReqModel) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _SOAPService.getPatientProgressNote(getGetProgressNoteReqModel); await _SOAPService.getPatientProgressNote(getGetProgressNoteReqModel);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
@ -339,6 +353,7 @@ class SOAPViewModel extends BaseViewModel {
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
// ignore: missing_return // ignore: missing_return
MasterKeyModel getOneMasterKey( MasterKeyModel getOneMasterKey(
{@required MasterKeysService masterKeys, dynamic id, int typeId}) { {@required MasterKeysService masterKeys, dynamic id, int typeId}) {
@ -391,7 +406,8 @@ class SOAPViewModel extends BaseViewModel {
break; break;
case MasterKeysService.HistorySurgical: case MasterKeysService.HistorySurgical:
List<MasterKeyModel> result = historySurgicalList.where((element) { List<MasterKeyModel> result = historySurgicalList.where((element) {
return element.id == id;}).toList(); return element.id == id;
}).toList();
if (result.isNotEmpty) { if (result.isNotEmpty) {
return result.first; return result.first;
} }
@ -414,12 +430,12 @@ class SOAPViewModel extends BaseViewModel {
return result.first; return result.first;
} }
break; break;
// case MasterKeysService.physiotherapyGoals: // case MasterKeysService.physiotherapyGoals:
// listOfPhysiotherapyGoals.clear(); // listOfPhysiotherapyGoals.clear();
// entryList.forEach((v) { // entryList.forEach((v) {
// listOfPhysiotherapyGoals.add(MasterKeyModel.fromJson(v)); // listOfPhysiotherapyGoals.add(MasterKeyModel.fromJson(v));
// }); // });
// break; // break;
case MasterKeysService.DiagnosisType: case MasterKeysService.DiagnosisType:
List<MasterKeyModel> result = listOfDiagnosisType.where((element) { List<MasterKeyModel> result = listOfDiagnosisType.where((element) {
@ -441,7 +457,7 @@ class SOAPViewModel extends BaseViewModel {
break; break;
case MasterKeysService.ICD10: case MasterKeysService.ICD10:
List<MasterKeyModel> result = listOfICD10.where((element) { List<MasterKeyModel> result = listOfICD10.where((element) {
return element.code == id ; return element.code == id;
}).toList(); }).toList();
if (result.isNotEmpty) { if (result.isNotEmpty) {
return result.first; return result.first;
@ -450,6 +466,4 @@ class SOAPViewModel extends BaseViewModel {
break; 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/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 '../../locator.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';
class DashboardViewModel extends BaseViewModel { class DashboardViewModel extends BaseViewModel {
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
DashboardService _dashboardService = locator<DashboardService>(); 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 { Future getDashboard() async {
setState(ViewState.Busy); setState(ViewState.Busy);
@ -17,4 +49,31 @@ class DashboardViewModel extends BaseViewModel {
} else } else
setState(ViewState.Idle); 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/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 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart';
import '../../locator.dart'; import '../../locator.dart';
@ -8,7 +8,8 @@ import 'base_view_model.dart';
class DoctorReplayViewModel extends BaseViewModel { class DoctorReplayViewModel extends BaseViewModel {
DoctorReplyService _doctorReplyService = locator<DoctorReplyService>(); DoctorReplyService _doctorReplyService = locator<DoctorReplyService>();
List<ListGtMyPatientsQuestions> get listDoctorWorkingHoursTable => _doctorReplyService.listDoctorWorkingHoursTable; List<ListGtMyPatientsQuestions> get listDoctorWorkingHoursTable =>
_doctorReplyService.listDoctorWorkingHoursTable;
Future getDoctorReply() async { Future getDoctorReply() async {
setState(ViewState.Busy); setState(ViewState.Busy);
@ -20,7 +21,8 @@ class DoctorReplayViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future replay(String referredDoctorRemarks, ListGtMyPatientsQuestions model) async { Future replay(
String referredDoctorRemarks, ListGtMyPatientsQuestions model) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _doctorReplyService.replay(referredDoctorRemarks, model); await _doctorReplyService.replay(referredDoctorRemarks, model);
if (_doctorReplyService.hasError) { 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/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_orders.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.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/locator.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
@ -116,10 +116,14 @@ class LabsViewModel extends BaseViewModel {
} }
getPatientLabResult( getPatientLabResult(
{PatientLabOrders patientLabOrder, PatiantInformtion patient, bool isInpatient}) async { {PatientLabOrders patientLabOrder,
PatiantInformtion patient,
bool isInpatient}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _labsService.getPatientLabResult( await _labsService.getPatientLabResult(
patientLabOrder: patientLabOrder, patient: patient, isInpatient: isInpatient); patientLabOrder: patientLabOrder,
patient: patient,
isInpatient: isInpatient);
if (_labsService.hasError) { if (_labsService.hasError) {
error = _labsService.error; error = _labsService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -131,17 +135,9 @@ class LabsViewModel extends BaseViewModel {
.toList(); .toList();
if (patientLabOrdersClinic.length != 0) { if (patientLabOrdersClinic.length != 0) {
var value = labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])]
labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] .patientLabResultList
.patientLabResultList .add(element);
.where((e) =>
e.sampleCollectedOn == element.sampleCollectedOn &&
e.resultValue == element.resultValue)
.toList();
if (value.isEmpty)
labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])]
.patientLabResultList
.add(element);
} else { } else {
labResultLists labResultLists
.add(LabResultList(filterName: element.testCode, lab: element)); .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/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/medical_file_model.dart'; import 'package:doctor_app_flutter/core/model/medical_report/medical_file_model.dart';
import 'package:doctor_app_flutter/core/service/medical_file_service.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/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.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/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/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/service/medicine_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/medicine_service.dart';
import 'package:doctor_app_flutter/core/service/prescription_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/GetAssessmentReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.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/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.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 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import '../../locator.dart'; import '../../locator.dart';
class AdmissionRequestViewModel extends BaseViewModel{ class AdmissionRequestViewModel extends BaseViewModel {
AdmissionRequestService _admissionRequestService =
AdmissionRequestService _admissionRequestService = locator<AdmissionRequestService>(); locator<AdmissionRequestService>();
List<dynamic> get clinicList => _admissionRequestService.clinicList; List<dynamic> get clinicList => _admissionRequestService.clinicList;
List<dynamic> get doctorsList => _admissionRequestService.doctorsList; 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; AdmissionRequest admissionRequestData;
@ -131,7 +136,7 @@ class AdmissionRequestViewModel extends BaseViewModel{
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future makeAdmissionRequest() async{ Future makeAdmissionRequest() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _admissionRequestService.makeAdmissionRequest(admissionRequestData); await _admissionRequestService.makeAdmissionRequest(admissionRequestData);
if (_admissionRequestService.hasError) { if (_admissionRequestService.hasError) {

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

@ -1,8 +1,8 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.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/patient-ucaf-service.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/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart';
@ -45,7 +45,7 @@ class UcafViewModel extends BaseViewModel {
String respirationBeatPerMinute = "0"; String respirationBeatPerMinute = "0";
String bloodPressure = "0 / 0"; String bloodPressure = "0 / 0";
resetDataInFirst(){ resetDataInFirst() {
_ucafService.patientAssessmentList = []; _ucafService.patientAssessmentList = [];
_ucafService.orderProcedureList = []; _ucafService.orderProcedureList = [];
_ucafService.prescriptionList = null; _ucafService.prescriptionList = null;
@ -61,10 +61,10 @@ class UcafViewModel extends BaseViewModel {
String from; String from;
String to; String to;
if (from == null || from == "0") { 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") { 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); // 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/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/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.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 { String to, bool isInPatient) async {
setState(ViewState.Busy); setState(ViewState.Busy);
if (from == null || from == "0") { 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") { if (to == null || to == "0") {
to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); to = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
} }
if (isInPatient) { if (isInPatient) {
await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); await _vitalSignService.getPatientVitalSignsHistory(patient, from, to);
} else { } else {
await _vitalSignService.getOutPatientVitalSignHistory(patient, from, to); await _vitalSignService.getOutPatientVitalSignHistory(patient, from, to);
} }
if (_vitalSignService.hasError) { if (_vitalSignService.hasError) {
@ -97,11 +95,11 @@ class VitalSignsViewModel extends BaseViewModel {
oxygenation == null || oxygenation == null ||
oxygenation == 'null') { oxygenation == 'null') {
oxygenation = oxygenation =
"${element.sAO2.toString()}";/* - ${element.fIO2.toString()}*/ "${element.sAO2.toString()}"; /* - ${element.fIO2.toString()}*/
} }
if (painScore == null || painScore == "-") { if (painScore == null || painScore == "-") {
painScore = element.painScore.toString() != 'null' painScore = element.painScoreDesc.toString() != 'null'
? element.painScore.toString() ? element.painScoreDesc.toString()
: "-"; : "-";
painLocation = element.painLocation.toString() != 'null' painLocation = element.painLocation.toString() != 'null'
? element.painLocation.toString() ? 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/CreateNoteModel.dart';
import 'package:doctor_app_flutter/core/model/note/note_model.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/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_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/lab_result/lab_result.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart';
@ -42,7 +42,8 @@ class PatientViewModel extends BaseViewModel {
get insuranceApporvalsList => _patientService.insuranceApporvalsList; get insuranceApporvalsList => _patientService.insuranceApporvalsList;
List<NoteModel> get patientProgressNoteList => _patientService.patientProgressNoteList; List<NoteModel> get patientProgressNoteList =>
_patientService.patientProgressNoteList;
List<dynamic> get clinicsList => _patientService.clinicsList; List<dynamic> get clinicsList => _patientService.clinicsList;
@ -65,7 +66,7 @@ class PatientViewModel extends BaseViewModel {
if (_patientService.hasError) { if (_patientService.hasError) {
error = _patientService.error; error = _patientService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else{ } else {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
return localRes; return localRes;
@ -142,18 +143,18 @@ class PatientViewModel extends BaseViewModel {
} }
Future getPatientProgressNote(patient, {bool isLocalBusy = false}) async { Future getPatientProgressNote(patient, {bool isLocalBusy = false}) async {
if(isLocalBusy) { if (isLocalBusy) {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
}else{ } else {
setState(ViewState.Busy); setState(ViewState.Busy);
} }
await _patientService.getPatientProgressNote(patient); await _patientService.getPatientProgressNote(patient);
if (_patientService.hasError) { if (_patientService.hasError) {
error = _patientService.error; error = _patientService.error;
if(isLocalBusy) { if (isLocalBusy) {
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
}else{ } else {
setState(ViewState.Error); setState(ViewState.Error);
} }
} else } else

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

@ -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.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.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/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:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -19,16 +19,16 @@ class PrescriptionsViewModel extends BaseViewModel {
List<PrescriptionsList> _prescriptionsOrderListClinic = List(); List<PrescriptionsList> _prescriptionsOrderListClinic = List();
List<PrescriptionsList> _prescriptionsOrderListHospital = List(); List<PrescriptionsList> _prescriptionsOrderListHospital = List();
List<PrescriptionReport> get prescriptionReportList => List<PrescriptionReport> get prescriptionReportList =>
_prescriptionsService.prescriptionReportList; _prescriptionsService.prescriptionReportList;
List<Prescriptions> get prescriptionsList => List<Prescriptions> get prescriptionsList =>
_prescriptionsService.prescriptionsList; _prescriptionsService.prescriptionsList;
List<PharmacyPrescriptions> get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList ; List<PharmacyPrescriptions> get pharmacyPrescriptionsList =>
List<PrescriptionReportEnh> get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList; _prescriptionsService.pharmacyPrescriptionsList;
List<PrescriptionReportEnh> get prescriptionReportEnhList =>
_prescriptionsService.prescriptionReportEnhList;
List<PrescriptionsList> get prescriptionsOrderList => List<PrescriptionsList> get prescriptionsOrderList =>
filterType == FilterType.Clinic filterType == FilterType.Clinic
@ -48,6 +48,7 @@ class PrescriptionsViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
_getPrescriptionsOrders() async { _getPrescriptionsOrders() async {
await _prescriptionsService.getPrescriptionsOrders(); await _prescriptionsService.getPrescriptionsOrders();
if (_prescriptionsService.hasError) { if (_prescriptionsService.hasError) {
@ -97,15 +98,17 @@ class PrescriptionsViewModel extends BaseViewModel {
}); });
} }
setFilterType(FilterType filterType) { setFilterType(FilterType filterType) {
this.filterType = filterType; this.filterType = filterType;
notifyListeners(); notifyListeners();
} }
getPrescriptionReport({Prescriptions prescriptions,@required PatiantInformtion patient}) async { getPrescriptionReport(
{Prescriptions prescriptions,
@required PatiantInformtion patient}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionReport(prescriptions: prescriptions,patient: patient); await _prescriptionsService.getPrescriptionReport(
prescriptions: prescriptions, patient: patient);
if (_prescriptionsService.hasError) { if (_prescriptionsService.hasError) {
error = _prescriptionsService.error; error = _prescriptionsService.error;
setState(ViewState.ErrorLocal); 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); setState(ViewState.Busy);
await _prescriptionsService.getListPharmacyForPrescriptions(itemId: itemId,patient: patient); await _prescriptionsService.getListPharmacyForPrescriptions(
itemId: itemId, patient: patient);
if (_prescriptionsService.hasError) { if (_prescriptionsService.hasError) {
error = _prescriptionsService.error; error = _prescriptionsService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -127,11 +130,12 @@ class PrescriptionsViewModel extends BaseViewModel {
} }
} }
getPrescriptionReportEnh(
{PrescriptionsOrder prescriptionsOrder,
getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder,@required PatiantInformtion patient}) async { @required PatiantInformtion patient}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder,patient: patient); await _prescriptionsService.getPrescriptionReportEnh(
prescriptionsOrder: prescriptionsOrder, patient: patient);
if (_prescriptionsService.hasError) { if (_prescriptionsService.hasError) {
error = _prescriptionsService.error; error = _prescriptionsService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -139,7 +143,4 @@ class PrescriptionsViewModel extends BaseViewModel {
setState(ViewState.Idle); 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/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/procedure/update_procedure_request_model.dart';
import 'package:doctor_app_flutter/core/model/radiology/final_radiology.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/patient_medical_file/lab_order/labs_service.dart';
import 'package:doctor_app_flutter/core/service/procedure_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/procedure/procedure_service.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/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
@ -43,7 +43,8 @@ class ProcedureViewModel extends BaseViewModel {
List<FinalRadiology> get radiologyList => List<FinalRadiology> get radiologyList =>
_radiologyService.finalRadiologyList; _radiologyService.finalRadiologyList;
List<PatientLabOrders> get patientLabOrdersList => _labsService.patientLabOrdersList; List<PatientLabOrders> get patientLabOrdersList =>
_labsService.patientLabOrdersList;
List<LabOrderResult> get labOrdersResultsList => List<LabOrderResult> get labOrdersResultsList =>
_labsService.labOrdersResultsList; _labsService.labOrdersResultsList;
@ -51,16 +52,14 @@ class ProcedureViewModel extends BaseViewModel {
List<PatientLabOrdersList> _patientLabOrdersListClinic = List(); List<PatientLabOrdersList> _patientLabOrdersListClinic = List();
List<PatientLabOrdersList> _patientLabOrdersListHospital = List(); List<PatientLabOrdersList> _patientLabOrdersListHospital = List();
Future getProcedure({int mrn, String patientType}) async {
Future getProcedure({int mrn,String patientType}) async {
hasError = false; hasError = false;
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.getProcedure(mrn: mrn); await _procedureService.getProcedure(mrn: mrn);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
if(patientType=="7") if (patientType == "7")
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
else else
setState(ViewState.Error); setState(ViewState.Error);
@ -135,15 +134,16 @@ class ProcedureViewModel extends BaseViewModel {
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
//await getProcedure(mrn: mrn); //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); setState(ViewState.Busy);
await _radiologyService.getPatientRadOrders(patient, isInPatient:isInPatient); await _radiologyService.getPatientRadOrders(patient,
isInPatient: isInPatient);
if (_radiologyService.hasError) { if (_radiologyService.hasError) {
error = _radiologyService.error; error = _radiologyService.error;
if(patientType=="7") if (patientType == "7")
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
else else
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -221,8 +221,6 @@ class ProcedureViewModel extends BaseViewModel {
List<LabResultList> labResultLists = List(); List<LabResultList> labResultLists = List();
List<LabResultList> get labResultListsCoustom { List<LabResultList> get labResultListsCoustom {
return labResultLists; return labResultLists;
} }
@ -232,7 +230,7 @@ class ProcedureViewModel extends BaseViewModel {
await _labsService.getPatientLabOrdersList(patient, isInpatient); await _labsService.getPatientLabOrdersList(patient, isInpatient);
if (_labsService.hasError) { if (_labsService.hasError) {
error = _labsService.error; error = _labsService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
setState(ViewState.Idle); setState(ViewState.Idle);
} }

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

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

@ -1,14 +1,16 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; 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 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart';
import '../../locator.dart'; import '../../locator.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';
class ReferredPatientViewModel extends BaseViewModel { 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 { Future getMyReferredPatient() async {
setState(ViewState.Busy); setState(ViewState.Busy);
@ -19,5 +21,4 @@ class ReferredPatientViewModel extends BaseViewModel {
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }

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

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; 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/add_sickleave_request.dart';
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';

@ -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/doctor_reply_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/my_schedule_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/my_schedule_screen.dart';
import 'package:doctor_app_flutter/screens/home/home_screen.dart'; import 'package:doctor_app_flutter/screens/home/home_screen.dart';
import 'package:doctor_app_flutter/screens/qr_reader/QR_reader_screen.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.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/app_drawer_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/bottom_nav_bar.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:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:get_it/get_it.dart'; import 'package:get_it/get_it.dart';
import 'core/service/DischargedPatientService.dart'; import 'core/service/home/auth_service.dart';
import 'core/service/InsuranceCardService.dart'; import 'core/service/home/dasboard_service.dart';
import 'core/service/MyReferralPatientService.dart'; import 'core/service/patient/DischargedPatientService.dart';
import 'core/service/PatientMuseService.dart'; import 'core/service/patient/patient_service.dart';
import 'core/service/ReferralService.dart'; import 'core/service/patient_medical_file/insurance/InsuranceCardService.dart';
import 'core/service/SOAP_service.dart'; import 'core/service/patient/MyReferralPatientService.dart';
import 'core/service/doctor_reply_service.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/hospitals/hospitals_service.dart';
import 'core/service/labs_service.dart'; import 'core/service/patient_medical_file/lab_order/labs_service.dart';
import 'core/service/medicine_service.dart'; import 'core/service/patient_medical_file/prescription/medicine_service.dart';
import 'core/service/patient-admission-request-service.dart'; import 'core/service/patient_medical_file/admission_request/patient-admission-request-service.dart';
import 'core/service/patient-doctor-referral-service.dart'; import 'core/service/patient/patient-doctor-referral-service.dart';
import 'core/service/patient-ucaf-service.dart'; import 'core/service/patient_medical_file/ucaf/patient-ucaf-service.dart';
import 'core/service/patient-vital-signs-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/patient/out_patient_service.dart';
import 'core/service/patientInPatientService.dart'; import 'core/service/patient/patientInPatientService.dart';
import 'core/service/prescriptions_service.dart'; import 'core/service/patient_medical_file/prescription/prescriptions_service.dart';
import 'core/service/radiology_service.dart'; import 'core/service/patient_medical_file/radiology/radiology_service.dart';
import 'core/service/referral_patient_service.dart'; import 'core/service/patient/referral_patient_service.dart';
import 'core/service/referred_patient_service.dart'; import 'core/service/patient/referred_patient_service.dart';
import 'core/service/schedule_service.dart'; import 'core/service/home/schedule_service.dart';
import 'core/viewModel/DischargedPatientViewModel.dart'; import 'core/viewModel/DischargedPatientViewModel.dart';
import 'core/viewModel/InsuranceViewModel.dart'; import 'core/viewModel/InsuranceViewModel.dart';
import 'core/viewModel/PatientMuseViewModel.dart'; import 'core/viewModel/PatientMuseViewModel.dart';

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

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

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

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

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

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

@ -170,7 +170,7 @@ class VitalSignResModel {
triageCategory = json['TriageCategory']; triageCategory = json['TriageCategory'];
gCScore = json['GCScore']; gCScore = json['GCScore'];
lineItemNo = json['LineItemNo']; 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']; actualTimeTaken = json['ActualTimeTaken'];
sugarLevel = json['SugarLevel']; sugarLevel = json['SugarLevel'];
fBS = json['FBS']; fBS = json['FBS'];

@ -164,14 +164,14 @@ class DoctorReplayChat extends StatelessWidget {
children: [ children: [
AppText( 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 fontWeight: FontWeight
.w600, .w600,
color: Colors.white, color: Colors.white,
fontSize: 14, fontSize: 14,
), ),
AppText( 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, fontSize: 14,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Colors.white, color: Colors.white,

@ -24,9 +24,9 @@ class _PatientArrivalScreen extends State<PatientArrivalScreen>
PatientMobileNumber: "0", PatientMobileNumber: "0",
PatientIdentificationID: "0", PatientIdentificationID: "0",
PatientID: 0, PatientID: 0,
From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') From: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd')
.toString(), .toString(),
To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') To: AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd')
.toString(), .toString(),
LanguageID: 2, LanguageID: 2,
stamp: "2020-03-02T13:56:39.170Z", 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( child: Container(
width: 120, width: 120,
height: MediaQuery.of(context).orientation == Orientation.portrait height: MediaQuery.of(context).orientation == Orientation.portrait
? 130 ? 100
: 250, : 200,
margin: this.margin, margin: this.margin,
decoration: BoxDecoration( decoration: BoxDecoration(
color: !hasBorder color: !hasBorder
@ -41,16 +41,14 @@ class HomePageCard extends StatelessWidget {
: Border.all(width: 0.0, color: Colors.transparent), : Border.all(width: 0.0, color: Colors.transparent),
image: imageName != null image: imageName != null
? DecorationImage( ? DecorationImage(
image: AssetImage('assets/images/dashboard/${imageName}'), image: AssetImage('assets/images/dashboard/$imageName'),
fit: BoxFit.cover, fit: BoxFit.cover,
colorFilter: new ColorFilter.mode( colorFilter: new ColorFilter.mode(
Colors.black.withOpacity(0.2), BlendMode.dstIn), Colors.black.withOpacity(0.2), BlendMode.dstIn),
) )
: null, : 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/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/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_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/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/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/medicine/medicine_search_screen.dart';
import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.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/out_patient/out_patient_screen.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
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/patients/profile/profile-welcome-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:sticky_headers/sticky_headers/widget.dart'; import 'package:sticky_headers/sticky_headers/widget.dart';
import '../../widgets/shared/app_texts_widget.dart'; import '../../widgets/shared/app_texts_widget.dart';
import '../../widgets/shared/rounded_container_widget.dart';
import 'home_page_card.dart'; import 'home_page_card.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Helpers helpers = Helpers();
class HomeScreen extends StatefulWidget { class HomeScreen extends StatefulWidget {
HomeScreen({Key key, this.title}) : super(key: key); HomeScreen({Key key, this.title}) : super(key: key);
@ -64,56 +51,25 @@ class _HomeScreenState extends State<HomeScreen> {
DoctorProfileModel profile; DoctorProfileModel profile;
bool isExpanded = false; bool isExpanded = false;
bool isInpatient = false; bool isInpatient = false;
var clinicName = [];
int sliderActiveIndex = 0; int sliderActiveIndex = 0;
var clinicId; 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
myContext = context; ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context);
projectsProvider = Provider.of(context); AuthViewModel authProvider = Provider.of<AuthViewModel>(context);
FocusScopeNode currentFocus = FocusScope.of(context); authenticationViewModel = Provider.of<AuthenticationViewModel>(context);
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) { if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus(); currentFocus.unfocus();
} }
return BaseView<DashboardViewModel>( return BaseView<DashboardViewModel>(
onModelReady: (model) => model.getDashboard(), onModelReady: (model) async {
await model.setFirebaseNotification(projectsProvider, authProvider);
await model.getDashboard();
},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
@ -138,7 +94,6 @@ class _HomeScreenState extends State<HomeScreen> {
children: [ children: [
Container( Container(
width: MediaQuery.of(context).size.width * .6, width: MediaQuery.of(context).size.width * .6,
// // height: 100,
child: projectsProvider.doctorClinicsList.length > child: projectsProvider.doctorClinicsList.length >
0 0
? Stack( ? Stack(
@ -164,36 +119,49 @@ class _HomeScreenState extends State<HomeScreen> {
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.end, MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
Container( Column(
padding: EdgeInsets.all(2), mainAxisAlignment:
margin: EdgeInsets.all(2), MainAxisAlignment
decoration: .center,
new BoxDecoration( children: [
color: Colors.red[800], Container(
borderRadius: padding:
BorderRadius.circular( EdgeInsets.all(2),
20), margin:
), EdgeInsets.all(2),
constraints: BoxConstraints( decoration:
minWidth: 20, new BoxDecoration(
minHeight: 20, color:
), Colors.red[800],
child: new Text( borderRadius:
projectsProvider BorderRadius
.doctorClinicsList .circular(
.length 20),
.toString(), ),
style: new TextStyle( constraints:
color: Colors.white, BoxConstraints(
fontSize: minWidth: 20,
projectsProvider minHeight: 20,
.isArabic ),
? 10 child: Center(
: 11, child: AppText(
), projectsProvider
textAlign: .doctorClinicsList
TextAlign.center, .length
), .toString(),
color:
Colors.white,
fontSize:
projectsProvider
.isArabic
? 10
: 11,
textAlign:
TextAlign
.center,
),
)),
],
), ),
AppText(item.clinicName, AppText(item.clinicName,
fontSize: 12, fontSize: 12,
@ -205,10 +173,19 @@ class _HomeScreenState extends State<HomeScreen> {
); );
}).toList(); }).toList();
}, },
onChanged: (newValue) { onChanged: (newValue) async {
clinicId = newValue; clinicId = newValue;
changeClinic( GifLoaderDialogUtils.showMyDialog(
newValue, context, model); context);
await model.changeClinic(
newValue, authProvider);
GifLoaderDialogUtils.hideDialog(
context);
if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
}
}, },
items: projectsProvider items: projectsProvider
.doctorClinicsList .doctorClinicsList
@ -236,63 +213,17 @@ class _HomeScreenState extends State<HomeScreen> {
])), ])),
content: Column( content: Column(
children: [ children: [
Container( model.dashboardItemsList.length > 0
height: MediaQuery.of(context).size.height * 0.35, ? DashboardSwipeWidget(
child: model.dashboardItemsList.length > 0 model.dashboardItemsList,
? new Swiper( model,
onIndexChanged: (index) { (sliderIndex) {
if (mounted) { setState(() {
setState(() { sliderActiveIndex = sliderIndex;
sliderActiveIndex = index; });
}); },
} )
}, : SizedBox(),
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 model.dashboardItemsList.length > 0
? FractionallySizedBox( ? FractionallySizedBox(
widthFactor: 0.90, widthFactor: 0.90,
@ -304,111 +235,13 @@ class _HomeScreenState extends State<HomeScreen> {
height: 10, height: 10,
), ),
sliderActiveIndex == 1 sliderActiveIndex == 1
? Column( ? DashboardSliderItemWidget(
children: [ model.dashboardItemsList[3])
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]);
})))
],
)
: sliderActiveIndex == 0 : sliderActiveIndex == 0
? Column( ? DashboardSliderItemWidget(
children: [ model.dashboardItemsList[6])
Row( : DashboardSliderItemWidget(
mainAxisAlignment: model.dashboardItemsList[4]),
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]);
})))
],
),
]))) ])))
: SizedBox(), : SizedBox(),
FractionallySizedBox( FractionallySizedBox(
@ -423,89 +256,46 @@ class _HomeScreenState extends State<HomeScreen> {
margin: EdgeInsets.only(top: 10), margin: EdgeInsets.only(top: 10),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Row( Container(
children: <Widget>[ child: Column(
Container( mainAxisAlignment: MainAxisAlignment.center,
width: 150, crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: [
mainAxisAlignment: MainAxisAlignment.center, AppText(
crossAxisAlignment: TranslationBase.of(context).patients,
CrossAxisAlignment.start, fontSize: 12,
children: [ fontWeight: FontWeight.bold,
Text( fontHeight: .5,
TranslationBase.of(context).patients, ),
style: TextStyle( AppText(
fontSize: 12, TranslationBase.of(context).services,
height: .5, fontSize: 22,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins'), ),
),
Text(
TranslationBase.of(context).services,
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins'),
),
],
)),
], ],
), )),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
new Container( Container(
height: 130, height: 120,
child: new ListView( child: ListView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: [ children: [
HomePageCard( HomePatientCard(
color: Color(0xffD02127), backgroundColor: Color(0xffD02127),
margin: EdgeInsets.all(5), backgroundIconColor: Colors.white12,
child: Column( cardIcon: DoctorApp.inpatient,
mainAxisAlignment: textColor: Colors.white,
MainAxisAlignment.center, text:
crossAxisAlignment:
CrossAxisAlignment.start, TranslationBase.of(context)
children: <Widget>[ .myInPatient,
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,
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
@ -515,54 +305,16 @@ class _HomeScreenState extends State<HomeScreen> {
); );
}, },
), ),
HomePageCard( HomePatientCard(
color: Colors.grey[300], backgroundColor: Colors.grey[300],
margin: EdgeInsets.all(5), backgroundIconColor: Colors.white38,
child: Column( cardIcon: DoctorApp.arrival_patients,
mainAxisAlignment: textColor: Colors.black,
MainAxisAlignment.center, text: TranslationBase.of(context)
crossAxisAlignment: .myOutPatient,
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,
onTap: () { onTap: () {
String date = String date =
DateUtils.convertDateToFormat( AppDateUtils.convertDateToFormat(
DateTime( DateTime(
DateTime.now().year, DateTime.now().year,
DateTime.now().month, DateTime.now().month,
@ -583,106 +335,30 @@ class _HomeScreenState extends State<HomeScreen> {
)); ));
}, },
), ),
HomePageCard( HomePatientCard(
color: Color(0xff2B353E), backgroundColor: Color(0xff2B353E),
margin: EdgeInsets.all(5), backgroundIconColor: Colors.white10,
child: Column( cardIcon: DoctorApp.referral_1,
mainAxisAlignment: textColor: Colors.white,
MainAxisAlignment.center, text: TranslationBase.of(context)
crossAxisAlignment: .patientsreferral,
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,
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) =>
PatientReferralScreen(), PatientReferralScreen(),
// MyReferredPatient(),
), ),
); );
}, },
), ),
HomePageCard( HomePatientCard(
color: Color(0xffD02127), backgroundColor: Color(0xffD02127),
margin: EdgeInsets.all(5), backgroundIconColor: Colors.white10,
child: Column( cardIcon: DoctorApp.search,
mainAxisAlignment: textColor: Colors.white,
MainAxisAlignment.center, text: TranslationBase.of(context)
crossAxisAlignment: .searchPatient,
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,
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
@ -692,51 +368,13 @@ class _HomeScreenState extends State<HomeScreen> {
)); ));
}, },
), ),
HomePageCard( HomePatientCard(
color: Color(0xffC9C9C9), backgroundColor: Color(0xffC9C9C9),
margin: EdgeInsets.all(5), backgroundIconColor: Colors.black12,
child: Column( cardIcon: DoctorApp.search_medicines,
mainAxisAlignment: textColor: Color(0xff2B353E),
MainAxisAlignment.center, text: TranslationBase.of(context)
crossAxisAlignment: .searchMedicine,
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,
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
@ -745,17 +383,8 @@ class _HomeScreenState extends State<HomeScreen> {
MedicineSearchScreen(), MedicineSearchScreen(),
)); ));
}, },
) ),
])), ])),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: 8,
),
],
),
SizedBox( SizedBox(
height: 20, 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] .timelines[index]
.doctorImage, .doctorImage,
appointmentDate: appointmentDate:
DateUtils.getDateTimeFromServerFormat( AppDateUtils.getDateTimeFromServerFormat(
model.medicalFileList[0].entityList[0] model.medicalFileList[0].entityList[0]
.timelines[index].date, .timelines[index].date,
), ),

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

@ -3,7 +3,7 @@ import 'dart:math';
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/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/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/medicine/pharmacies_list_screen.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)), style: TextStyle(fontSize: 14)),
new TextSpan( new TextSpan(
text: model.filterData[index].admissionDate == null ? "" 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( style: TextStyle(
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 15)), fontSize: 15)),
@ -301,7 +301,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
style: TextStyle(fontSize: 14)), style: TextStyle(fontSize: 14)),
new TextSpan( new TextSpan(
text: model.filterData[index].dischargeDate == null ? "" 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( style: TextStyle(
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 15)), fontSize: 15)),
@ -316,7 +316,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
fontSize: 14,fontWeight: FontWeight.w300, fontSize: 14,fontWeight: FontWeight.w300,
), ),
AppText( 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, fontSize: 15,
fontWeight: FontWeight.w700), fontWeight: FontWeight.w700),
], ],
@ -332,11 +332,12 @@ class _DischargedPatientState extends State<DischargedPatient> {
)), )),
], ],
), ),
))
],
), ),
), ),],
), ),
),)
); );
} }

@ -100,8 +100,8 @@ class ECGPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
AppText('${DateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime,isArabic: projectViewModel.isArabic)}',color: Colors.black,fontWeight: FontWeight.w600,fontSize: 14,), AppText('${AppDateUtils.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.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/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/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -16,8 +16,8 @@ class PatientInPatientScreen extends StatefulWidget {
_PatientInPatientScreenState createState() => _PatientInPatientScreenState(); _PatientInPatientScreenState createState() => _PatientInPatientScreenState();
} }
class _PatientInPatientScreenState extends State<PatientInPatientScreen> with SingleTickerProviderStateMixin{ class _PatientInPatientScreenState extends State<PatientInPatientScreen>
with SingleTickerProviderStateMixin {
TabController _tabController; TabController _tabController;
int _activeTab = 0; int _activeTab = 0;
@ -85,7 +85,8 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> with Si
child: Scaffold( child: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
appBar: PreferredSize( appBar: PreferredSize(
preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070), preferredSize: Size.fromHeight(
MediaQuery.of(context).size.height * 0.070),
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.070, height: MediaQuery.of(context).size.height * 0.070,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -103,12 +104,18 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> with Si
indicatorWeight: 1.0, indicatorWeight: 1.0,
indicatorSize: TabBarIndicatorSize.tab, indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor, 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], unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [
tabWidget(screenSize, _activeTab == 0, TranslationBase.of(context).inPatientAll, counter: model.inPatientList.length), tabWidget(screenSize, _activeTab == 0,
tabWidget(screenSize, _activeTab == 1, "My InPatients", counter: model.myIinPatientList.length), TranslationBase.of(context).inPatientAll,
tabWidget(screenSize, _activeTab == 2, TranslationBase.of(context).discharged), 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( return Center(
child: Container( child: Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration( decoration: TextFieldsUtils.containerBorderDecoration(
isActive isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA),
? Color(0xFFD02127 /*B8382B*/)
: Color(0xFFEAEAEA),
isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4, borderRadius: 4,
borderWidth: 0), borderWidth: 0),
@ -164,9 +169,7 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> with Si
width: 15, width: 15,
height: 15, height: 15,
decoration: BoxDecoration( decoration: BoxDecoration(
color: isActive color: isActive ? Colors.white : Color(0xFFD02127),
? Colors.white
: Color(0xFFD02127),
shape: BoxShape.circle, shape: BoxShape.circle,
), ),
child: Center( child: Center(

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

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

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

Loading…
Cancel
Save