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

 Conflicts:
	lib/core/service/patient_medical_file/prescription/prescription_service.dart
	lib/core/viewModel/prescription_view_model.dart
	lib/screens/prescription/add_prescription_form.dart
merge-requests/655/head
hussam al-habibeh 5 years ago
commit c50a483663

@ -971,4 +971,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": "تعليقات"},
}; };

@ -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/imei_details.dart'; import 'package:doctor_app_flutter/core/model/auth/imei_details.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/user_model.dart'; import 'package:doctor_app_flutter/models/doctor/user_model.dart';

@ -1,14 +1,14 @@
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';
class DischargedPatientService extends BaseService { class DischargedPatientService extends BaseService {
List<PatiantInformtion> myDischargedPatients = List(); List<PatiantInformtion> myDischargedPatients = List();
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,5 +1,9 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.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/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/item_by_medicine_request_model.dart';
@ -8,6 +12,11 @@ import 'package:doctor_app_flutter/core/model/prescription_model.dart';
import 'package:doctor_app_flutter/core/model/prescription_req_model.dart'; import 'package:doctor_app_flutter/core/model/prescription_req_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug_request_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug_request_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/item_by_medicine_request_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/search_drug_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/search_drug_request_model.dart';
import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/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';
@ -110,7 +119,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,

@ -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) {
@ -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,8 +1,8 @@
import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/model/imei_details.dart'; import 'package:doctor_app_flutter/core/model/auth/imei_details.dart';
import 'package:doctor_app_flutter/core/model/insert_imei_model.dart'; import 'package:doctor_app_flutter/core/model/auth/insert_imei_model.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/auth/activation_Code_req_model.dart'; import 'package:doctor_app_flutter/models/auth/activation_Code_req_model.dart';
import 'package:doctor_app_flutter/models/auth/check_activation_code_request_model.dart'; import 'package:doctor_app_flutter/models/auth/check_activation_code_request_model.dart';

@ -1,6 +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/dasboard_service.dart'; import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart';
import '../../locator.dart'; import '../../locator.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';

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

@ -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/imei_details.dart'; import 'package:doctor_app_flutter/core/model/auth/imei_details.dart';
import 'package:doctor_app_flutter/core/service/auth_service.dart'; import 'package:doctor_app_flutter/core/service/home/auth_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/doctor/user_model.dart'; import 'package:doctor_app_flutter/models/doctor/user_model.dart';

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

@ -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) {
@ -151,4 +156,4 @@ class AdmissionRequestViewModel extends BaseViewModel{
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
} }

@ -1,11 +1,11 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/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;

@ -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';
@ -52,12 +52,10 @@ class VitalSignsViewModel extends BaseViewModel {
to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); to = DateUtils.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,7 +95,7 @@ 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.painScore.toString() != 'null'

@ -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,8 +1,11 @@
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/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';
@ -11,6 +14,10 @@ import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/prescription_model.dart'; import 'package:doctor_app_flutter/core/model/prescription_model.dart';
import 'package:doctor_app_flutter/core/service/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart';
import 'package:doctor_app_flutter/core/service/prescriptions_service.dart'; import 'package:doctor_app_flutter/core/service/prescriptions_service.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescriptions_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/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 +66,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';

@ -1,10 +1,3 @@
import 'package:doctor_app_flutter/core/service/auth_service.dart';
import 'package:doctor_app_flutter/core/service/dasboard_service.dart';
import 'package:doctor_app_flutter/core/service/medical_file_service.dart';
import 'package:doctor_app_flutter/core/service/patient_service.dart';
import 'package:doctor_app_flutter/core/service/prescription_service.dart';
import 'package:doctor_app_flutter/core/service/procedure_service.dart';
import 'package:doctor_app_flutter/core/service/sickleave_service.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/imei_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/imei_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart';
@ -14,26 +7,33 @@ 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/labs_service.dart'; import 'core/service/patient/ReferralService.dart';
import 'core/service/medicine_service.dart'; import 'core/service/patient_medical_file/medical_report/medical_file_service.dart';
import 'core/service/patient-admission-request-service.dart'; import 'core/service/patient_medical_file/prescription/prescription_service.dart';
import 'core/service/patient-doctor-referral-service.dart'; import 'core/service/patient_medical_file/procedure/procedure_service.dart';
import 'core/service/patient-ucaf-service.dart'; import 'core/service/patient_medical_file/sick_leave/sickleave_service.dart';
import 'core/service/patient-vital-signs-service.dart'; import 'core/service/patient_medical_file/soap/SOAP_service.dart';
import 'core/service/home/doctor_reply_service.dart';
import 'core/service/patient_medical_file/lab_order/labs_service.dart';
import 'core/service/patient_medical_file/prescription/medicine_service.dart';
import 'core/service/patient_medical_file/admission_request/patient-admission-request-service.dart';
import 'core/service/patient/patient-doctor-referral-service.dart';
import 'core/service/patient_medical_file/ucaf/patient-ucaf-service.dart';
import 'core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart';
import 'core/service/patient/out_patient_service.dart'; import 'core/service/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';

@ -3,7 +3,7 @@ import 'dart:io';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/service/auth_service.dart'; import 'package:doctor_app_flutter/core/service/home/auth_service.dart';
import 'package:doctor_app_flutter/core/viewModel/imei_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/imei_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart';

@ -3,7 +3,8 @@ import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart';
@ -503,7 +504,9 @@ class _HomeScreenState extends State<HomeScreen> {
Container( Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: AppText( child: AppText(
"My\n"+TranslationBase.of(context).inPatient, "My\n" +
TranslationBase.of(context)
.inPatient,
color: Colors.white, color: Colors.white,
textAlign: TextAlign.start, textAlign: TextAlign.start,
fontSize: 15, fontSize: 15,

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

@ -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": DateUtils.convertDateToFormat(
"to": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), DateTime.now(), 'yyyy-MM-dd'),
"to": DateUtils.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,), DateUtils.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,
@ -152,7 +155,7 @@ 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),
), ),
), ),
@ -177,7 +180,7 @@ 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),
), ),
), ),
@ -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}", "${DateUtils.convertStringToDate(referredPatient.dischargeDate).difference(DateUtils.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,
@ -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,
), ),
], ],
), ),
), ),
), ),
), ),
], ],
), ),
), ),

