merge-requests/546/head
Sultan Khan 5 years ago
commit 426aa03aa5

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 KiB

@ -88,6 +88,8 @@ class BaseAppClient {
print("URL : $url");
print("Body : ${json.encode(body)}");
var asd =json.encode(body);
var asd2;
if (await Helpers.checkConnection()) {
final response = await http.post(url,

@ -68,6 +68,8 @@ const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT =
const GET_MY_REFERRAL_PATIENT =
'Services/DoctorApplication.svc/REST/GtMyReferralPatient';
const REFER_TO_DOCTOR = 'Services/DoctorApplication.svc/REST/ReferToDoctor';
const ADD_REFERRED_DOCTOR_REMARKS =
'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks';
@ -238,7 +240,8 @@ const GET_PAtIENTS_INSURANCE_APPROVALS =
const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL';
const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';
const GET_IN_PATIENT_ORDERS = 'Services/DoctorApplication.svc/REST/GetPatientRadResult';
const GET_IN_PATIENT_ORDERS =
'Services/DoctorApplication.svc/REST/GetPatientRadResult';
///Prescriptions
const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList';
@ -257,6 +260,9 @@ const CREATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/
const GET_PRESCRIPTION_IN_PATIENT =
'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient';
const GET_INSURANCE_IN_PATIENT =
"Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient";
var selectedPatientType = 1;
//*********change value to decode json from Dropdown ************

@ -861,4 +861,5 @@ const Map<String, Map<String, String>> localizedValues = {
"admission-date": {"en": "Admission Date", "ar": "تاريخ القبول"},
"noOfDays": {"en": "No of days", "ar": "عدد الأيام"},
"numOfDays": {"en": "Number of Days", "ar": "عدد الأيام"},
"replayBefore": {"en": "Replay Before", "ar": "رد قبل"},
};

@ -0,0 +1,64 @@
class InsuranceApprovalInPatientRequestModel {
int patientID;
int patientTypeID;
int eXuldAPPNO;
int projectID;
int languageID;
String stamp;
String iPAdress;
double versionID;
int channel;
String tokenID;
String sessionID;
bool isLoginForDoctorApp;
bool patientOutSA;
InsuranceApprovalInPatientRequestModel(
{this.patientID,
this.patientTypeID,
this.eXuldAPPNO,
this.projectID,
this.languageID,
this.stamp,
this.iPAdress,
this.versionID,
this.channel,
this.tokenID,
this.sessionID,
this.isLoginForDoctorApp,
this.patientOutSA});
InsuranceApprovalInPatientRequestModel.fromJson(Map<String, dynamic> json) {
patientID = json['PatientID'];
patientTypeID = json['PatientTypeID'];
eXuldAPPNO = json['EXuldAPPNO'];
projectID = json['ProjectID'];
languageID = json['LanguageID'];
stamp = json['stamp'];
iPAdress = json['IPAdress'];
versionID = json['VersionID'];
channel = json['Channel'];
tokenID = json['TokenID'];
sessionID = json['SessionID'];
isLoginForDoctorApp = json['IsLoginForDoctorApp'];
patientOutSA = json['PatientOutSA'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientID'] = this.patientID;
data['PatientTypeID'] = this.patientTypeID;
data['EXuldAPPNO'] = this.eXuldAPPNO;
data['ProjectID'] = this.projectID;
data['LanguageID'] = this.languageID;
data['stamp'] = this.stamp;
data['IPAdress'] = this.iPAdress;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['TokenID'] = this.tokenID;
data['SessionID'] = this.sessionID;
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
data['PatientOutSA'] = this.patientOutSA;
return data;
}
}

@ -0,0 +1,273 @@
class InsuranceApprovalInPatientModel {
String setupID;
int projectID;
int approvalNo;
int status;
String approvalDate;
int patientType;
int patientID;
int companyID;
bool subCategoryID;
int doctorID;
int clinicID;
int approvalType;
int inpatientApprovalSubType;
dynamic isApprovalOnGross;
String companyApprovalNo;
dynamic progNoteOrderNo;
String submitOn;
String receiptOn;
String expiryDate;
int admissionNo;
int admissionRequestNo;
String approvalStatusDescption;
dynamic approvalStatusDescptionN;
dynamic remarks;
List<ApporvalDetails> apporvalDetails;
String clinicName;
dynamic companyName;
String doctorName;
String projectName;
int totaUnUsedCount;
int unUsedCount;
InsuranceApprovalInPatientModel(
{this.setupID,
this.projectID,
this.approvalNo,
this.status,
this.approvalDate,
this.patientType,
this.patientID,
this.companyID,
this.subCategoryID,
this.doctorID,
this.clinicID,
this.approvalType,
this.inpatientApprovalSubType,
this.isApprovalOnGross,
this.companyApprovalNo,
this.progNoteOrderNo,
this.submitOn,
this.receiptOn,
this.expiryDate,
this.admissionNo,
this.admissionRequestNo,
this.approvalStatusDescption,
this.approvalStatusDescptionN,
this.remarks,
this.apporvalDetails,
this.clinicName,
this.companyName,
this.doctorName,
this.projectName,
this.totaUnUsedCount,
this.unUsedCount});
InsuranceApprovalInPatientModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
projectID = json['ProjectID'];
approvalNo = json['ApprovalNo'];
status = json['Status'];
approvalDate = json['ApprovalDate'];
patientType = json['PatientType'];
patientID = json['PatientID'];
companyID = json['CompanyID'];
subCategoryID = json['SubCategoryID'];
doctorID = json['DoctorID'];
clinicID = json['ClinicID'];
approvalType = json['ApprovalType'];
inpatientApprovalSubType = json['InpatientApprovalSubType'];
isApprovalOnGross = json['IsApprovalOnGross'];
companyApprovalNo = json['CompanyApprovalNo'];
progNoteOrderNo = json['ProgNoteOrderNo'];
submitOn = json['SubmitOn'];
receiptOn = json['ReceiptOn'];
expiryDate = json['ExpiryDate'];
admissionNo = json['AdmissionNo'];
admissionRequestNo = json['AdmissionRequestNo'];
approvalStatusDescption = json['ApprovalStatusDescption'];
approvalStatusDescptionN = json['ApprovalStatusDescptionN'];
remarks = json['Remarks'];
if (json['ApporvalDetails'] != null) {
apporvalDetails = new List<ApporvalDetails>();
json['ApporvalDetails'].forEach((v) {
apporvalDetails.add(new ApporvalDetails.fromJson(v));
});
}
clinicName = json['ClinicName'];
companyName = json['CompanyName'];
doctorName = json['DoctorName'];
projectName = json['ProjectName'];
totaUnUsedCount = json['TotaUnUsedCount'];
unUsedCount = json['UnUsedCount'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['ApprovalNo'] = this.approvalNo;
data['Status'] = this.status;
data['ApprovalDate'] = this.approvalDate;
data['PatientType'] = this.patientType;
data['PatientID'] = this.patientID;
data['CompanyID'] = this.companyID;
data['SubCategoryID'] = this.subCategoryID;
data['DoctorID'] = this.doctorID;
data['ClinicID'] = this.clinicID;
data['ApprovalType'] = this.approvalType;
data['InpatientApprovalSubType'] = this.inpatientApprovalSubType;
data['IsApprovalOnGross'] = this.isApprovalOnGross;
data['CompanyApprovalNo'] = this.companyApprovalNo;
data['ProgNoteOrderNo'] = this.progNoteOrderNo;
data['SubmitOn'] = this.submitOn;
data['ReceiptOn'] = this.receiptOn;
data['ExpiryDate'] = this.expiryDate;
data['AdmissionNo'] = this.admissionNo;
data['AdmissionRequestNo'] = this.admissionRequestNo;
data['ApprovalStatusDescption'] = this.approvalStatusDescption;
data['ApprovalStatusDescptionN'] = this.approvalStatusDescptionN;
data['Remarks'] = this.remarks;
if (this.apporvalDetails != null) {
data['ApporvalDetails'] =
this.apporvalDetails.map((v) => v.toJson()).toList();
}
data['ClinicName'] = this.clinicName;
data['CompanyName'] = this.companyName;
data['DoctorName'] = this.doctorName;
data['ProjectName'] = this.projectName;
data['TotaUnUsedCount'] = this.totaUnUsedCount;
data['UnUsedCount'] = this.unUsedCount;
return data;
}
}
class ApporvalDetails {
Null setupID;
Null projectID;
int approvalNo;
Null lineItemNo;
Null orderType;
Null procedureID;
Null toothNo;
Null price;
Null approvedAmount;
Null unapprovedPatientShare;
Null waivedAmount;
Null discountType;
Null discountValue;
Null shareType;
Null patientShareTypeValue;
Null companyShareTypeValue;
Null patientShare;
Null companyShare;
Null deductableAmount;
String disapprovedRemarks;
Null progNoteOrderNo;
Null progNoteLineItemNo;
Null invoiceTransactionType;
Null invoiceNo;
String procedureName;
String procedureNameN;
String status;
Null isInvoiced;
String isInvoicedDesc;
ApporvalDetails(
{this.setupID,
this.projectID,
this.approvalNo,
this.lineItemNo,
this.orderType,
this.procedureID,
this.toothNo,
this.price,
this.approvedAmount,
this.unapprovedPatientShare,
this.waivedAmount,
this.discountType,
this.discountValue,
this.shareType,
this.patientShareTypeValue,
this.companyShareTypeValue,
this.patientShare,
this.companyShare,
this.deductableAmount,
this.disapprovedRemarks,
this.progNoteOrderNo,
this.progNoteLineItemNo,
this.invoiceTransactionType,
this.invoiceNo,
this.procedureName,
this.procedureNameN,
this.status,
this.isInvoiced,
this.isInvoicedDesc});
ApporvalDetails.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
projectID = json['ProjectID'];
approvalNo = json['ApprovalNo'];
lineItemNo = json['LineItemNo'];
orderType = json['OrderType'];
procedureID = json['ProcedureID'];
toothNo = json['ToothNo'];
price = json['Price'];
approvedAmount = json['ApprovedAmount'];
unapprovedPatientShare = json['UnapprovedPatientShare'];
waivedAmount = json['WaivedAmount'];
discountType = json['DiscountType'];
discountValue = json['DiscountValue'];
shareType = json['ShareType'];
patientShareTypeValue = json['PatientShareTypeValue'];
companyShareTypeValue = json['CompanyShareTypeValue'];
patientShare = json['PatientShare'];
companyShare = json['CompanyShare'];
deductableAmount = json['DeductableAmount'];
disapprovedRemarks = json['DisapprovedRemarks'];
progNoteOrderNo = json['ProgNoteOrderNo'];
progNoteLineItemNo = json['ProgNoteLineItemNo'];
invoiceTransactionType = json['InvoiceTransactionType'];
invoiceNo = json['InvoiceNo'];
procedureName = json['ProcedureName'];
procedureNameN = json['ProcedureNameN'];
status = json['Status'];
isInvoiced = json['IsInvoiced'];
isInvoicedDesc = json['IsInvoicedDesc'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['ApprovalNo'] = this.approvalNo;
data['LineItemNo'] = this.lineItemNo;
data['OrderType'] = this.orderType;
data['ProcedureID'] = this.procedureID;
data['ToothNo'] = this.toothNo;
data['Price'] = this.price;
data['ApprovedAmount'] = this.approvedAmount;
data['UnapprovedPatientShare'] = this.unapprovedPatientShare;
data['WaivedAmount'] = this.waivedAmount;
data['DiscountType'] = this.discountType;
data['DiscountValue'] = this.discountValue;
data['ShareType'] = this.shareType;
data['PatientShareTypeValue'] = this.patientShareTypeValue;
data['CompanyShareTypeValue'] = this.companyShareTypeValue;
data['PatientShare'] = this.patientShare;
data['CompanyShare'] = this.companyShare;
data['DeductableAmount'] = this.deductableAmount;
data['DisapprovedRemarks'] = this.disapprovedRemarks;
data['ProgNoteOrderNo'] = this.progNoteOrderNo;
data['ProgNoteLineItemNo'] = this.progNoteLineItemNo;
data['InvoiceTransactionType'] = this.invoiceTransactionType;
data['InvoiceNo'] = this.invoiceNo;
data['ProcedureName'] = this.procedureName;
data['ProcedureNameN'] = this.procedureNameN;
data['Status'] = this.status;
data['IsInvoiced'] = this.isInvoiced;
data['IsInvoicedDesc'] = this.isInvoicedDesc;
return data;
}
}

@ -1,5 +1,7 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/insurance_approval_request_model.dart';
import 'package:doctor_app_flutter/core/model/insurance_approval.dart';
import 'package:doctor_app_flutter/core/model/insurance_approval_in_patient_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
@ -10,27 +12,55 @@ class InsuranceCardService extends BaseService {
patientType: 1,
eXuldAPPNO: 0,
projectID: 0);
InsuranceApprovalInPatientRequestModel
_insuranceApprovalInPatientRequestModel =
InsuranceApprovalInPatientRequestModel();
List<InsuranceApprovalModel> _insuranceApproval = List();
List<InsuranceApprovalModel> get insuranceApproval => _insuranceApproval;
Future getInsuranceApproval(PatiantInformtion patient,{int appointmentNo , int projectId}) async {
List<InsuranceApprovalInPatientModel> _insuranceApprovalInPatient = List();
List<InsuranceApprovalInPatientModel> get insuranceApprovalInPatient =>
_insuranceApprovalInPatient;
Future getInsuranceApprovalInPatient({int mrn}) async {
_insuranceApprovalInPatientRequestModel =
InsuranceApprovalInPatientRequestModel(
patientID: mrn,
patientTypeID: 1,
);
hasError = false;
insuranceApprovalInPatient.clear();
await baseAppClient.post(GET_INSURANCE_IN_PATIENT,
onSuccess: (dynamic response, int statusCode) {
//prescriptionsList.clear();
response['List_ApprovalMain_InPatient'].forEach((prescriptions) {
insuranceApprovalInPatient
.add(InsuranceApprovalInPatientModel.fromJson(prescriptions));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _insuranceApprovalInPatientRequestModel.toJson());
}
Future getInsuranceApproval(PatiantInformtion patient,
{int appointmentNo, int projectId}) async {
hasError = false;
// _cardList.clear();
// if (appointmentNo != null) {
// _insuranceApprovalModel.appointmentNo = appointmentNo;
// _insuranceApprovalModel.eXuldAPPNO = null;
// if (appointmentNo != null) {
// _insuranceApprovalModel.appointmentNo = appointmentNo;
// _insuranceApprovalModel.eXuldAPPNO = null;
// _insuranceApprovalModel.projectID = projectId;
// } else {
_insuranceApprovalModel.appointmentNo = null;
_insuranceApprovalModel.eXuldAPPNO = 0;
_insuranceApprovalModel.projectID = 0;
// }
// } else {
_insuranceApprovalModel.appointmentNo = null;
_insuranceApprovalModel.eXuldAPPNO = 0;
_insuranceApprovalModel.projectID = 0;
// }
await baseAppClient.postPatient(GET_PAtIENTS_INSURANCE_APPROVALS,
patient: patient,
onSuccess: (dynamic response, int statusCode) {
patient: patient, onSuccess: (dynamic response, int statusCode) {
print(response['HIS_Approval_List'].length);
_insuranceApproval.clear();
_insuranceApproval.length = 0;

@ -0,0 +1,48 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class ReferralService extends BaseService {
//TODO Jammal
Future referralPatient(
{String admissionNo,
String roomID,
String referralClinic,
String referralDoctor,
String patientID,
String patientTypeID,
String referringClinic,
String referringDoctorRemarks,
String priority,String frequency,String extension}) async {
await getDoctorProfile();
hasError = false;
Map<String, dynamic> body = Map();
body['ProjectID'] = doctorProfile.projectID;
body['AdmissionNo'] = admissionNo;
body['RoomID'] = roomID;
body['ReferralClinic'] = referralClinic;
body['ReferralDoctor'] = referralDoctor;
body['CreatedBy'] = doctorProfile.doctorID;
body['EditedBy'] = doctorProfile.doctorID;
body['PatientID'] = patientID;
body['PatientTypeID'] = patientTypeID;
body['ReferringClinic'] = referringClinic;
body['ReferringDoctor'] = doctorProfile.doctorID;
body['ReferringDoctorRemarks'] = referringDoctorRemarks;
body['Priority'] = priority;
body['Frequency'] = frequency;
body['Extension'] = extension;
await baseAppClient.post(
REFER_TO_DOCTOR,
onSuccess: (dynamic response, int statusCode) {
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: body,
);
}
}

@ -22,6 +22,8 @@ class PatientReferralService extends LookupService {
List<PendingReferral> patientReferralList = [];
String setupID = "0";
var frequencyList = [];
Future getProjectsList() async {
hasError = false;
const url = GET_PROJECTS;
@ -191,7 +193,7 @@ class PatientReferralService extends LookupService {
Future getPatientReferral(PatiantInformtion patient) async {
hasError = false;
Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientMRN;
body['PatientMRN'] = patient.patientMRN ?? patient.patientId;
body['AppointmentNo'] = patient.appointmentNo;
await baseAppClient.post(
@ -258,7 +260,7 @@ class PatientReferralService extends LookupService {
.add({"goalId": element.id, "remarks": element.remarks});
});
body['PatientMRN'] = patient.patientMRN;
body['PatientMRN'] = patient.patientMRN ?? patient.patientId;
body['AppointmentNo'] = patient.appointmentNo;
body['SetupID'] = setupID;
body['appointmentDate'] = isoStringDate;
@ -284,4 +286,23 @@ class PatientReferralService extends LookupService {
body: body,
);
}
Future getReferralFrequencyList() async {
hasError = false;
Map<String, dynamic> body = Map();
await baseAppClient.post(
PATIENT_GET_LIST_REFERAL_URL,
onSuccess: (dynamic response, int statusCode) {
frequencyList = [];
frequencyList = response['list_STPReferralFrequency'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: body,
);
}
}

@ -1,31 +1,45 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/insurance_approval.dart';
import 'package:doctor_app_flutter/core/model/insurance_approval_in_patient_model.dart';
import 'package:doctor_app_flutter/core/service/InsuranceCardService.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import '../../locator.dart';
class InsuranceViewModel extends BaseViewModel{
class InsuranceViewModel extends BaseViewModel {
InsuranceCardService _insuranceCardService = locator<InsuranceCardService>();
List<InsuranceApprovalModel> get insuranceApproval =>
_insuranceCardService.insuranceApproval;
List<InsuranceApprovalInPatientModel> get insuranceApprovalInPatient =>
_insuranceCardService.insuranceApprovalInPatient;
Future getInsuranceApproval(PatiantInformtion patient,{int appointmentNo, int projectId}) async {
Future getInsuranceApproval(PatiantInformtion patient,
{int appointmentNo, int projectId}) async {
error = "";
setState(ViewState.Busy);
if (appointmentNo != null)
await _insuranceCardService.getInsuranceApproval(patient,
appointmentNo: appointmentNo,projectId: projectId);
appointmentNo: appointmentNo, projectId: projectId);
else
await _insuranceCardService.getInsuranceApproval(patient);
if (_insuranceCardService.hasError) {
error = "No Insurance Approval Found";
setState(ViewState.Error);
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getInsuranceInPatient({int mrn}) async {
//hasError = false;
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
await _insuranceCardService.getInsuranceApprovalInPatient(mrn: mrn);
if (_insuranceCardService.hasError) {
error = _insuranceCardService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
}
}

@ -1,10 +1,8 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/patient-doctor-referral-service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/clinic-doctor.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart';
@ -22,9 +20,13 @@ class PatientReferralViewModel extends BaseViewModel {
List<dynamic> get clinicsList => _referralPatientService.clinicsList;
List<dynamic> get referralFrequencyList =>
_referralPatientService.frequencyList;
List<dynamic> doctorsList = [];
List<ClinicDoctor> get clinicDoctorsList => _referralPatientService.doctorsList;
List<ClinicDoctor> get clinicDoctorsList =>
_referralPatientService.doctorsList;
List<MyReferredPatientModel> get listMyReferredPatientModel =>
_referralPatientService.listMyReferredPatientModel;
@ -85,20 +87,20 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getClinicDoctors(PatiantInformtion patient ,int clinicId, int branchId) async {
Future getClinicDoctors(
PatiantInformtion patient, int clinicId, int branchId) async {
setState(ViewState.BusyLocal);
await _referralPatientService.getDoctorsList(patient, clinicId, branchId);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.ErrorLocal);
} else{
} else {
doctorsList.clear();
clinicDoctorsList.forEach((element) {
doctorsList.add(element.toJson());
});
setState(ViewState.Idle);
}
}
Future<dynamic> getDoctorBranch() async {
@ -161,13 +163,25 @@ class PatientReferralViewModel extends BaseViewModel {
}
}
Future makeInPatientReferral(
{PatiantInformtion patient,
int projectID,
int clinicID,
int doctorID,
int frequencyCode,
int priority,
String referralDate,
String remarks,
String ext}) async {
}
Future getPatientDetails(
String fromDate, String toDate, int patientMrn, int appointmentNo) async {
setState(ViewState.Busy);
await _referralPatientService.getPatientArrivalList(toDate,
fromDate: fromDate,
patientMrn: patientMrn);
fromDate: fromDate, patientMrn: patientMrn);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
@ -179,17 +193,27 @@ class PatientReferralViewModel extends BaseViewModel {
String getReferralStatusNameByCode(int statusCode, BuildContext context) {
switch (statusCode) {
case 1:
return TranslationBase.of(context).pending/*referralStatusHold*/;
return TranslationBase.of(context).pending /*referralStatusHold*/;
case 2:
return TranslationBase.of(context).accepted/*referralStatusActive*/;
return TranslationBase.of(context).accepted /*referralStatusActive*/;
case 4:
return TranslationBase.of(context).rejected/*referralStatusCancelled*/;
return TranslationBase.of(context).rejected /*referralStatusCancelled*/;
case 46:
return TranslationBase.of(context).accepted/*referralStatusCompleted*/;
return TranslationBase.of(context).accepted /*referralStatusCompleted*/;
case 63:
return TranslationBase.of(context).rejected/*referralStatusNotSeen*/;
return TranslationBase.of(context).rejected /*referralStatusNotSeen*/;
default:
return "-";
}
}
Future getReferralFrequencyList() async {
setState(ViewState.Busy);
await _referralPatientService.getReferralFrequencyList();
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
}

@ -65,6 +65,8 @@ class PatientViewModel extends BaseViewModel {
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else{
setState(ViewState.Idle);
}
return localRes;
}

@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/lab_result/labs_home
import 'package:doctor_app_flutter/screens/patients/profile/note/progress_note_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_home_page.dart';
import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/refer-patient-screen-in-patient.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/update_soap_index.dart';
import 'package:doctor_app_flutter/screens/prescription/prescriptions_page.dart';
import 'package:doctor_app_flutter/screens/sick-leave/add-sickleave.dart';
@ -40,6 +41,7 @@ const String ORDER_NOTE = 'patients/order-note';
const String MY_REFERRAL_DETAIL = 'my_referral_detail';
const String REFER_PATIENT_TO_DOCTOR = 'patients/refer-to-doctor';
const String REFER_IN_PATIENT_TO_DOCTOR = 'patients/refer-in-patient-to-doctor';
const String PATIENT_INSURANCE_APPROVALS_NEW =
'patients/patient_insurance_approvals_new';
const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details';
@ -70,6 +72,7 @@ var routes = {
PROGRESS_NOTE: (_) => ProgressNoteScreen(visitType: 5,),
ORDER_NOTE: (_) => ProgressNoteScreen(visitType: 3,),
REFER_PATIENT_TO_DOCTOR: (_) => PatientMakeReferralScreen(),
REFER_IN_PATIENT_TO_DOCTOR: (_) => PatientMakeInPatientReferralScreen(),
PATIENT_INSURANCE_APPROVALS_NEW: (_) => InsuranceApprovalScreenNew(),
VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(),
RADIOLOGY_PATIENT: (_) => RadiologyHomePage(),

@ -52,7 +52,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
Row(
children: [
AppText(
'Medical',
'Health',
fontSize: 15.0,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
@ -62,7 +62,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
Row(
children: [
AppText(
'Report',
'Summary',
fontSize: 30.0,
fontWeight: FontWeight.w700,
),

@ -40,11 +40,13 @@ class _InsuranceApprovalScreenNewState
String patientType = routeArgs['patientType'];
return BaseView<InsuranceViewModel>(
onModelReady: patient.appointmentNo != null
? (model) => model.getInsuranceApproval(patient,
appointmentNo: patient.appointmentNo,
projectId: patient.projectId)
: (model) => model.getInsuranceApproval(patient),
onModelReady: patientType == "1"
? (model) => model.getInsuranceInPatient(mrn: patient.patientId)
: patient.appointmentNo != null
? (model) => model.getInsuranceApproval(patient,
appointmentNo: patient.appointmentNo,
projectId: patient.projectId)
: (model) => model.getInsuranceApproval(patient),
builder: (BuildContext context, InsuranceViewModel model, Widget child) =>
AppScaffold(
appBar: PatientProfileHeaderNewDesignAppBar(
@ -52,97 +54,200 @@ class _InsuranceApprovalScreenNewState
isShowAppBar: true,
baseViewModel: model,
appBarTitle: TranslationBase.of(context).approvals,
body: SingleChildScrollView(
child: Container(
margin: EdgeInsets.only(
left: SizeConfig.screenWidth * 0.004,
right: SizeConfig.screenWidth * 0.004,
top: SizeConfig.screenWidth * 0.04,
),
child: model.insuranceApproval.length != 0
? Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Row(
body: patientType == "1"
? SingleChildScrollView(
child: Container(
margin: EdgeInsets.only(
left: SizeConfig.screenWidth * 0.004,
right: SizeConfig.screenWidth * 0.004,
top: SizeConfig.screenWidth * 0.04,
),
child: model.insuranceApprovalInPatient.length != 0
? Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
AppText(
'Insurance',
fontSize: 15.0,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
Row(
children: [
AppText(
'Insurance',
fontSize: 15.0,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
),
],
),
Row(
children: [
AppText(
'Approvals',
fontSize: 30.0,
fontWeight: FontWeight.w700,
),
],
),
],
),
Row(
children: [
AppText(
'Approvals',
fontSize: 30.0,
fontWeight: FontWeight.w700,
),
...List.generate(
model.insuranceApprovalInPatient.length,
(index) => Container(
child: InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
InsuranceApprovalsDetails(
patient: patient,
indexInsurance: index,
patientType: patientType,
)),
);
},
child: DoctorCardInsurance(
patientOut: "In Patient",
profileUrl:
'https://previews.123rf.com/images/ihorbiliavskyi/ihorbiliavskyi1812/ihorbiliavskyi181200077/114296311-doctor-avatar-icon-profession-logo-male-character-a-man-in-professional-clothes-people-specialists-f.jpg',
clinic: model
.insuranceApprovalInPatient[index]
.clinicName,
doctorName: model
.insuranceApprovalInPatient[index]
.doctorName,
branch: model
.insuranceApprovalInPatient[index]
.approvalNo
.toString(),
isPrescriptions: true,
approvalStatus: model
.insuranceApprovalInPatient[index]
.approvalStatusDescption ??
'',
branch2: model
.insuranceApprovalInPatient[index]
.projectName,
),
],
),
),
),
],
)
: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText('No Insurance Approval Found'),
),
SizedBox(
height: 150.0,
)
],
),
),
...List.generate(
model.insuranceApproval.length,
(index) => Container(
child: InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
InsuranceApprovalsDetails(
patient: patient,
indexInsurance: index,
)),
);
},
child: DoctorCardInsurance(
patientOut: model.insuranceApproval[index]
.patientDescription,
profileUrl:
model.insuranceApproval[index].doctorImage,
clinic:
model.insuranceApproval[index].clinicName,
doctorName:
model.insuranceApproval[index].doctorName,
branch: model
.insuranceApproval[index].approvalNo
.toString(),
isPrescriptions: true,
approvalStatus: model.insuranceApproval[index]
.approvalStatusDescption ??
'',
branch2:
model.insuranceApproval[index].projectName,
),
)
: SingleChildScrollView(
child: Container(
margin: EdgeInsets.only(
left: SizeConfig.screenWidth * 0.004,
right: SizeConfig.screenWidth * 0.004,
top: SizeConfig.screenWidth * 0.04,
),
child: model.insuranceApproval.length != 0
? Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Row(
children: [
AppText(
'Insurance',
fontSize: 15.0,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
),
],
),
Row(
children: [
AppText(
'Approvals',
fontSize: 30.0,
fontWeight: FontWeight.w700,
),
],
),
],
),
),
),
),
),
],
)
: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText('No Insurance Approval Found'),
...List.generate(
model.insuranceApproval.length,
(index) => Container(
child: InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
InsuranceApprovalsDetails(
patient: patient,
indexInsurance: index,
patientType: patientType,
)),
);
},
child: DoctorCardInsurance(
patientOut: model.insuranceApproval[index]
.patientDescription,
profileUrl: model
.insuranceApproval[index].doctorImage,
clinic: model
.insuranceApproval[index].clinicName,
doctorName: model
.insuranceApproval[index].doctorName,
branch: model
.insuranceApproval[index].approvalNo
.toString(),
isPrescriptions: true,
approvalStatus: model
.insuranceApproval[index]
.approvalStatusDescption ??
'',
branch2: model
.insuranceApproval[index].projectName,
),
),
),
),
],
)
],
),
)),
),
: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText('No Insurance Approval Found'),
)
],
),
)),
),
),
);
}