@ -1,6 +1,6 @@
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/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/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
@ -16,7 +16,6 @@ class FilterDatePage extends StatefulWidget {
final OutPatientFilterType outPatientFilterType; final OutPatientFilterType outPatientFilterType;
final PatientSearchViewModel patientSearchViewModel; final PatientSearchViewModel patientSearchViewModel;
const FilterDatePage( const FilterDatePage(
{Key key, this.outPatientFilterType, this.patientSearchViewModel}) {Key key, this.outPatientFilterType, this.patientSearchViewModel})
: super(key: key); : super(key: key);
@ -34,19 +33,13 @@ class _FilterDatePageState extends State<FilterDatePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var screenSize; var screenSize;
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
backgroundColor: Theme backgroundColor: Theme.of(context).scaffoldBackgroundColor,
.of(context)
.scaffoldBackgroundColor,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
height: MediaQuery height: MediaQuery.of(context).size.height * 1.0,
.of(context)
.size
.height * 1.0,
child: Padding( child: Padding(
padding: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0),
child: Column( child: Column(
@ -54,7 +47,7 @@ class _FilterDatePageState extends State<FilterDatePage> {
children: [ children: [
BottomSheetTitle( BottomSheetTitle(
title: (OutPatientFilterType.Previous == title: (OutPatientFilterType.Previous ==
widget.outPatientFilterType) widget.outPatientFilterType)
? " Filter Previous Out Patient" ? " Filter Previous Out Patient"
: "Filter Nextweek Out Patient", : "Filter Nextweek Out Patient",
), ),
@ -69,24 +62,18 @@ class _FilterDatePageState extends State<FilterDatePage> {
Container( Container(
color: Colors.white, color: Colors.white,
child: InkWell( child: InkWell(
onTap: () => onTap: () => selectDate(context,
selectDate( firstDate:
context, firstDate: getFirstDate( getFirstDate(widget.outPatientFilterType),
widget.outPatientFilterType), lastDate:
lastDate: getLastDate( getLastDate(widget.outPatientFilterType)),
widget.outPatientFilterType)),
child: TextField( child: TextField(
decoration: decoration: textFieldSelectorDecoration(
textFieldSelectorDecoration( TranslationBase.of(context).fromDate,
TranslationBase widget.patientSearchViewModel
.of( .selectedFromDate !=
context) null
.fromDate, ? "${DateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedFromDate.toString(), "yyyy-MM-dd")}"
widget.patientSearchViewModel.selectedFromDate != null
? "${DateUtils
.convertStringToDateFormat(
widget.patientSearchViewModel.selectedFromDate.toString(),
"yyyy-MM-dd")}"
: null, : null,
true, true,
suffixIcon: Icon( suffixIcon: Icon(
@ -97,29 +84,25 @@ class _FilterDatePageState extends State<FilterDatePage> {
), ),
), ),
), ),
SizedBox(height: 10,), SizedBox(
height: 10,
),
Container( Container(
color: Colors.white, color: Colors.white,
child: InkWell( child: InkWell(
onTap: () => onTap: () => selectDate(context,
selectDate( isFromDate: false,
context, isFromDate: false, firstDate:
firstDate: getFirstDate( getFirstDate(widget.outPatientFilterType),
widget.outPatientFilterType), lastDate:
lastDate: getLastDate( getLastDate(widget.outPatientFilterType)),
widget.outPatientFilterType)),
child: TextField( child: TextField(
decoration: decoration: textFieldSelectorDecoration(
textFieldSelectorDecoration( TranslationBase.of(context).toDate,
TranslationBase widget.patientSearchViewModel
.of( .selectedToDate !=
context) null
.toDate, ? "${DateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedToDate.toString(), "yyyy-MM-dd")}"
widget.patientSearchViewModel.selectedToDate != null
? "${DateUtils
.convertStringToDateFormat(
widget.patientSearchViewModel.selectedToDate.toString(),
"yyyy-MM-dd")}"
: null, : null,
true, true,
suffixIcon: Icon( suffixIcon: Icon(
@ -147,10 +130,7 @@ class _FilterDatePageState extends State<FilterDatePage> {
), ),
border: Border.all(color: HexColor('#707070'), width: 0), border: Border.all(color: HexColor('#707070'), width: 0),
), ),
height: MediaQuery height: MediaQuery.of(context).size.height * 0.1,
.of(context)
.size
.height * 0.1,
width: double.infinity, width: double.infinity,
child: Column( child: Column(
children: [ children: [
@ -162,10 +142,7 @@ class _FilterDatePageState extends State<FilterDatePage> {
widthFactor: .80, widthFactor: .80,
child: Center( child: Center(
child: AppButton( child: AppButton(
title: title: TranslationBase.of(context).search,
TranslationBase
.of(context)
.search,
padding: 10, padding: 10,
color: Color(0xFF359846), color: Color(0xFF359846),
onPressed: () async { onPressed: () async {
@ -178,8 +155,8 @@ class _FilterDatePageState extends State<FilterDatePage> {
} else { } else {
Duration difference = widget Duration difference = widget
.patientSearchViewModel.selectedToDate .patientSearchViewModel.selectedToDate
.difference( .difference(widget
widget.patientSearchViewModel.selectedFromDate); .patientSearchViewModel.selectedFromDate);
if (difference.inDays > 90) { if (difference.inDays > 90) {
Helpers.showErrorToast( Helpers.showErrorToast(
"The difference between from date and end date must be less than 3 months"); "The difference between from date and end date must be less than 3 months");
@ -219,8 +196,7 @@ class _FilterDatePageState extends State<FilterDatePage> {
), ),
], ],
), ),
) ));
);
} }
selectDate(BuildContext context, selectDate(BuildContext context,
@ -241,9 +217,9 @@ class _FilterDatePageState extends State<FilterDatePage> {
setState(() { setState(() {
this.widget.patientSearchViewModel.selectedFromDate = picked; this.widget.patientSearchViewModel.selectedFromDate = picked;
var date = picked.add(Duration(days: 30)); var date = picked.add(Duration(days: 30));
if(date.isBefore(lastDate)){ if (date.isBefore(lastDate)) {
this.widget.patientSearchViewModel.selectedToDate = date; this.widget.patientSearchViewModel.selectedToDate = date;
}else } else
this.widget.patientSearchViewModel.selectedToDate = lastDate; this.widget.patientSearchViewModel.selectedToDate = lastDate;
}); });
} else { } else {
@ -257,43 +233,25 @@ class _FilterDatePageState extends State<FilterDatePage> {
getFirstDate(OutPatientFilterType outPatientFilterType) { getFirstDate(OutPatientFilterType outPatientFilterType) {
if (outPatientFilterType == OutPatientFilterType.Previous) { if (outPatientFilterType == OutPatientFilterType.Previous) {
return DateTime( return DateTime(
DateTime DateTime.now().year - 20, DateTime.now().month, DateTime.now().day);
.now()
.year -20, DateTime
.now()
.month, DateTime
.now()
.day);
} else { } else {
return DateTime( return DateTime(
DateTime DateTime.now().year, DateTime.now().month, DateTime.now().day + 1);
.now()
.year, DateTime
.now()
.month, DateTime
.now()
.day + 1);
} }
} }
getLastDate(OutPatientFilterType outPatientFilterType) { getLastDate(OutPatientFilterType outPatientFilterType) {
if (outPatientFilterType == OutPatientFilterType.Previous) { if (outPatientFilterType == OutPatientFilterType.Previous) {
return DateTime(DateTime.now().year, DateTime.now().month, return DateTime(
DateTime.now().day-1); DateTime.now().year, DateTime.now().month, DateTime.now().day - 1);
} else { } else {
return DateTime( return DateTime(
DateTime DateTime.now().year, DateTime.now().month, DateTime.now().day + 7);
.now()
.year, DateTime
.now()
.month, DateTime
.now()
.day + 7);
} }
} }
InputDecoration textFieldSelectorDecoration(String hintText, InputDecoration textFieldSelectorDecoration(
String selectedText, bool isDropDown, String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon}) { {Icon suffixIcon}) {
return InputDecoration( return InputDecoration(
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
@ -311,11 +269,11 @@ class _FilterDatePageState extends State<FilterDatePage> {
hintText: selectedText != null ? selectedText : hintText, hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown suffixIcon: isDropDown
? suffixIcon != null ? suffixIcon != null
? suffixIcon ? suffixIcon
: Icon( : Icon(
Icons.keyboard_arrow_down_sharp, Icons.keyboard_arrow_down_sharp,
color: Color(0xff2E303A), color: Color(0xff2E303A),
) )
: null, : null,
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: 13, fontSize: 13,

@ -1,8 +1,10 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/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/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
@ -41,18 +43,19 @@ class OutPatientsScreen extends StatefulWidget {
final bool isSearchAndOut; final bool isSearchAndOut;
final String searchKey; final String searchKey;
OutPatientsScreen( OutPatientsScreen(
{this.patientSearchForm, {this.patientSearchForm,
this.selectedType, this.selectedType,
this.isAppbar = true, this.isAppbar = true,
this.arrivalType, this.arrivalType,
this.isView, this.isView,
this.selectedPatientType, this.selectedPatientType,
this.patientSearchRequestModel, this.patientSearchRequestModel,
this.isSearchWithKeyInfo = true, this.isSearchWithKeyInfo = true,
this.isSearch = false, this.isSearch = false,
this.isInpatient = false, this.searchKey, this.isSearchAndOut=false}); this.isInpatient = false,
this.searchKey,
this.isSearchAndOut = false});
@override @override
_OutPatientsScreenState createState() => _OutPatientsScreenState(); _OutPatientsScreenState createState() => _OutPatientsScreenState();
@ -81,20 +84,11 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
authProvider = Provider.of(context); authProvider = Provider.of(context);
_times = [ _times = [
TranslationBase TranslationBase.of(context).previous,
.of(context) TranslationBase.of(context).today,
.previous, TranslationBase.of(context).nextWeek,
TranslationBase
.of(context)
.today,
TranslationBase
.of(context)
.nextWeek,
]; ];
final screenSize = MediaQuery final screenSize = MediaQuery.of(context).size;
.of(context)
.size;
return BaseView<PatientSearchViewModel>( return BaseView<PatientSearchViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
@ -105,148 +99,155 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
isShowAppBar: true, isShowAppBar: true,
appBar: PatientSearchHeader( appBar: PatientSearchHeader(
title: "My Out patient", title: "My Out patient",
), ),
baseViewModel: model, baseViewModel: model,
body: Column( body: Column(
children: [ children: [
Container( Container(
// color: Colors.red, // color: Colors.red,
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
decoration: TextFieldsUtils decoration: TextFieldsUtils.containerBorderDecoration(
.containerBorderDecoration( Color(0Xffffffff), Color(0xFFCCCCCC),
Color(0Xffffffff), borderRadius: 4, borderWidth: 0),
Color(0xFFCCCCCC), child: Row(
borderRadius: 4, mainAxisSize: MainAxisSize.max,
borderWidth: 0), crossAxisAlignment: CrossAxisAlignment.center,
child: Row( children: _times.map((item) {
mainAxisSize: MainAxisSize.max, bool _isActive =
crossAxisAlignment: CrossAxisAlignment.center, _times[_activeLocation] == item ? true : false;
children: _times.map((item) {
bool _isActive = _times[_activeLocation] == item
? true
: false;
return Expanded( return Expanded(
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
setState(() { setState(() {
_activeLocation = _times.indexOf(item); _activeLocation = _times.indexOf(item);
outPatientFilterType= _activeLocation==0?OutPatientFilterType.Previous:_activeLocation==1?OutPatientFilterType.Today:OutPatientFilterType.NextWeek; outPatientFilterType = _activeLocation == 0
_controller.text=""; ? OutPatientFilterType.Previous
}); : _activeLocation == 1
model.searchData(""); ? OutPatientFilterType.Today
FocusScope.of(context).requestFocus(new FocusNode()); : OutPatientFilterType.NextWeek;
GifLoaderDialogUtils.showMyDialog(context); _controller.text = "";
await model.getPatientBasedOnDate(item: item, });
selectedPatientType: widget.selectedPatientType, model.searchData("");
patientSearchRequestModel: widget FocusScope.of(context).requestFocus(new FocusNode());
.patientSearchRequestModel, GifLoaderDialogUtils.showMyDialog(context);
isSearchWithKeyInfo: widget.isSearchWithKeyInfo, outPatientFilterType: outPatientFilterType); await model.getPatientBasedOnDate(
GifLoaderDialogUtils.hideDialog(context); item: item,
}, selectedPatientType: widget.selectedPatientType,
child: Center( patientSearchRequestModel:
child: Container( widget.patientSearchRequestModel,
height: screenSize.height * 0.070, isSearchWithKeyInfo: widget.isSearchWithKeyInfo,
decoration: TextFieldsUtils.containerBorderDecoration( outPatientFilterType: outPatientFilterType);
_isActive GifLoaderDialogUtils.hideDialog(context);
? Color(0xFFD02127 /*B8382B*/) },
: Color(0xFFEAEAEA), child: Center(
_isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), child: Container(
borderRadius: 4, height: screenSize.height * 0.070,
borderWidth: 0), decoration:
child: Center( TextFieldsUtils.containerBorderDecoration(
child: Row( _isActive
mainAxisAlignment: MainAxisAlignment.center, ? Color(0xFFD02127 /*B8382B*/)
children: [ : Color(0xFFEAEAEA),
AppText( _isActive
item, ? Color(0xFFD02127)
fontSize: SizeConfig.textMultiplier * 1.8, : Color(0xFFEAEAEA),
color: _isActive ? Colors.white : Color(0xFF2B353E), borderRadius: 4,
fontWeight: FontWeight.w700, borderWidth: 0),
), child: Center(
_isActive&&_activeLocation!=0&&model.state == ViewState.Idle ?Container( child: Row(
padding: EdgeInsets.all(2), mainAxisAlignment: MainAxisAlignment.center,
margin: EdgeInsets.symmetric(horizontal: 5), children: [
decoration: AppText(
new BoxDecoration( item,
color: Colors.white, fontSize: SizeConfig.textMultiplier * 1.8,
borderRadius: color: _isActive
BorderRadius.circular( ? Colors.white
50), : Color(0xFF2B353E),
), fontWeight: FontWeight.w700,
constraints: BoxConstraints( ),
minWidth: 20, _isActive &&
minHeight: 20, _activeLocation != 0 &&
), model.state == ViewState.Idle
child: new Text( ? Container(
model.filterData.length.toString(), padding: EdgeInsets.all(2),
style: new TextStyle( margin: EdgeInsets.symmetric(
color: Colors.red, horizontal: 5),
fontSize: 10 decoration: new BoxDecoration(
), color: Colors.white,
textAlign: borderRadius:
TextAlign.center, BorderRadius.circular(50),
), ),
):Container(), constraints: BoxConstraints(
], minWidth: 20,
), minHeight: 20,
),
child: new Text(
model.filterData.length.toString(),
style: new TextStyle(
color: Colors.red,
fontSize: 10),
textAlign: TextAlign.center,
),
)
: Container(),
],
), ),
), ),
), ),
), ),
); ),
}).toList(), );
), }).toList(),
), ),
),
SizedBox(height: 18.5), SizedBox(height: 18.5),
Container( Container(
width: SizeConfig.screenWidth * 0.9, width: SizeConfig.screenWidth * 0.9,
height: 75, height: 75,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(Radius.circular(6.0)),
Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0,
color: HexColor("#CCCCCC"), color: HexColor("#CCCCCC"),
), ),
color: Colors.white), color: Colors.white),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(left: 10, top: 10),
left: 10, top: 10),
child: AppText( child: AppText(
TranslationBase.of( TranslationBase.of(context).searchPatientName,
context)
.searchPatientName,
fontSize: 13, fontSize: 13,
)), )),
AppTextFormField( AppTextFormField(
// focusNode: focusProject, // focusNode: focusProject,
controller: _controller, controller: _controller,
borderColor: Colors.white borderColor: Colors.white,
,
prefix: IconButton( prefix: IconButton(
icon: Icon( icon: Icon(
_activeLocation !=0 _activeLocation != 0
? DoctorApp.filter_1 ? DoctorApp.filter_1
: FontAwesomeIcons.slidersH, : FontAwesomeIcons.slidersH,
color: Colors.black, color: Colors.black,
), ),
iconSize: 20, iconSize: 20,
padding: padding: EdgeInsets.only(bottom: 30),
EdgeInsets.only( onPressed: _activeLocation != 0
bottom: 30), ? null
onPressed: _activeLocation !=0 ? null : () { : () {
Navigator.push(context, MaterialPageRoute( Navigator.push(
builder: (BuildContext context) => context,
FilterDatePage(outPatientFilterType: outPatientFilterType,patientSearchViewModel: model,))); MaterialPageRoute(
}, builder: (BuildContext context) =>
FilterDatePage(
outPatientFilterType:
outPatientFilterType,
patientSearchViewModel:
model,
)));
},
), ),
onChanged: (String str) { onChanged: (String str) {
model.searchData(str); model.searchData(str);
}), }),
@ -254,58 +255,60 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
SizedBox( SizedBox(
height: 10.0, height: 10.0,
), ),
Expanded( Expanded(
child: Container( child: Container(
child: model.filterData.isEmpty child: model.filterData.isEmpty
? Center( ? Center(
child: ErrorMessage( child: ErrorMessage(
error: TranslationBase.of(context) error: TranslationBase.of(context)
.youDontHaveAnyPatient, .youDontHaveAnyPatient,
),
)
: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.filterData.length,
itemBuilder: (BuildContext ctxt, int index) {
if(_activeLocation !=0 || (model.filterData[index].patientStatusType !=null && model.filterData[index].patientStatusType==43))
return
Padding(
padding: EdgeInsets.all(8.0),
child: PatientCard(
patientInfo: model.filterData[index],
patientType: patientType,
arrivalType: arrivalType,
isFromSearch:widget.isSearchAndOut,
isInpatient: widget.isInpatient,
onTap: () {
// TODO change the parameter to daynamic
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": model.filterData[index],
"patientType": "1",
"from": widget
.patientSearchRequestModel.from,
"to": widget
.patientSearchRequestModel.from,
"isSearch": false,
"isInpatient": false,
"arrivalType": "7",
"isSearchAndOut": false,
});
},
// isFromSearch: widget.isSearch,
), ),
); )
else : ListView.builder(
return SizedBox(); scrollDirection: Axis.vertical,
})), shrinkWrap: true,
itemCount: model.filterData.length,
itemBuilder: (BuildContext ctxt, int index) {
if (_activeLocation != 0 ||
(model.filterData[index].patientStatusType !=
null &&
model.filterData[index]
.patientStatusType ==
43))
return Padding(
padding: EdgeInsets.all(8.0),
child: PatientCard(
patientInfo: model.filterData[index],
patientType: patientType,
arrivalType: arrivalType,
isFromSearch: widget.isSearchAndOut,
isInpatient: widget.isInpatient,
onTap: () {
// TODO change the parameter to daynamic
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": model.filterData[index],
"patientType": "1",
"from": widget
.patientSearchRequestModel.from,
"to": widget
.patientSearchRequestModel.from,
"isSearch": false,
"isInpatient": false,
"arrivalType": "7",
"isSearchAndOut": false,
});
},
// isFromSearch: widget.isSearch,
),
);
else
return SizedBox();
})),
), ),
], ],
) )),
),
); );
} }
} }

@ -1,6 +1,6 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/model/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/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
@ -14,7 +14,9 @@ import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -29,10 +31,8 @@ class PatientsSearchResultScreen extends StatefulWidget {
final bool isSearchAndOut; final bool isSearchAndOut;
final String searchKey; final String searchKey;
PatientsSearchResultScreen( PatientsSearchResultScreen(
{ {this.selectedPatientType,
this.selectedPatientType,
this.patientSearchRequestModel, this.patientSearchRequestModel,
this.isSearchWithKeyInfo = true, this.isSearchWithKeyInfo = true,
this.isSearch = false, this.isSearch = false,
@ -50,7 +50,6 @@ class _PatientsSearchResultScreenState
int clinicId; int clinicId;
AuthViewModel authProvider; AuthViewModel authProvider;
String patientType; String patientType;
String patientTypeTitle; String patientTypeTitle;
var selectedFilter = 1; var selectedFilter = 1;
@ -61,77 +60,69 @@ class _PatientsSearchResultScreenState
PatientModel patient; PatientModel patient;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
authProvider = Provider.of(context); authProvider = Provider.of(context);
return BaseView<PatientSearchViewModel>( return BaseView<PatientSearchViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if(!widget.isSearchWithKeyInfo && widget.selectedPatientType == PatientType.OutPatient) { if (!widget.isSearchWithKeyInfo &&
widget.selectedPatientType == PatientType.OutPatient) {
await model.getOutPatient(widget.patientSearchRequestModel); await model.getOutPatient(widget.patientSearchRequestModel);
} else { } else {
await model.getPatientFileInformation(widget.patientSearchRequestModel); await model
.getPatientFileInformation(widget.patientSearchRequestModel);
} }
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
appBarTitle: "Search Patient", appBarTitle: "Search Patient",
isShowAppBar: true, isShowAppBar: true,
appBar: PatientSearchHeader( appBar: PatientSearchHeader(
title: "Search for ${widget.searchKey}", title: "Search for ${widget.searchKey}",
), ),
baseViewModel: model, baseViewModel: model,
body: Column( body: Column(
children: [ children: [
SizedBox(height: 18.5), SizedBox(height: 18.5),
Container( Container(
width: SizeConfig.screenWidth * 0.9, width: SizeConfig.screenWidth * 0.9,
height: 75, height: 75,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(Radius.circular(6.0)),
Radius.circular(6.0)), border: Border.all(
border: Border.all( width: 1.0,
width: 1.0, color: HexColor("#CCCCCC"),
color: HexColor("#CCCCCC"), ),
), color: Colors.white),
color: Colors.white), child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: children: [
CrossAxisAlignment.start, Padding(
children: [ padding: EdgeInsets.only(left: 10, top: 10),
Padding( child: AppText(
padding: EdgeInsets.only( TranslationBase.of(context).searchPatientName,
left: 10, top: 10), fontSize: 13,
child: AppText( )),
TranslationBase.of( AppTextFormField(
context) // focusNode: focusProject,
.searchPatientName, controller: _controller,
fontSize: 13, borderColor: Colors.white,
)), prefix: IconButton(
AppTextFormField( icon: Icon(
// focusNode: focusProject, DoctorApp.filter_1,
controller: _controller, color: Colors.black,
borderColor: Colors.white, ),
prefix: IconButton( iconSize: 20,
icon: Icon( padding: EdgeInsets.only(bottom: 30),
DoctorApp.filter_1,
color: Colors.black,
), ),
iconSize: 20, onChanged: (String str) {
padding: model.searchData(str);
EdgeInsets.only( }),
bottom: 30), ])),
), SizedBox(
onChanged: (String str) { height: 10.0,
model.searchData(str); ),
}), Expanded(
])), child: Container(
SizedBox(
height: 10.0,
),
Expanded(
child: Container(
child: model.filterData.isEmpty child: model.filterData.isEmpty
? Center( ? Center(
child: ErrorMessage( child: ErrorMessage(
@ -150,8 +141,8 @@ class _PatientsSearchResultScreenState
patientInfo: model.filterData[index], patientInfo: model.filterData[index],
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
isFromSearch:widget.isSearchAndOut, isFromSearch: widget.isSearchAndOut,
isInpatient: widget.isInpatient, isInpatient: widget.isInpatient,
onTap: () { onTap: () {
// TODO change the parameter to daynamic // TODO change the parameter to daynamic
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
@ -166,17 +157,17 @@ class _PatientsSearchResultScreenState
"isSearch": widget.isSearch, "isSearch": widget.isSearch,
"isInpatient": widget.isInpatient, "isInpatient": widget.isInpatient,
"arrivalType": "7", "arrivalType": "7",
"isSearchAndOut": widget.isSearchAndOut, "isSearchAndOut":
widget.isSearchAndOut,
}); });
}, },
// isFromSearch: widget.isSearch, // isFromSearch: widget.isSearch,
), ),
); );
})), })),
), ),
], ],
) )),
),
); );
} }
} }

@ -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/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/model/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/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
@ -33,7 +33,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
authProvider =Provider.of(context); authProvider = Provider.of(context);
return BaseView<PatientSearchViewModel>( return BaseView<PatientSearchViewModel>(
onModelReady: (model) async {}, onModelReady: (model) async {},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -68,23 +68,23 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
isTextFieldHasSuffix: false, isTextFieldHasSuffix: false,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
inputType:TextInputType.number, inputType: TextInputType.number,
hasBorder: true, hasBorder: true,
controller: patientFileInfoController, controller: patientFileInfoController,
inputFormatters: [ inputFormatters: [
FilteringTextInputFormatter.allow( FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS)) RegExp(ONLY_NUMBERS))
], ],
onChanged: (_){}, onChanged: (_) {},
validationError: (isFormSubmitted && ( validationError: (isFormSubmitted &&
patientFileInfoController (patientFileInfoController
.text.isEmpty && .text.isEmpty &&
firstNameInfoController firstNameInfoController
.text.isEmpty && .text.isEmpty &&
middleNameInfoController middleNameInfoController
.text.isEmpty && .text.isEmpty &&
lastNameFileInfoController lastNameFileInfoController
.text.isEmpty)) .text.isEmpty))
? TranslationBase.of(context).emptyMessage ? TranslationBase.of(context).emptyMessage
: null, : null,
), ),
@ -147,11 +147,21 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
isFormSubmitted = true; isFormSubmitted = true;
}); });
PatientSearchRequestModel patientSearchRequestModel = PatientSearchRequestModel patientSearchRequestModel =
PatientSearchRequestModel(doctorID: authProvider.doctorProfile.doctorID); PatientSearchRequestModel(
doctorID: authProvider.doctorProfile.doctorID);
if (showOther) { if (showOther) {
patientSearchRequestModel.firstName = firstNameInfoController.text.trim().isEmpty?"0":firstNameInfoController.text.trim(); patientSearchRequestModel.firstName =
patientSearchRequestModel.middleName = middleNameInfoController.text.trim().isEmpty?"0":middleNameInfoController.text.trim(); firstNameInfoController.text.trim().isEmpty
patientSearchRequestModel.lastName = lastNameFileInfoController.text.isEmpty?"0":lastNameFileInfoController.text.trim(); ? "0"
: firstNameInfoController.text.trim();
patientSearchRequestModel.middleName =
middleNameInfoController.text.trim().isEmpty
? "0"
: middleNameInfoController.text.trim();
patientSearchRequestModel.lastName =
lastNameFileInfoController.text.isEmpty
? "0"
: lastNameFileInfoController.text.trim();
} }
if (patientFileInfoController.text.isNotEmpty) { if (patientFileInfoController.text.isNotEmpty) {
@ -194,7 +204,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
isSearchWithKeyInfo: isSearchWithKeyInfo:
patientFileInfoController.text.isNotEmpty ? true : false, patientFileInfoController.text.isNotEmpty ? true : false,
isSearch: true, isSearch: true,
isSearchAndOut:true, isSearchAndOut: true,
searchKey: patientFileInfoController.text, searchKey: patientFileInfoController.text,
isInpatient: false, isInpatient: false,
), ),