File diff suppressed because it is too large Load Diff

@ -539,11 +539,8 @@ class _PatientsScreenState extends State<PatientsScreen> {
padding: EdgeInsets.only(
left: 10, top: 10),
child: AppText(
TranslationBase.of(
context)
.searchPatientName,
fontWeight:
FontWeight.bold,
TranslationBase.of(context).searchPatientName,
fontSize: 13,
)),
AppTextFormField(
// focusNode: focusProject,

@ -135,7 +135,7 @@ class LabResultWidget extends StatelessWidget {
color: Colors.white,
child: Center(
child: AppText(
patientLabResultList[index].resultValue +
patientLabResultList[index].resultValue ??""+
" " +
"${patientLabResultList[index].uOM ?? ""}",
textAlign: TextAlign.center,

@ -1,4 +1,5 @@
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/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/progress_note_request.dart';
@ -10,7 +11,9 @@ import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrde
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart';
import '../../../../config/shared_pref_kay.dart';
@ -88,7 +91,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
isUpdate: false,
)),
);
},label: 'Add a New Order',),
},label: widget.visitType ==3?'Add a New Order Sheet':'Create a New Progress Note',),
Expanded(
child: Container(
@ -120,20 +123,23 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
Container(
width: MediaQuery.of(context).size.width * 0.65,
child: Row(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: AppText('Created By: ',
fontSize: 12,
),
margin: EdgeInsets.only(top: 3),
),
Expanded(
child: AppText(
notesList[index].doctorName??'',fontWeight: FontWeight.w600),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText('Created By: ',
fontSize: 10,
),
Expanded(
child: AppText(
notesList[index].doctorName??'',fontWeight: FontWeight.w600,fontSize: 12,),
),
],
),
AppText(
notesList[index].status == 4?'Canceled':'',fontWeight: FontWeight.w600, color: Colors.red.shade700,fontSize: 12,),
],
),
),
@ -166,6 +172,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
fontSize: 14,
),
],
crossAxisAlignment: CrossAxisAlignment.end,
)
],
),
@ -182,25 +189,6 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
fontSize: 10,
),
),
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => UpdateNoteOrder(
note: notesList[index],
patientModel: model,
patient: patient,
visitType: widget.visitType,
isUpdate: true,
)),
);
},
child: Icon(
DoctorApp.edit,
size: 18,
))
],
),
],