@ -1,6 +1,6 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/model/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/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.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';
@ -13,15 +13,18 @@ class TimeBar extends StatefulWidget {
final PatientSearchRequestModel patientSearchRequestModel; final PatientSearchRequestModel patientSearchRequestModel;
final bool isSearchWithKeyInfo; final bool isSearchWithKeyInfo;
const TimeBar(
const TimeBar({Key key, this.model, this.selectedPatientType, this.patientSearchRequestModel, this.isSearchWithKeyInfo}) : super(key: key); {Key key,
this.model,
this.selectedPatientType,
this.patientSearchRequestModel,
this.isSearchWithKeyInfo})
: super(key: key);
@override @override
_TimeBarState createState() => _TimeBarState(); _TimeBarState createState() => _TimeBarState();
} }
class _TimeBarState extends State<TimeBar> { class _TimeBarState extends State<TimeBar> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
List _locations = [ List _locations = [
@ -74,25 +77,30 @@ class _TimeBarState extends State<TimeBar> {
), ),
)), )),
), ),
onTap: () async{ onTap: () async {
setState(() { setState(() {
_activeLocation = _locations.indexOf(item); _activeLocation = _locations.indexOf(item);
}); });
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.model.getPatientBasedOnDate(item:item,selectedPatientType:widget.selectedPatientType, patientSearchRequestModel:widget.patientSearchRequestModel, isSearchWithKeyInfo:widget.isSearchWithKeyInfo); await widget.model.getPatientBasedOnDate(
item: item,
selectedPatientType: widget.selectedPatientType,
patientSearchRequestModel:
widget.patientSearchRequestModel,
isSearchWithKeyInfo: widget.isSearchWithKeyInfo);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}), }),
_isActive _isActive
? Container( ? Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
bottomRight: Radius.circular(10), bottomRight: Radius.circular(10),
topRight: Radius.circular(10)), topRight: Radius.circular(10)),
color: Colors.white), color: Colors.white),
alignment: Alignment.center, alignment: Alignment.center,
height: 1, height: 1,
width: SizeConfig.screenWidth * 0.23, width: SizeConfig.screenWidth * 0.23,
) )
: Container() : Container()
]); ]);
}).toList(), }).toList(),

@ -1,7 +1,7 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/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/viewModel/patient-ucaf-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';

@ -0,0 +1,186 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt;
class AddVerifyMedicalReport extends StatefulWidget {
final MedicalReportStatus status;
AddVerifyMedicalReport(this.status);
@override
_AddVerifyMedicalReportState createState() => _AddVerifyMedicalReportState();
}
class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord;
var event = RobotProvider();
TextEditingController commentController = TextEditingController();
String commentsError;
@override
void initState() {
requestPermissions();
event.controller.stream.listen((p) {
if (p['startPopUp'] == 'true') {
if (this.mounted) {
initSpeechState().then((value) => {onVoiceText()});
}
}
});
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of<ProjectViewModel>(context);
return BaseView<BaseViewModel>(
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBarTitle: widget.status == MedicalReportStatus.ADD
? TranslationBase.of(context).medicalReportAdd
: TranslationBase.of(context).medicalReportVerify,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
children: [
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.sickLeaveComments,
controller: commentController,
maxLines: 30,
minLines: 20,
hasBorder: true,
validationError: commentsError,
),
Positioned(
top: -2,
//MediaQuery.of(context).size.height * 0,
right: projectViewModel.isArabic
? MediaQuery.of(context).size.width *
0.75
: 15,
child: Column(
children: [
IconButton(
icon: Icon(DoctorApp.speechtotext,
color: Colors.black, size: 35),
onPressed: () {
initSpeechState().then(
(value) => {onVoiceText()});
},
),
],
)),
],
),
],
),
),
),
),
Container(
margin: EdgeInsets.all(16.0),
child: AppButton(
title: widget.status == MedicalReportStatus.ADD
? TranslationBase.of(context).medicalReportAdd
: TranslationBase.of(context).medicalReportVerify,
color: Color(0xff359846),
// disabled: progressNoteController.text.isEmpty,
fontWeight: FontWeight.w700,
onPressed: () {
setState(() {
if (commentController.text == "") {
commentsError =
TranslationBase.of(context).fieldRequired;
} else {
commentsError = null;
}
});
},
),
),
],
),
));
}
onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
bool available = await speech.initialize(
onStatus: statusListener, onError: errorListener);
if (available) {
speech.listen(
onResult: resultListener,
listenMode: stt.ListenMode.confirmation,
localeId: lang == 'en' ? 'en-US' : 'ar-SA',
);
} else {
print("The user has denied the use of speech recognition.");
}
}
void errorListener(SpeechRecognitionError error) {
event.setValue({"searchText": 'null'});
//SpeechToText.closeAlertDialog(context);
print(error);
}
void statusListener(String status) {
reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....';
}
void requestPermissions() async {
Map<Permission, PermissionStatus> statuses = await [
Permission.microphone,
].request();
}
void resultListener(result) {
reconizedWord = result.recognizedWords;
event.setValue({"searchText": reconizedWord});
if (result.finalResult == true) {
setState(() {
SpeechToText.closeAlertDialog(context);
speech.stop();
commentController.text += reconizedWord + '\n';
});
} else {
print(result.finalResult);
}
}
Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(
onError: errorListener, onStatus: statusListener);
print(hasSpeech);
if (!mounted) return;
}
}
enum MedicalReportStatus { ADD, VERIFY }