@ -36,10 +36,10 @@ class UpdateNoteOrder extends StatefulWidget {
class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
int selectedType;
bool isSubmitted = false;
TextEditingController progressNoteController = TextEditingController();
setSelectedType(int val) {
setState(() {
selectedType = val;
@ -51,73 +51,85 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
if (widget.note != null) {
progressNoteController.text = widget.note.notes;
}
return BaseView<PatientViewModel>(
builder: (BuildContext context, PatientViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: false,
backgroundColor: Theme
.of(context)
.scaffoldBackgroundColor,
body: SingleChildScrollView(
child: Container(
height: MediaQuery
.of(context)
.size
.height * 1.0,
child: Padding(
padding: EdgeInsets.all(0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BottomSheetTitle(title: 'Add Progress Note',),
SizedBox(
height: 10.0,
),
Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
children: [
AppTextFieldCustom(
hintText: TranslationBase.of(context).addProgressNote,
controller: progressNoteController,
maxLines: 25,
minLines: 7,
hasBorder: true,
// validationError:complaintsController.text.isEmpty ,
),
],
),
),
),
],
return AppScaffold(
isShowAppBar: false,
backgroundColor: Theme
.of(context)
.scaffoldBackgroundColor,
body: SingleChildScrollView(
child: Container(
height: MediaQuery
.of(context)
.size
.height * 1.0,
child: Padding(
padding: EdgeInsets.all(0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BottomSheetTitle(title: widget.visitType == 3
? 'Add Order Sheet'
: 'Add Progress Note',),
SizedBox(
height: 10.0,
),
Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
children: [
AppTextFieldCustom(
hintText: widget.visitType == 3
? 'Add Order Sheet'
: 'Add Progress Note',
//TranslationBase.of(context).addProgressNote,
controller: progressNoteController,
maxLines: 25,
minLines: 10,
hasBorder: true,
validationError:progressNoteController.text.isEmpty&&isSubmitted?TranslationBase.of(context).emptyMessage:null ,
),
],
),
),
),
),
],
),
bottomSheet: Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: 'Add Progress Note',
),
),
),
bottomSheet: Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: widget.visitType == 3
? 'Add Order Sheet'
: 'Add Progress Note',
color: Color(0xff359846),
// disabled: progressNoteController.text.isEmpty,
fontWeight: FontWeight.w700,
onPressed: () async {
GifLoaderDialogUtils.showMyDialog(context);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
setState(() {
isSubmitted = true;
});
if (progressNoteController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
DoctorProfileModel doctorProfile = DoctorProfileModel
.fromJson(profile);
if (widget.isUpdate) {
UpdateNoteReqModel reqModel = UpdateNoteReqModel(
admissionNo: int.parse(widget.patient.admissionNo),
if (widget.isUpdate) {
UpdateNoteReqModel reqModel = UpdateNoteReqModel(
admissionNo: int.parse(widget.patient
.admissionNo),
cancelledNote: false,
lineItemNo: 30,
createdBy: widget.note.createdBy,
@ -128,47 +140,50 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
patientTypeID: widget.patient.patientType,
patientOutSA: false,
);
await model.updatePatientProgressNote(reqModel);
} else {
CreateNoteModel reqModel = CreateNoteModel(
admissionNo: int.parse(widget.patient.admissionNo),
createdBy: doctorProfile.doctorID,
visitType: widget.visitType,
patientID: widget.patient.patientId,
nursingRemarks: ' ',
patientTypeID: widget.patient.patientType,
patientOutSA: false,
notes: progressNoteController.text
);
await model.createPatientProgressNote(reqModel);
);
await widget.patientModel.updatePatientProgressNote(reqModel);
} else {
CreateNoteModel reqModel = CreateNoteModel(
admissionNo: int.parse(widget.patient
.admissionNo),
createdBy: doctorProfile.doctorID,
visitType: widget.visitType,
patientID: widget.patient.patientId,
nursingRemarks: ' ',
patientTypeID: widget.patient.patientType,
patientOutSA: false,
notes: progressNoteController.text
);
await widget.patientModel.createPatientProgressNote(reqModel);
}
if (widget.patientModel.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(
Helpers.generateContactAdminMsg());
} else {
ProgressNoteRequest progressNoteRequest =
ProgressNoteRequest(
visitType: widget.visitType,
// if equal 5 then this will return progress note
admissionNo: int.parse(widget.patient
.admissionNo),
projectID: widget.patient.projectId,
patientTypeID: widget.patient.patientType,
languageID: 2);
await widget.patientModel.getPatientProgressNote(
progressNoteRequest.toJson());
}
GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pop();
}
if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast("Error");
} else {
ProgressNoteRequest progressNoteRequest =
ProgressNoteRequest(
visitType: widget.visitType,
// if equal 5 then this will return progress note
admissionNo: int.parse(widget.patient.admissionNo),
projectID: widget.patient.projectId,
patientTypeID: widget.patient.patientType,
languageID: 2);
await widget.patientModel.getPatientProgressNote(
progressNoteRequest.toJson());
}
GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pop();
},
),
],
),
}
),
),
],
),
),
);
}
}

@ -1,10 +1,13 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart';
import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart';
@ -13,7 +16,6 @@ import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info
import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget_search.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/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@ -39,22 +41,62 @@ class PatientProfileScreen extends StatelessWidget {
isFromSearch = routeArgs['isSearch'];
}
return BaseView<SOAPViewModel>(
onModelReady: (model) async {
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
patientMRN: patient.patientMRN ?? patient.patientId,
doctorID: '',
editedBy: '');
await model.getPatientAllergy(generalGetReqForSOAP);
if (model.allergiesList.length == 0) {
await model.getMasterLookup(MasterKeysService.Allergies);
}
if (model.allergySeverityList.length == 0) {
await model.getMasterLookup(MasterKeysService.AllergySeverity);
}
return BaseView<PatientViewModel>(
onModelReady: (patientViewModel) async {
PatientModel patientReq = PatientModel(
ProjectID: 0,
ClinicID: 0,
DoctorID: 0,
FirstName: "0",
MiddleName: "0",
LastName: "0",
PatientMobileNumber: "0",
PatientIdentificationID: "0",
PatientID: patient.patientId,
From: "0",
To: "0",
LanguageID: 2,
stamp: "2020-03-02T13:56:39.170Z",
IPAdress: "11.11.11.11",
VersionID: 1.2,
Channel: 9,
TokenID: "@dm!n",
SessionID: "5G0yXn0Jnq",
IsLoginForDoctorApp: true,
PatientOutSA: false);
if(patient.patientType ==1) {
patientViewModel.getPatientList(patientReq, "1", isBusyLocal: false).then((response) {
if (response['MessageStatus'] == 1) {
if (response['List_MyInPatient'] != null) {
List<PatiantInformtion> patientList =
ModelResponse.fromJson(response['List_MyInPatient'])
.list;
patient.admissionNo = patientList[0].admissionNo;
patient.admissionDate = patientList[0].admissionDate;
} else {
DrAppToastMsg.showErrorToast('No patient');
}
}
}).catchError((error) {
// setState(() {
// isLoading = false;
// });
Helpers.showErrorToast(error.message);
//DrAppToastMsg.showErrorToast(error);
});
}
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
builder: (_, patientViewModel, w) => AppScaffold(
baseViewModel: patientViewModel,
appBarTitle: TranslationBase.of(context).patientProfile,
isShowAppBar: false,
body: Container(
@ -67,9 +109,9 @@ class PatientProfileScreen extends StatelessWidget {
children: [
!isFromSearch && patientType == "1"
? PatientProfileHeaderNewDesignInPatient(
patient, patientType, arrivalType)
patient, patientType, arrivalType)
: PatientProfileHeaderNewDesign(
patient, patientType, arrivalType),
patient, patientType, arrivalType),
Expanded(
child: Padding(
padding: const EdgeInsets.all(16.0),
@ -78,8 +120,8 @@ class PatientProfileScreen extends StatelessWidget {
children: [
isFromSearch
? ProfileMedicalInfoWidgetSearch(
patient: patient,
patientType: patientType,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
from: from,
to: to,
@ -109,7 +151,10 @@ class PatientProfileScreen extends StatelessWidget {
),
if (int.parse(patientType) == 7 ||
int.parse(patientType) == 6)
Positioned(
BaseView<SOAPViewModel>(
onModelReady: (model) async {
},
builder: (_, model, w) => Positioned(
top: 175,
left: 20,
right: 20,
@ -179,7 +224,7 @@ class PatientProfileScreen extends StatelessWidget {
}),
],
),
),
)),
],
),
),
@ -210,499 +255,3 @@ class AvatarWidget extends StatelessWidget {
}
}
/* Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(boxShadow: <BoxShadow>[
BoxShadow(
color: Colors.grey.shade300,
blurRadius: 10.0,
spreadRadius: 0,
offset: Offset(0, 10)),
], color: Colors.white),
child: Column(children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
children: <Widget>[
AvatarWidget(
Icon(
patient.genderDescription == "Male"
? DoctorApp.male
: DoctorApp.female_icon,
size: 70,
color: Colors.white,
),
),
SizedBox(
width: 20,
),
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
patient.firstName +
' ' +
patient.lastName,
color: Colors.black,
fontWeight: FontWeight.bold,
),
Row(
children: [
AppText(
TranslationBase.of(context)
.fileNo,
color: Colors.black,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 4,
),
AppText(
patient.patientId.toString(),
color: Colors.black,
fontWeight: FontWeight.normal,
),
],
),
model.patientAllergiesList
.isNotEmpty &&
model.getAllergicNames(
projectViewModel
.isArabic) !=
''
? Container(
width: MediaQuery.of(context)
.size
.width *
0.65,
child: Padding(
padding: const EdgeInsets
.symmetric(vertical: 8),
child: AppText(
TranslationBase.of(
context)
.allergicTO +
" : " +
model.getAllergicNames(
projectViewModel
.isArabic),
color: Color(0xFFB9382C),
fontWeight:
FontWeight.bold,
),
),
)
: AppText(''),
],
)
],
),
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
Container(
height: 11 * SizeConfig.textMultiplier,
child: Row(
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(
16.0, 8.0, 8.0, 8.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).age,
fontWeight: FontWeight.bold,
fontSize: 2 *
SizeConfig.textMultiplier,
),
SizedBox(
height: 4,
),
AppText(
"${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}",
fontWeight: FontWeight.normal,
fontSize: 1.6 *
SizeConfig.textMultiplier,
),
],
),
),
),
Container(
width: 1,
color: Color(0xffCCCCCC),
),
Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(
16.0, 8.0, 8.0, 8.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.nationality,
fontWeight: FontWeight.bold,
fontSize: 2 *
SizeConfig.textMultiplier,
),
SizedBox(
height: 4,
),
AppText(
patient.nationalityName ??
patient.nationality,
fontWeight: FontWeight.normal,
fontSize: 1.7 *
SizeConfig.textMultiplier,
),
],
),
),
),
Container(
width: 1,
color: Color(0xffCCCCCC),
),
Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(
16.0, 8.0, 8.0, 8.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.gender,
fontWeight: FontWeight.bold,
fontSize: 2 *
SizeConfig.textMultiplier,
),
SizedBox(
height: 4,
),
AppText(
patient.gender.toString() == '1'
? 'Male'
: 'Female',
fontWeight: FontWeight.normal,
fontSize: 1.8 *
SizeConfig.textMultiplier,
),
],
),
),
),
],
),
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
]),
),
if (patient.admissionNo != null)
Container(
margin: EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.admissionDetail,
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 1.8 * SizeConfig.textMultiplier,
),
SizedBox(
height: 4,
),
Container(
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.fromBorderSide(BorderSide(
color: Color(0xffBBBBBB),
width: 1,
)),
),
child: Column(
children: [
Padding(
padding: EdgeInsets.all(16),
child: Column(
children: [
Row(
children: [
Container(
width: 14 *
SizeConfig
.textMultiplier,
child: AppText(
TranslationBase.of(
context)
.dateTime,
color: Colors.black,
fontWeight:
FontWeight.bold,
fontSize: 1.6 *
SizeConfig
.textMultiplier,
),
),
Expanded(
child: AppText(
patient.createdOn !=
null
? "${DateUtils.convertDateFromServerFormat(patient.createdOn, 'EEEE dd, MMMM yyyy hh:mm a')}"
: "",
color: Colors.black,
fontWeight:
FontWeight.normal,
fontSize: 1.6 *
SizeConfig
.textMultiplier,
),
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
Container(
width: 14 *
SizeConfig
.textMultiplier,
child: AppText(
TranslationBase.of(
context)
.admissionNo,
color: Colors.black,
fontWeight:
FontWeight.bold,
fontSize: 1.6 *
SizeConfig
.textMultiplier,
),
),
AppText(
patient.admissionNo !=
null
? patient.admissionNo
: '',
color: Colors.black,
fontWeight:
FontWeight.normal,
fontSize: 1.6 *
SizeConfig
.textMultiplier,
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
Container(
width: 14 *
SizeConfig
.textMultiplier,
child: AppText(
TranslationBase.of(
context)
.losNo,
color: Colors.black,
fontWeight:
FontWeight.bold,
fontSize: 1.6 *
SizeConfig
.textMultiplier,
),
),
AppText(
patient.createdOn != null
? DateUtils
.differenceBetweenServerDateAndCurrent(
patient
.createdOn,
context)
: "",
color: Colors.black,
fontWeight:
FontWeight.normal,
fontSize: 1.6 *
SizeConfig
.textMultiplier,
),
],
),
],
),
),
const Divider(
color: Color(0xffCCCCCC),
height: 5,
thickness: 1,
indent: 0,
endIndent: 0,
),
Container(
height:
10 * SizeConfig.textMultiplier,
child: Row(
children: [
Expanded(
child: Padding(
padding: const EdgeInsets
.fromLTRB(
16.0, 8.0, 8.0, 8.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
AppText(
TranslationBase.of(
context)
.area,
fontWeight:
FontWeight.bold,
fontSize: 1.6 *
SizeConfig
.textMultiplier,
),
SizedBox(
height: 4,
),
AppText(
patient
.clinicDescription,
fontWeight:
FontWeight.normal,
fontSize: 1.6 *
SizeConfig
.textMultiplier,
),
],
),
),
),
Container(
width: 1,
color: Color(0xffCCCCCC),
),
Expanded(
child: Padding(
padding: const EdgeInsets
.fromLTRB(
16.0, 8.0, 8.0, 8.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
mainAxisAlignment:
MainAxisAlignment
.spaceEvenly,
children: [
Expanded(
child: Row(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
AppText(
TranslationBase.of(
context)
.room,
fontWeight:
FontWeight
.bold,
fontSize: 1.6 *
SizeConfig
.textMultiplier,
),
SizedBox(
width: 4,
),
Expanded(
child: AppText(
"${patient.nursingStationName}\n${patient.roomId}",
fontWeight:
FontWeight
.normal,
fontSize: 1.4 *
SizeConfig
.textMultiplier,
),
),
],
),
),
SizedBox(
height: 4,
),
Expanded(
child: Row(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
AppText(
TranslationBase.of(
context)
.bed,
fontWeight:
FontWeight
.bold,
fontSize: 1.6 *
SizeConfig
.textMultiplier,
),
SizedBox(
width: 4,
),
AppText(
"${patient.bedId}",
fontWeight:
FontWeight
.normal,
fontSize: 1.6 *
SizeConfig
.textMultiplier,
),
],
),
),
],
),
),
),
],
),
)
],
),
)
],
),
),
],
),*/

@ -1,406 +0,0 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart';
import '../../../config/size_config.dart';
import '../../../util/dr_app_shared_pref.dart';
import '../../../util/extenstions.dart';
import '../../../widgets/shared/app_scaffold_widget.dart';
import '../../../widgets/shared/app_texts_widget.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
/*
*@author: ibrahim albitar
*@Date:4/6/2020
*@param:
*@return:
*@desc:
*/
class ReferPatientScreen extends StatefulWidget {
@override
_ReferPatientState createState() => _ReferPatientState();
}
class _ReferPatientState extends State<ReferPatientScreen> {
dynamic _selectedClinic;
dynamic _selectedDoctor;
final _extController = TextEditingController();
int _activePriority = 1;
dynamic _selectedFrequency;
final _remarksController = TextEditingController();
bool isValid;
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<PatientViewModel>(
onModelReady: (model) => model.getClinicsList(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).referralPatient,
body: model.clinicsList == null
? DrAppEmbeddedError(error: 'Something Wrong!')
: SingleChildScrollView(
child: Container(
margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.clinicsList != null &&
model.clinicsList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.clinicsList,
attributeName: 'ClinicDescription',
attributeValueId: 'ClinicID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = null;
_selectedClinic = selectedValue;
model.getDoctorsList(
_selectedClinic['ClinicID']);
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).clinicSelect,
_selectedClinic != null
? _selectedClinic['ClinicDescription']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.doctorsList,
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).doctorSelect,
_selectedDoctor != null
? _selectedDoctor['DoctorName']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).ext, null, false),
enabled: true,
controller: _extController,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))
],
keyboardType: TextInputType.number,
)),
SizedBox(
height: 10,
),
priorityBar(context, screenSize),
SizedBox(
height: 20,
),
AppText(
"${TranslationBase.of(context).referralFrequency} ${getPriority()}",
fontWeight: FontWeight.bold,
fontSize: 16,
),
SizedBox(
height: 20,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.referralFrequencyList != null &&
model.referralFrequencyList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.referralFrequencyList,
attributeName: 'Description',
attributeValueId: 'ParameterCode',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedFrequency = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.selectReferralFrequency,
_selectedFrequency != null
? _selectedFrequency['Description']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).clinicDetailsandRemarks,
null,
false),
enabled: true,
controller: _remarksController,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_LETTERS))
],
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
SizedBox(
height: 10,
),
Container(
child: Column(
children: <Widget>[
AppText(
TranslationBase.of(context).pleaseFill,
color: HexColor("#B8382B"),
fontWeight: FontWeight.bold,
margin: 10,
visibility: isValid == null ? false : !isValid,
),
// TODO replace AppButton with secondary button and add loading
AppButton(
title: TranslationBase.of(context).send,
color: HexColor("#B8382B"),
onPressed: () => {referToDoctor(context, model)},
)
],
),
),
],
),
),
),
),
);
}
Widget priorityBar(BuildContext _context, Size screenSize) {
List<String> _priorities = [
TranslationBase.of(context).veryUrgent.toUpperCase(),
TranslationBase.of(context).urgent.toUpperCase(),
TranslationBase.of(context).routine.toUpperCase(),
];
return Container(
height: screenSize.height * 0.070,
decoration:
containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _priorities.map((item) {
bool _isActive = _priorities[_activePriority] == item ? true : false;
return Expanded(
child: InkWell(
child: Center(
child: Container(
height: screenSize.height * 0.070,
decoration: containerBorderDecoration(
_isActive ? HexColor("#B8382B") : Colors.white,
_isActive ? HexColor("#B8382B") : Colors.white),
child: Center(
child: Text(
item,
style: TextStyle(
fontSize: 12,
color: _isActive
? Colors.white
: Colors.black, //Colors.black,
fontWeight: FontWeight.bold,
),
),
)),
),
onTap: () {
print(_priorities.indexOf(item));
setState(() {
_activePriority = _priorities.indexOf(item);
});
},
),
);
}).toList(),
),
);
}
String getPriority() {
DateTime date = DateTime.now();
switch (_activePriority) {
case 0:
date = date.add(new Duration(hours: 3));
break;
case 1:
date = date.add(new Duration(hours: 6));
break;
case 2:
date = date.add(new Duration(days: 1));
break;
}
var format = DateFormat('yyyy/mm/dd HH:mm a');
var time = format.format(date);
print(time);
return time;
}
referToDoctor(BuildContext context, PatientViewModel model) async {
if (!validation()) {
return;
}
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
try {
await model.referToDoctor(
extension: _extController.value.text,
admissionNo: int.parse(patient.admissionNo),
referringDoctorRemarks: _remarksController.value.text,
frequency: _selectedFrequency['ParameterCode'].toString(),
patientID: patient.patientId,
patientTypeID: patient.patientType,
priority: (_activePriority + 1).toString(),
roomID: patient.roomId,
selectedClinicID: _selectedClinic['ClinicID'].toString(),
selectedDoctorID: _selectedDoctor['DoctorID'].toString(),
projectID: patient.projectId);
// TODO: Add Translation
DrAppToastMsg.showSuccesToast('Reply Successfully');
Navigator.pop(context);
} catch (e) {
DrAppToastMsg.showErrorToast(e);
}
}
bool validation() {
setState(() {
isValid = !_extController.value.text.isNullOrEmpty() &&
!_remarksController.value.text.isNullOrEmpty() &&
_selectedClinic != null &&
_selectedDoctor != null &&
_selectedFrequency != null;
});
return isValid;
}
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(6)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: 2.0,
)),
);
}
}