@ -0,0 +1,162 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class MedicalReportDetailPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
return BaseView<BaseViewModel>(
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(
patient,
patientType,
arrivalType,
),
body: Container(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).medical}",
fontSize: SizeConfig.textMultiplier * 1.6,
fontWeight: FontWeight.w700,
color: Color(0xFF2E303A),
),
AppText(
TranslationBase.of(context).report,
fontSize: SizeConfig.textMultiplier * 3,
fontWeight: FontWeight.bold,
color: Color(0xFF2E303A),
)
],
),
),
Container(
width: double.infinity,
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(8)),
border: Border.fromBorderSide(
BorderSide(
color: Colors.white,
width: 1.0,
),
),
),
child: Column(
children: [
AppText(
TranslationBase.of(context).chiefComplaints,
fontWeight: FontWeight.w700,
fontSize: 2.4 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
AppText(
"chief complaints data",
fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
SizedBox(
height: 8,
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 30,
height: 30,
margin: EdgeInsets.only(
left: projectViewModel.isArabic ? 10 : 85,
right: projectViewModel.isArabic ? 85 : 10,
top: 5),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
border: Border(
bottom: BorderSide(
color: Colors.grey[400], width: 2.5),
left: BorderSide(
color: Colors.grey[400], width: 2.5),
)),
),
Expanded(
child: Container(
margin: EdgeInsets.only(top: 10),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: LargeAvatar(
name: "doctorName",
url: "doctor avatar",
),
width: 25,
height: 25,
margin: EdgeInsets.only(top: 10),
),
Expanded(
flex: 4,
child: Container(
margin: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
'${TranslationBase.of(context).dr}. replace with doctor name',
fontWeight: FontWeight.w800,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Colors.black,
),
AppText(
'replace clinic Description',
fontWeight: FontWeight.w700,
fontSize: 1.4 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
],
),
),
),
],
),
),
),
],
),
],
),
),
],
),
),
),
),
);
}
}