@ -0,0 +1,563 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.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:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:intl/intl.dart';
class PatientMakeInPatientReferralScreen extends StatefulWidget {
@override
_PatientMakeInPatientReferralScreenState createState() =>
_PatientMakeInPatientReferralScreenState();
}
class _PatientMakeInPatientReferralScreenState
extends State<PatientMakeInPatientReferralScreen> {
PatiantInformtion patient;
List<dynamic> referToList;
dynamic _referTo;
dynamic _selectedBranch;
dynamic _selectedClinic;
dynamic _selectedDoctor;
dynamic _selectedFrequency;
final _remarksController = TextEditingController();
final _extController = TextEditingController();
int _activePriority = 1;
String appointmentDate;
String branchError;
String hospitalError;
String clinicError;
String doctorError;
String frequencyError;
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
referToList = List();
dynamic sameBranch = {
"id": 1,
"name": TranslationBase.of(context).sameBranch
};
dynamic otherBranch = {
"id": 2,
"name": TranslationBase.of(context).otherBranch
};
referToList.add(sameBranch);
referToList.add(otherBranch);
final screenSize = MediaQuery.of(context).size;
return BaseView<PatientReferralViewModel>(
onModelReady: (model) => model.getReferralFrequencyList(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient,
isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar(
patient, patientType, arrivalType),
body: SingleChildScrollView(
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).refer}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
fontWeight: FontWeight.w600,
),
AppText(
"${TranslationBase.of(context).patient}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 3,
fontWeight: FontWeight.bold,
)
],
),
),
Container(
margin: EdgeInsets.symmetric(vertical: 0, horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).branch,
dropDownText:
_referTo != null ? _referTo['name'] : null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: branchError,
onClick: referToList != null
? () {
ListSelectDialog dialog = ListSelectDialog(
list: referToList,
attributeName: 'name',
attributeValueId: 'id',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_referTo = selectedValue;
_selectedBranch = null;
_selectedClinic = null;
_selectedDoctor = null;
model
.getDoctorBranch()
.then((value) async {
_selectedBranch = value;
if (_referTo['id'] == 1) {
GifLoaderDialogUtils.showMyDialog(
context);
await model
.getClinics(_selectedBranch[
'facilityId'])
.then((_) =>
GifLoaderDialogUtils
.hideDialog(context));
if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
}
} else {
_selectedBranch = null;
}
});
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).hospital,
dropDownText: _selectedBranch != null
? _selectedBranch['facilityName']
: null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: hospitalError,
onClick: model.branchesList != null &&
model.branchesList.length > 0 &&
_referTo != null &&
_referTo['id'] == 2
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.branchesList,
attributeName: 'facilityName',
attributeValueId: 'facilityId',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() async {
_selectedBranch = selectedValue;
_selectedClinic = null;
_selectedDoctor = null;
GifLoaderDialogUtils.showMyDialog(
context);
await model
.getClinics(
_selectedBranch['facilityId'])
.then((_) => GifLoaderDialogUtils
.hideDialog(context));
if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
}
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).clinic,
dropDownText: _selectedClinic != null
? _selectedClinic['ClinicDescription']
: null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: clinicError,
onClick: _selectedBranch != null &&
model.clinicsList != null &&
model.clinicsList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.clinicsList,
attributeName: 'ClinicDescription',
attributeValueId: 'ClinicID',
usingSearch: true,
hintSearchText:
TranslationBase.of(context)
.clinicSearch,
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() async {
_selectedDoctor = null;
_selectedClinic = selectedValue;
GifLoaderDialogUtils.showMyDialog(
context);
await model
.getClinicDoctors(
patient,
_selectedClinic['ClinicID'],
_selectedBranch['facilityId'])
.then((_) => GifLoaderDialogUtils
.hideDialog(context));
if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
}
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).doctor,
dropDownText: _selectedDoctor != null
? _selectedDoctor['Name']
: null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: doctorError,
onClick: _selectedClinic != null &&
model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.doctorsList,
attributeName: 'Name',
attributeValueId: 'DoctorID',
usingSearch: true,
hintSearchText:
TranslationBase.of(context)
.doctorSearch,
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: () {
if (_selectedClinic == null) {
DrAppToastMsg.showErrorToast(
"You need to select a clinic first");
} else if (model.doctorsList == null ||
model.doctorsList.length == 0) {
DrAppToastMsg.showErrorToast(
"There is no doctors for this clinic");
}
},
),
SizedBox(
height: 10,
),
AppText(
"${TranslationBase.of(context).priority}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.0,
fontWeight: FontWeight.w600,
),
SizedBox(
height: 4,
),
priorityBar(context, screenSize),
SizedBox(
height: 10,
),
AppText(
"${TranslationBase.of(context).replayBefore}: ${getPriority()}",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 1.9,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText:
TranslationBase.of(context).referralFrequency,
dropDownText: _selectedFrequency != null
? _selectedFrequency['Description']
: null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: frequencyError,
onClick: () {
ListSelectDialog dialog = ListSelectDialog(
list: model.referralFrequencyList,
attributeName: 'Description',
attributeValueId: 'ParameterCode',
usingSearch: true,
hintSearchText: TranslationBase.of(context)
.selectReferralFrequency,
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedFrequency = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
},
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).ext,
controller: _extController,
inputType: TextInputType.number,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))
],
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
hintText:
TranslationBase.of(context).dietTypeRemarks,
controller: _remarksController,
inputType: TextInputType.multiline,
minLines: 4,
maxLines: 6,
),
],
),
)
],
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: AppButton(
title: TranslationBase.of(context).refer,
fontWeight: FontWeight.w700,
color: Color(0XFF359846),
onPressed: () {
setState(() {
if (_referTo == null) {
branchError =
TranslationBase.of(context).fieldRequired;
} else {
branchError = null;
}
if (_selectedBranch == null) {
hospitalError =
TranslationBase.of(context).fieldRequired;
} else {
hospitalError = null;
}
if (_selectedClinic == null) {
clinicError =
TranslationBase.of(context).fieldRequired;
} else {
clinicError = null;
}
if (_selectedDoctor == null) {
doctorError =
TranslationBase.of(context).fieldRequired;
} else {
doctorError = null;
}
if (_selectedFrequency == null) {
frequencyError =
TranslationBase.of(context).fieldRequired;
} else {
frequencyError = null;
}
});
if (_selectedFrequency == null ||
_selectedBranch == null ||
_selectedClinic == null ||
_selectedDoctor == null ||
_remarksController.text == null ||
_extController.text == null) return;
model
.makeInPatientReferral(
patient: patient,
projectID: _selectedBranch['facilityId'],
clinicID: _selectedClinic['ClinicID'],
doctorID: _selectedDoctor['DoctorID'],
frequencyCode: _selectedFrequency['ParameterCode'],
ext: _extController.text,
remarks: _remarksController.text,
priority: _activePriority,
referralDate: appointmentDate
)
.then((_) {
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).referralSuccessMsg);
Navigator.pop(context);
});
},
),
)
],
),
),
),
),
);
}
Widget priorityBar(BuildContext _context, Size screenSize) {
List<String> _priorities = [
TranslationBase.of(context).veryUrgent.toUpperCase(),
TranslationBase.of(context).urgent.toUpperCase(),
TranslationBase.of(context).routine.toUpperCase(),
];
return Container(
height: screenSize.height * 0.070,
decoration:
containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _priorities.map((item) {
bool _isActive = _priorities[_activePriority] == item ? true : false;
return Expanded(
child: InkWell(
child: Center(
child: Container(
height: screenSize.height * 0.070,
decoration: containerBorderDecoration(
_isActive ? Color(0XFFB8382B) : Colors.white,
_isActive ? Color(0XFFB8382B) : Colors.white),
child: Center(
child: Text(
item,
style: TextStyle(
fontSize: 12,
color: _isActive
? Colors.white
: Colors.black, //Colors.black,
fontWeight: FontWeight.bold,
),
),
)),
),
onTap: () {
print(_priorities.indexOf(item));
setState(() {
_activePriority = _priorities.indexOf(item);
});
},
),
);
}).toList(),
),
);
}
String getPriority() {
DateTime date = DateTime.now();
switch (_activePriority) {
case 0:
date = date.add(new Duration(hours: 3));
break;
case 1:
date = date.add(new Duration(hours: 6));
break;
case 2:
date = date.add(new Duration(days: 1));
break;
}
var format = DateFormat('yyyy/mm/dd HH:mm a');
var time = format.format(date);
print(time);
appointmentDate = time;
return time;
}
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(6)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: 2.0,
)),
);
}
}