@ -0,0 +1,8 @@
import 'package:flutter/cupertino.dart';
class MedicalReportPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container();
}
}

@ -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/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/MyReferralPatientModel.dart'; import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
@ -107,7 +107,7 @@ class _AddReplayOnReferralPatientState
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: replayOnReferralController.text.isNotEmpty? 130:70, height: replayOnReferralController.text.isNotEmpty ? 130 : 70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[

@ -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/MyReferralPatientModel.dart'; import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.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';
@ -19,7 +19,8 @@ import 'AddReplayOnReferralPatient.dart';
class ReferralPatientDetailScreen extends StatelessWidget { class ReferralPatientDetailScreen extends StatelessWidget {
final MyReferralPatientModel referredPatient; final MyReferralPatientModel referredPatient;
final PatientReferralViewModel patientReferralViewModel; final PatientReferralViewModel patientReferralViewModel;
ReferralPatientDetailScreen(this.referredPatient, this.patientReferralViewModel); ReferralPatientDetailScreen(
this.referredPatient, this.patientReferralViewModel);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -68,16 +69,18 @@ class ReferralPatientDetailScreen extends StatelessWidget {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
PatiantInformtion patient = PatiantInformtion patient = model
model.getPatientFromReferralO(referredPatient); .getPatientFromReferralO(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",
"from": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), "from": DateUtils.convertDateToFormat(
"to": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), DateTime.now(), 'yyyy-MM-dd'),
"to": DateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
}); });
}, },
child: Icon( child: Icon(
@ -94,16 +97,18 @@ class ReferralPatientDetailScreen extends StatelessWidget {
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
PatiantInformtion patient = PatiantInformtion patient = model
model.getPatientFromReferralO(referredPatient); .getPatientFromReferralO(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",
"from": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), "from": DateUtils.convertDateToFormat(
"to": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), DateTime.now(), 'yyyy-MM-dd'),
"to": DateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
}); });
}, },
child: Padding( child: Padding(
@ -153,7 +158,9 @@ class ReferralPatientDetailScreen extends StatelessWidget {
: Colors.red[700], : Colors.red[700],
), ),
AppText( AppText(
DateUtils.getDayMonthYearDateFormatted(referredPatient.referralDate,), DateUtils.getDayMonthYearDateFormatted(
referredPatient.referralDate,
),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 2.0 * SizeConfig.textMultiplier, fontSize: 2.0 * SizeConfig.textMultiplier,
@ -189,7 +196,9 @@ class ReferralPatientDetailScreen extends StatelessWidget {
], ],
), ),
AppText( AppText(
DateUtils.getTimeHHMMA(referredPatient.referralDate,), DateUtils.getTimeHHMMA(
referredPatient.referralDate,
),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier,
@ -469,7 +478,6 @@ class ReferralPatientDetailScreen extends StatelessWidget {
SizedBox( SizedBox(
height: 8, height: 8,
), ),
], ],
), ),
), ),
@ -489,7 +497,12 @@ class ReferralPatientDetailScreen extends StatelessWidget {
Navigator.push( Navigator.push(
context, context,
SlideUpPageRoute( SlideUpPageRoute(
widget: AddReplayOnReferralPatient(patientReferralViewModel: patientReferralViewModel,myReferralInPatientModel: referredPatient,),),); widget: AddReplayOnReferralPatient(
patientReferralViewModel: patientReferralViewModel,
myReferralInPatientModel: referredPatient,
),
),
);
}, },
), ),
), ),

@ -1,7 +1,7 @@
// ignore: must_be_immutable // ignore: must_be_immutable
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.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/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';

@ -1,8 +1,9 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/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/Prescriptions/post_prescrition_req_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/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_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';
@ -664,7 +665,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
child: TextField( child: TextField(
decoration: Helpers decoration: Helpers
.textFieldSelectorDecoration( .textFieldSelectorDecoration(
DateUtils.getDateFormatted( DateUtils.getDateFormatted(
DateTime.parse( DateTime.parse(
widget.startDate)), widget.startDate)),
selectedDate != null selectedDate != null

@ -15,8 +15,8 @@ import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dar
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../routes.dart'; import '../../routes.dart';
import 'base/base_view.dart'; import '../base/base_view.dart';
Helpers helpers = Helpers(); Helpers helpers = Helpers();
@ -94,7 +94,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
height: 35, height: 35,
), ),
AppButton( AppButton(
title : TranslationBase.of(context).scanQr, title: TranslationBase.of(context).scanQr,
onPressed: () { onPressed: () {
_scanQrAndGetPatient(context, model); _scanQrAndGetPatient(context, model);
}, },

@ -1,6 +1,7 @@
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/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/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_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: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/sickleave/get_all_sickleave_response.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
@ -51,11 +52,11 @@ class AddSickLeavScreen extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if(!projectsProvider.isArabic) if (!projectsProvider.isArabic)
AppText( AppText(
TranslationBase.of(context).patient, TranslationBase.of(context).patient,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
AppText( AppText(
TranslationBase.of(context).sickLeave, TranslationBase.of(context).sickLeave,
fontSize: 24, fontSize: 24,
@ -194,9 +195,10 @@ class AddSickLeavScreen extends StatelessWidget {
), ),
Flexible( Flexible(
child: AppText( child: AppText(
DateUtils.getDayMonthYearDateFormatted(DateUtils DateUtils.getDayMonthYearDateFormatted(
.convertStringToDate( DateUtils
item.startDate)), .convertStringToDate(
item.startDate)),
fontWeight: fontWeight:
FontWeight.bold, FontWeight.bold,
), ),
@ -213,8 +215,10 @@ class AddSickLeavScreen extends StatelessWidget {
), ),
Flexible( Flexible(
child: AppText( child: AppText(
DateUtils.getDayMonthYearDateFormatted(DateUtils DateUtils
.convertStringToDate( .getDayMonthYearDateFormatted(
DateUtils
.convertStringToDate(
item.endDate, item.endDate,
)), )),
fontWeight: fontWeight:

@ -1008,8 +1008,7 @@ class TranslationBase {
String get heart => localizedValues['heart'][locale.languageCode]; String get heart => localizedValues['heart'][locale.languageCode];
String get medicalReport => String get medicalReport => localizedValues['medicalReport'][locale.languageCode];
localizedValues['medicalReport'][locale.languageCode];
String get visitDate => localizedValues['visitDate'][locale.languageCode]; String get visitDate => localizedValues['visitDate'][locale.languageCode];
@ -1329,6 +1328,9 @@ class TranslationBase {
String get notRepliedYet => String get notRepliedYet =>
localizedValues["notRepliedYet"][locale.languageCode]; localizedValues["notRepliedYet"][locale.languageCode];
String get clearText => localizedValues["clearText"][locale.languageCode]; String get clearText => localizedValues["clearText"][locale.languageCode];
String get medicalReportAdd => localizedValues['medicalReportAdd'][locale.languageCode];
String get medicalReportVerify => localizedValues['medicalReportVerify'][locale.languageCode];
String get comments => localizedValues['comments'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -1,7 +1,7 @@
import 'dart:io' show Platform; import 'dart:io' show Platform;
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/model/imei_details.dart'; import 'package:doctor_app_flutter/core/model/auth/imei_details.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/auth/activation_Code_req_model.dart'; import 'package:doctor_app_flutter/models/auth/activation_Code_req_model.dart';
import 'package:doctor_app_flutter/models/auth/check_activation_code_request_model.dart'; import 'package:doctor_app_flutter/models/auth/check_activation_code_request_model.dart';

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

Loading…
Cancel
Save