@ -32,7 +32,7 @@ class DateUtils {
const start = "/Date(";
const end = "+0300)";
if(str.contains("/Date")){
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
@ -40,7 +40,11 @@ class DateUtils {
date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
} else {
date = DateTime.now();
date = DateTime.now();
}
} else {
date = DateTime.parse(str);
}
return date;

@ -1236,6 +1236,7 @@ class TranslationBase {
localizedValues['admission-date'][locale.languageCode];
String get noOfDays => localizedValues['noOfDays'][locale.languageCode];
String get numOfDays => localizedValues['numOfDays'][locale.languageCode];
String get replayBefore => localizedValues['replayBefore'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -253,12 +253,12 @@ class PatientCard extends StatelessWidget {
),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context)
text: patientInfo.admissionDate ==null?"":TranslationBase.of(context)
.admissionDate +
" : ",
style: TextStyle(fontSize: 14)),
new TextSpan(
text:
text:patientInfo.admissionDate ==null?"":
"${DateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}",
style: TextStyle(
fontWeight: FontWeight.w700,

@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart';
import 'package:url_launcher/url_launcher.dart';
class PatientProfileHeaderNewDesign extends StatelessWidget {
final PatiantInformtion patient;
@ -73,6 +74,18 @@ class PatientProfileHeaderNewDesign extends StatelessWidget {
DoctorApp.female_1,
color: Colors.pink,
),
Container(
margin: EdgeInsets.symmetric(horizontal: 4),
child: InkWell(
onTap: () {
launch("tel://" + patient.mobileNumber);
},
child: Icon(
Icons.phone,
color: Colors.black87,
),
),
),
]),
),
Row(children: [

@ -184,7 +184,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget {
"${TranslationBase.of(context).numOfDays}: ",
fontSize: 1.2 * SizeConfig.textMultiplier,
),
AppText("4 st",
AppText("${ DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patient.createdOn)).inDays + 1}",
fontSize: 1.4 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w700),
],

@ -62,8 +62,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patientType: patientType,
arrivalType: arrivalType,
route: MEDICAL_FILE,
nameLine1: "Medical" ,//TranslationBase.of(context).medicalReport,
nameLine2: "Report",//TranslationBase.of(context).summaryReport,
nameLine1: "Health" ,//TranslationBase.of(context).medicalReport,
nameLine2: "Summary",//TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'),
PatientProfileButton(
key: key,
@ -182,8 +182,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_NOTE,
nameLine1: 'Order',//TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note,
nameLine1:"Order", //"Text",
nameLine2: "Sheet",
icon: 'patient/Progress_notes.png'),
],
),

@ -82,22 +82,22 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
nameLine2: TranslationBase.of(context).prescription,
icon: 'patient/order_prescription.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PROGRESS_NOTE,
nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note,
icon: 'patient/Progress_notes.png'),
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PROGRESS_NOTE,
nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note,
icon: 'patient/Progress_notes.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_NOTE,
nameLine1: "Text",
nameLine2: TranslationBase.of(context).orders,
nameLine1:"Order", //"Text",
nameLine2: "Sheet",//TranslationBase.of(context).orders,
icon: 'patient/Progress_notes.png'),
PatientProfileButton(
key: key,
@ -114,9 +114,9 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
patientType: patientType,
arrivalType: arrivalType,
route: MEDICAL_FILE,
nameLine1: "Medical",
nameLine1: "Health",
//TranslationBase.of(context).medicalReport,
nameLine2: "Report",
nameLine2: "Summary",
//TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'),
PatientProfileButton(
@ -124,10 +124,11 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isDisable: true,
route: MEDICAL_FILE,
nameLine1: "Health",
nameLine1: "Medical",//Health
//TranslationBase.of(context).medicalReport,
nameLine2: "Summery",
nameLine2: "Report",//Report
//TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'),
PatientProfileButton(
@ -135,7 +136,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: REFER_PATIENT_TO_DOCTOR,
route: REFER_IN_PATIENT_TO_DOCTOR,
nameLine1: TranslationBase.of(context).referral,
nameLine2: TranslationBase.of(context).patient,
icon: 'patient/refer_patient.png'),
@ -149,15 +150,15 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
nameLine2: TranslationBase.of(context).approvals,
icon: 'patient/vital_signs.png'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isDisable: true,
route: null,
nameLine1: "Discharge",
nameLine2: "Summery",
icon: 'patient/patient_sick_leave.png'),
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isDisable: true,
route: null,
nameLine1: "Discharge",
nameLine2: "Summery",
icon: 'patient/patient_sick_leave.png'),
],
),
);

@ -51,8 +51,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
patientType: patientType,
arrivalType: arrivalType,
route: MEDICAL_FILE,
nameLine1: "Medical" ,//TranslationBase.of(context).medicalReport,
nameLine2: "Report",//TranslationBase.of(context).summaryReport,
nameLine1: "Health" ,//TranslationBase.of(context).medicalReport,
nameLine2: "Summary",//TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'),
PatientProfileButton(
key: key,
@ -145,8 +145,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_NOTE,
nameLine1: 'Order',//TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note,
nameLine1:"Order", //"Text",
nameLine2: "Sheet",
icon: 'patient/Progress_notes.png'),
if (patientType == "1")

@ -58,7 +58,8 @@ class DoctorCard extends StatelessWidget {
children: [
Expanded(
child: AppText(
doctorName,
doctorName ?? "",
fontSize: 15,
bold: true,
)),
Expanded(

@ -41,7 +41,7 @@ class DoctorCardInsurance extends StatelessWidget {
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
width: double.maxFinite,
height: 160,
//height: 160,
margin: EdgeInsets.all(10),
padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(

Loading…
Cancel
Save