Merge remote-tracking branch 'origin/Dev_3.3_InPatient_CR' into dev_v3.13.6
# Conflicts: # lib/config/config.dart # lib/config/localized_values.dart # lib/core/service/client/base_app_client.dart # lib/core/viewModels/project_view_model.dart # lib/pages/BookAppointment/BookSuccess.dart # lib/pages/MyAppointments/MyAppointments.dart # lib/pages/insurance/AttachInsuranceCardImageDialog.dart # lib/pages/login/confirm-login.dart # lib/pages/paymentService/payment_service.dart # lib/uitl/push-notification-handler.dart # lib/uitl/translations_delegate_base.dart # lib/uitl/utils.dart # lib/uitl/utils_new.dart # lib/widgets/avatar/large_avatar.dart # lib/widgets/bottom_navigation/bottom_navigation_item.dart # lib/widgets/bottom_options/BottomSheet.dart # lib/widgets/data_display/medical/medical_profile_item.dart # lib/widgets/drawer/app_drawer_widget.dart # pubspec.yamldev_v3.13.6_voipcall
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 1.9 KiB |
@ -0,0 +1,92 @@
|
|||||||
|
class GetAdmissionInfoResponseModel {
|
||||||
|
String setupID;
|
||||||
|
int projectID;
|
||||||
|
int admissionNo;
|
||||||
|
String admissionDate;
|
||||||
|
int admissionRequestNo;
|
||||||
|
int admissionType;
|
||||||
|
int patientType;
|
||||||
|
int patientID;
|
||||||
|
int clinicID;
|
||||||
|
int doctorID;
|
||||||
|
int admittingClinicID;
|
||||||
|
int admittingDoctorID;
|
||||||
|
int categoryID;
|
||||||
|
String roomID;
|
||||||
|
String bedID;
|
||||||
|
dynamic dischargeDate;
|
||||||
|
int approvalNo;
|
||||||
|
int status;
|
||||||
|
String statusDesc;
|
||||||
|
String statusDescN;
|
||||||
|
|
||||||
|
GetAdmissionInfoResponseModel(
|
||||||
|
{this.setupID,
|
||||||
|
this.projectID,
|
||||||
|
this.admissionNo,
|
||||||
|
this.admissionDate,
|
||||||
|
this.admissionRequestNo,
|
||||||
|
this.admissionType,
|
||||||
|
this.patientType,
|
||||||
|
this.patientID,
|
||||||
|
this.clinicID,
|
||||||
|
this.doctorID,
|
||||||
|
this.admittingClinicID,
|
||||||
|
this.admittingDoctorID,
|
||||||
|
this.categoryID,
|
||||||
|
this.roomID,
|
||||||
|
this.bedID,
|
||||||
|
this.dischargeDate,
|
||||||
|
this.approvalNo,
|
||||||
|
this.status,
|
||||||
|
this.statusDesc,
|
||||||
|
this.statusDescN});
|
||||||
|
|
||||||
|
GetAdmissionInfoResponseModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
setupID = json['SetupID'];
|
||||||
|
projectID = json['ProjectID'];
|
||||||
|
admissionNo = json['AdmissionNo'];
|
||||||
|
admissionDate = json['AdmissionDate'];
|
||||||
|
admissionRequestNo = json['AdmissionRequestNo'];
|
||||||
|
admissionType = json['AdmissionType'];
|
||||||
|
patientType = json['PatientType'];
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
clinicID = json['ClinicID'];
|
||||||
|
doctorID = json['DoctorID'];
|
||||||
|
admittingClinicID = json['AdmittingClinicID'];
|
||||||
|
admittingDoctorID = json['AdmittingDoctorID'];
|
||||||
|
categoryID = json['CategoryID'];
|
||||||
|
roomID = json['RoomID'];
|
||||||
|
bedID = json['BedID'];
|
||||||
|
dischargeDate = json['DischargeDate'];
|
||||||
|
approvalNo = json['ApprovalNo'];
|
||||||
|
status = json['Status'];
|
||||||
|
statusDesc = json['StatusDesc'];
|
||||||
|
statusDescN = json['StatusDescN'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['SetupID'] = this.setupID;
|
||||||
|
data['ProjectID'] = this.projectID;
|
||||||
|
data['AdmissionNo'] = this.admissionNo;
|
||||||
|
data['AdmissionDate'] = this.admissionDate;
|
||||||
|
data['AdmissionRequestNo'] = this.admissionRequestNo;
|
||||||
|
data['AdmissionType'] = this.admissionType;
|
||||||
|
data['PatientType'] = this.patientType;
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['ClinicID'] = this.clinicID;
|
||||||
|
data['DoctorID'] = this.doctorID;
|
||||||
|
data['AdmittingClinicID'] = this.admittingClinicID;
|
||||||
|
data['AdmittingDoctorID'] = this.admittingDoctorID;
|
||||||
|
data['CategoryID'] = this.categoryID;
|
||||||
|
data['RoomID'] = this.roomID;
|
||||||
|
data['BedID'] = this.bedID;
|
||||||
|
data['DischargeDate'] = this.dischargeDate;
|
||||||
|
data['ApprovalNo'] = this.approvalNo;
|
||||||
|
data['Status'] = this.status;
|
||||||
|
data['StatusDesc'] = this.statusDesc;
|
||||||
|
data['StatusDescN'] = this.statusDescN;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,86 @@
|
|||||||
|
class GetAdmissionRequestInfoResponseModel {
|
||||||
|
int admissionRequestNo;
|
||||||
|
String clinicName;
|
||||||
|
String doctorName;
|
||||||
|
String expectedAdmissionDate;
|
||||||
|
List<MedicaLInstructions> medicalInstructions;
|
||||||
|
dynamic medicalInstructionsXML;
|
||||||
|
String medicalRemarks;
|
||||||
|
int projectId;
|
||||||
|
String projectName;
|
||||||
|
String setupId;
|
||||||
|
int clinicId;
|
||||||
|
int doctorId;
|
||||||
|
|
||||||
|
GetAdmissionRequestInfoResponseModel(
|
||||||
|
{this.admissionRequestNo,
|
||||||
|
this.clinicName,
|
||||||
|
this.doctorName,
|
||||||
|
this.expectedAdmissionDate,
|
||||||
|
this.medicalInstructions,
|
||||||
|
this.medicalInstructionsXML,
|
||||||
|
this.medicalRemarks,
|
||||||
|
this.projectId,
|
||||||
|
this.projectName,
|
||||||
|
this.setupId,
|
||||||
|
this.clinicId,
|
||||||
|
this.doctorId});
|
||||||
|
|
||||||
|
GetAdmissionRequestInfoResponseModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
admissionRequestNo = json['admissionRequestNo'];
|
||||||
|
clinicName = json['clinicName'];
|
||||||
|
doctorName = json['doctorName'];
|
||||||
|
clinicId = json['ClinicID'];
|
||||||
|
doctorId = json['DoctorID'];
|
||||||
|
expectedAdmissionDate = json['expectedAdmissionDate'];
|
||||||
|
if (json['medicaLInstructions'] != null) {
|
||||||
|
medicalInstructions = <MedicaLInstructions>[];
|
||||||
|
json['medicaLInstructions'].forEach((v) {
|
||||||
|
medicalInstructions.add(new MedicaLInstructions.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
medicalInstructionsXML = json['medicalInstructionsXML'];
|
||||||
|
medicalRemarks = json['medicalRemarks'];
|
||||||
|
projectId = json['projectId'];
|
||||||
|
projectName = json['projectName'];
|
||||||
|
setupId = json['setupId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['admissionRequestNo'] = this.admissionRequestNo;
|
||||||
|
data['clinicName'] = this.clinicName;
|
||||||
|
data['doctorName'] = this.doctorName;
|
||||||
|
data['clinicId'] = this.clinicId;
|
||||||
|
data['doctorId'] = this.doctorId;
|
||||||
|
data['expectedAdmissionDate'] = this.expectedAdmissionDate;
|
||||||
|
if (this.medicalInstructions != null) {
|
||||||
|
data['medicaLInstructions'] = this.medicalInstructions.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['medicalInstructionsXML'] = this.medicalInstructionsXML;
|
||||||
|
data['medicalRemarks'] = this.medicalRemarks;
|
||||||
|
data['projectId'] = this.projectId;
|
||||||
|
data['projectName'] = this.projectName;
|
||||||
|
data['setupId'] = this.setupId;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class MedicaLInstructions {
|
||||||
|
String description;
|
||||||
|
int parameterCode;
|
||||||
|
|
||||||
|
MedicaLInstructions({this.description, this.parameterCode});
|
||||||
|
|
||||||
|
MedicaLInstructions.fromJson(Map<String, dynamic> json) {
|
||||||
|
description = json['description'];
|
||||||
|
parameterCode = json['parameterCode'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['description'] = this.description;
|
||||||
|
data['parameterCode'] = this.parameterCode;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,220 @@
|
|||||||
|
class GetAdmittedPatientsResponseModel {
|
||||||
|
String setupID;
|
||||||
|
int projectID;
|
||||||
|
int admissionNo;
|
||||||
|
String admissionDate;
|
||||||
|
int patientType;
|
||||||
|
int patientID;
|
||||||
|
int clinicID;
|
||||||
|
int doctorID;
|
||||||
|
String roomID;
|
||||||
|
String bedID;
|
||||||
|
int status;
|
||||||
|
int admissionStatus;
|
||||||
|
String createdOn;
|
||||||
|
String firstName;
|
||||||
|
String middleName;
|
||||||
|
String lastName;
|
||||||
|
String firstNameN;
|
||||||
|
String middleNameN;
|
||||||
|
String lastNameN;
|
||||||
|
int gender;
|
||||||
|
String dateofBirth;
|
||||||
|
dynamic companionFirstName;
|
||||||
|
dynamic companionMiddleName;
|
||||||
|
dynamic companionLastName;
|
||||||
|
dynamic companionFirstNameN;
|
||||||
|
dynamic companionMiddleNameN;
|
||||||
|
dynamic companionLastNameN;
|
||||||
|
dynamic companionID;
|
||||||
|
dynamic companionGender;
|
||||||
|
bool isHasCompanion;
|
||||||
|
int buildingID;
|
||||||
|
int floorID;
|
||||||
|
int nursingStationID;
|
||||||
|
int dietType;
|
||||||
|
String dietTypeDateCahnged;
|
||||||
|
String dietTypeDescription;
|
||||||
|
String dietTypeDescriptionN;
|
||||||
|
dynamic allergyDiseaseDateCahnged;
|
||||||
|
dynamic allergyDiseaseChecked;
|
||||||
|
dynamic doctorRemarks;
|
||||||
|
dynamic allergyRemarks;
|
||||||
|
String age;
|
||||||
|
dynamic allergies;
|
||||||
|
String companionFullName;
|
||||||
|
bool dietTypeChanged;
|
||||||
|
String dietTypeDateCahngedDate;
|
||||||
|
String genderDescription;
|
||||||
|
dynamic genderImageUrl;
|
||||||
|
bool hasAllergy;
|
||||||
|
bool isNewAdmitted;
|
||||||
|
String patientFullName;
|
||||||
|
dynamic allergyRemark;
|
||||||
|
|
||||||
|
GetAdmittedPatientsResponseModel(
|
||||||
|
{this.setupID,
|
||||||
|
this.projectID,
|
||||||
|
this.admissionNo,
|
||||||
|
this.admissionDate,
|
||||||
|
this.patientType,
|
||||||
|
this.patientID,
|
||||||
|
this.clinicID,
|
||||||
|
this.doctorID,
|
||||||
|
this.roomID,
|
||||||
|
this.bedID,
|
||||||
|
this.status,
|
||||||
|
this.admissionStatus,
|
||||||
|
this.createdOn,
|
||||||
|
this.firstName,
|
||||||
|
this.middleName,
|
||||||
|
this.lastName,
|
||||||
|
this.firstNameN,
|
||||||
|
this.middleNameN,
|
||||||
|
this.lastNameN,
|
||||||
|
this.gender,
|
||||||
|
this.dateofBirth,
|
||||||
|
this.companionFirstName,
|
||||||
|
this.companionMiddleName,
|
||||||
|
this.companionLastName,
|
||||||
|
this.companionFirstNameN,
|
||||||
|
this.companionMiddleNameN,
|
||||||
|
this.companionLastNameN,
|
||||||
|
this.companionID,
|
||||||
|
this.companionGender,
|
||||||
|
this.isHasCompanion,
|
||||||
|
this.buildingID,
|
||||||
|
this.floorID,
|
||||||
|
this.nursingStationID,
|
||||||
|
this.dietType,
|
||||||
|
this.dietTypeDateCahnged,
|
||||||
|
this.dietTypeDescription,
|
||||||
|
this.dietTypeDescriptionN,
|
||||||
|
this.allergyDiseaseDateCahnged,
|
||||||
|
this.allergyDiseaseChecked,
|
||||||
|
this.doctorRemarks,
|
||||||
|
this.allergyRemarks,
|
||||||
|
this.age,
|
||||||
|
this.allergies,
|
||||||
|
this.companionFullName,
|
||||||
|
this.dietTypeChanged,
|
||||||
|
this.dietTypeDateCahngedDate,
|
||||||
|
this.genderDescription,
|
||||||
|
this.genderImageUrl,
|
||||||
|
this.hasAllergy,
|
||||||
|
this.isNewAdmitted,
|
||||||
|
this.patientFullName,
|
||||||
|
this.allergyRemark});
|
||||||
|
|
||||||
|
GetAdmittedPatientsResponseModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
setupID = json['SetupID'];
|
||||||
|
projectID = json['ProjectID'];
|
||||||
|
admissionNo = json['AdmissionNo'];
|
||||||
|
admissionDate = json['AdmissionDate'];
|
||||||
|
patientType = json['PatientType'];
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
clinicID = json['ClinicID'];
|
||||||
|
doctorID = json['DoctorID'];
|
||||||
|
roomID = json['RoomID'];
|
||||||
|
bedID = json['BedID'];
|
||||||
|
status = json['Status'];
|
||||||
|
admissionStatus = json['AdmissionStatus'];
|
||||||
|
createdOn = json['CreatedOn'];
|
||||||
|
firstName = json['FirstName'];
|
||||||
|
middleName = json['MiddleName'];
|
||||||
|
lastName = json['LastName'];
|
||||||
|
firstNameN = json['FirstNameN'];
|
||||||
|
middleNameN = json['MiddleNameN'];
|
||||||
|
lastNameN = json['LastNameN'];
|
||||||
|
gender = json['Gender'];
|
||||||
|
dateofBirth = json['DateofBirth'];
|
||||||
|
companionFirstName = json['CompanionFirstName'];
|
||||||
|
companionMiddleName = json['CompanionMiddleName'];
|
||||||
|
companionLastName = json['CompanionLastName'];
|
||||||
|
companionFirstNameN = json['CompanionFirstNameN'];
|
||||||
|
companionMiddleNameN = json['CompanionMiddleNameN'];
|
||||||
|
companionLastNameN = json['CompanionLastNameN'];
|
||||||
|
companionID = json['CompanionID'];
|
||||||
|
companionGender = json['CompanionGender'];
|
||||||
|
isHasCompanion = json['IsHasCompanion'];
|
||||||
|
buildingID = json['BuildingID'];
|
||||||
|
floorID = json['FloorID'];
|
||||||
|
nursingStationID = json['NursingStationID'];
|
||||||
|
dietType = json['DietType'];
|
||||||
|
dietTypeDateCahnged = json['DietTypeDateCahnged'];
|
||||||
|
dietTypeDescription = json['DietTypeDescription'];
|
||||||
|
dietTypeDescriptionN = json['DietTypeDescriptionN'];
|
||||||
|
allergyDiseaseDateCahnged = json['AllergyDiseaseDateCahnged'];
|
||||||
|
allergyDiseaseChecked = json['AllergyDiseaseChecked'];
|
||||||
|
doctorRemarks = json['DoctorRemarks'];
|
||||||
|
allergyRemarks = json['AllergyRemarks'];
|
||||||
|
age = json['Age'];
|
||||||
|
allergies = json['Allergies'];
|
||||||
|
companionFullName = json['CompanionFullName'];
|
||||||
|
dietTypeChanged = json['DietTypeChanged'];
|
||||||
|
dietTypeDateCahngedDate = json['DietTypeDateCahnged_Date'];
|
||||||
|
genderDescription = json['GenderDescription'];
|
||||||
|
genderImageUrl = json['GenderImageUrl'];
|
||||||
|
hasAllergy = json['HasAllergy'];
|
||||||
|
isNewAdmitted = json['IsNewAdmitted'];
|
||||||
|
patientFullName = json['PatientFullName'];
|
||||||
|
allergyRemark = json['allergyRemark'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['SetupID'] = this.setupID;
|
||||||
|
data['ProjectID'] = this.projectID;
|
||||||
|
data['AdmissionNo'] = this.admissionNo;
|
||||||
|
data['AdmissionDate'] = this.admissionDate;
|
||||||
|
data['PatientType'] = this.patientType;
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['ClinicID'] = this.clinicID;
|
||||||
|
data['DoctorID'] = this.doctorID;
|
||||||
|
data['RoomID'] = this.roomID;
|
||||||
|
data['BedID'] = this.bedID;
|
||||||
|
data['Status'] = this.status;
|
||||||
|
data['AdmissionStatus'] = this.admissionStatus;
|
||||||
|
data['CreatedOn'] = this.createdOn;
|
||||||
|
data['FirstName'] = this.firstName;
|
||||||
|
data['MiddleName'] = this.middleName;
|
||||||
|
data['LastName'] = this.lastName;
|
||||||
|
data['FirstNameN'] = this.firstNameN;
|
||||||
|
data['MiddleNameN'] = this.middleNameN;
|
||||||
|
data['LastNameN'] = this.lastNameN;
|
||||||
|
data['Gender'] = this.gender;
|
||||||
|
data['DateofBirth'] = this.dateofBirth;
|
||||||
|
data['CompanionFirstName'] = this.companionFirstName;
|
||||||
|
data['CompanionMiddleName'] = this.companionMiddleName;
|
||||||
|
data['CompanionLastName'] = this.companionLastName;
|
||||||
|
data['CompanionFirstNameN'] = this.companionFirstNameN;
|
||||||
|
data['CompanionMiddleNameN'] = this.companionMiddleNameN;
|
||||||
|
data['CompanionLastNameN'] = this.companionLastNameN;
|
||||||
|
data['CompanionID'] = this.companionID;
|
||||||
|
data['CompanionGender'] = this.companionGender;
|
||||||
|
data['IsHasCompanion'] = this.isHasCompanion;
|
||||||
|
data['BuildingID'] = this.buildingID;
|
||||||
|
data['FloorID'] = this.floorID;
|
||||||
|
data['NursingStationID'] = this.nursingStationID;
|
||||||
|
data['DietType'] = this.dietType;
|
||||||
|
data['DietTypeDateCahnged'] = this.dietTypeDateCahnged;
|
||||||
|
data['DietTypeDescription'] = this.dietTypeDescription;
|
||||||
|
data['DietTypeDescriptionN'] = this.dietTypeDescriptionN;
|
||||||
|
data['AllergyDiseaseDateCahnged'] = this.allergyDiseaseDateCahnged;
|
||||||
|
data['AllergyDiseaseChecked'] = this.allergyDiseaseChecked;
|
||||||
|
data['DoctorRemarks'] = this.doctorRemarks;
|
||||||
|
data['AllergyRemarks'] = this.allergyRemarks;
|
||||||
|
data['Age'] = this.age;
|
||||||
|
data['Allergies'] = this.allergies;
|
||||||
|
data['CompanionFullName'] = this.companionFullName;
|
||||||
|
data['DietTypeChanged'] = this.dietTypeChanged;
|
||||||
|
data['DietTypeDateCahnged_Date'] = this.dietTypeDateCahngedDate;
|
||||||
|
data['GenderDescription'] = this.genderDescription;
|
||||||
|
data['GenderImageUrl'] = this.genderImageUrl;
|
||||||
|
data['HasAllergy'] = this.hasAllergy;
|
||||||
|
data['IsNewAdmitted'] = this.isNewAdmitted;
|
||||||
|
data['PatientFullName'] = this.patientFullName;
|
||||||
|
data['allergyRemark'] = this.allergyRemark;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
class GetGeneralInstructions {
|
||||||
|
int rowID;
|
||||||
|
int iD;
|
||||||
|
int projectID;
|
||||||
|
String text;
|
||||||
|
String textN;
|
||||||
|
bool isActive;
|
||||||
|
int createdBy;
|
||||||
|
String createdOn;
|
||||||
|
dynamic editedBy;
|
||||||
|
dynamic editedOn;
|
||||||
|
|
||||||
|
GetGeneralInstructions(
|
||||||
|
{this.rowID,
|
||||||
|
this.iD,
|
||||||
|
this.projectID,
|
||||||
|
this.text,
|
||||||
|
this.textN,
|
||||||
|
this.isActive,
|
||||||
|
this.createdBy,
|
||||||
|
this.createdOn,
|
||||||
|
this.editedBy,
|
||||||
|
this.editedOn});
|
||||||
|
|
||||||
|
GetGeneralInstructions.fromJson(Map<String, dynamic> json) {
|
||||||
|
rowID = json['RowID'];
|
||||||
|
iD = json['ID'];
|
||||||
|
projectID = json['ProjectID'];
|
||||||
|
text = json['Text'];
|
||||||
|
textN = json['TextN'];
|
||||||
|
isActive = json['IsActive'];
|
||||||
|
createdBy = json['CreatedBy'];
|
||||||
|
createdOn = json['CreatedOn'];
|
||||||
|
editedBy = json['EditedBy'];
|
||||||
|
editedOn = json['EditedOn'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['RowID'] = this.rowID;
|
||||||
|
data['ID'] = this.iD;
|
||||||
|
data['ProjectID'] = this.projectID;
|
||||||
|
data['Text'] = this.text;
|
||||||
|
data['TextN'] = this.textN;
|
||||||
|
data['IsActive'] = this.isActive;
|
||||||
|
data['CreatedBy'] = this.createdBy;
|
||||||
|
data['CreatedOn'] = this.createdOn;
|
||||||
|
data['EditedBy'] = this.editedBy;
|
||||||
|
data['EditedOn'] = this.editedOn;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,71 @@
|
|||||||
|
class InPatientAdvanceHistoryResponseModel {
|
||||||
|
int advanceNumber;
|
||||||
|
int errorCode;
|
||||||
|
String message;
|
||||||
|
List<ResponseInpatientAdvanceInfo> responseInpatientAdvanceInfo;
|
||||||
|
int statusCode;
|
||||||
|
|
||||||
|
InPatientAdvanceHistoryResponseModel({this.advanceNumber, this.errorCode, this.message, this.responseInpatientAdvanceInfo, this.statusCode});
|
||||||
|
|
||||||
|
InPatientAdvanceHistoryResponseModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
advanceNumber = json['advanceNumber'];
|
||||||
|
errorCode = json['errorCode'];
|
||||||
|
message = json['message'];
|
||||||
|
if (json['responseInpatientAdvanceInfo'] != null) {
|
||||||
|
responseInpatientAdvanceInfo = <ResponseInpatientAdvanceInfo>[];
|
||||||
|
json['responseInpatientAdvanceInfo'].forEach((v) {
|
||||||
|
responseInpatientAdvanceInfo.add(new ResponseInpatientAdvanceInfo.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
statusCode = json['statusCode'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['advanceNumber'] = this.advanceNumber;
|
||||||
|
data['errorCode'] = this.errorCode;
|
||||||
|
data['message'] = this.message;
|
||||||
|
if (this.responseInpatientAdvanceInfo != null) {
|
||||||
|
data['responseInpatientAdvanceInfo'] = this.responseInpatientAdvanceInfo.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['statusCode'] = this.statusCode;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ResponseInpatientAdvanceInfo {
|
||||||
|
int admissionNo;
|
||||||
|
int admissionReqNo;
|
||||||
|
String createdOn;
|
||||||
|
int patientId;
|
||||||
|
int projectId;
|
||||||
|
num requestedAmount;
|
||||||
|
String setupId;
|
||||||
|
int status;
|
||||||
|
|
||||||
|
ResponseInpatientAdvanceInfo({this.admissionNo, this.admissionReqNo, this.createdOn, this.patientId, this.projectId, this.requestedAmount, this.setupId, this.status});
|
||||||
|
|
||||||
|
ResponseInpatientAdvanceInfo.fromJson(Map<String, dynamic> json) {
|
||||||
|
admissionNo = json['admissionNo'];
|
||||||
|
admissionReqNo = json['admissionReqNo'];
|
||||||
|
createdOn = json['createdOn'];
|
||||||
|
patientId = json['patientId'];
|
||||||
|
projectId = json['projectId'];
|
||||||
|
requestedAmount = json['requestedAmount'];
|
||||||
|
setupId = json['setupId'];
|
||||||
|
status = json['status'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['admissionNo'] = this.admissionNo;
|
||||||
|
data['admissionReqNo'] = this.admissionReqNo;
|
||||||
|
data['createdOn'] = this.createdOn;
|
||||||
|
data['patientId'] = this.patientId;
|
||||||
|
data['projectId'] = this.projectId;
|
||||||
|
data['requestedAmount'] = this.requestedAmount;
|
||||||
|
data['setupId'] = this.setupId;
|
||||||
|
data['status'] = this.status;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,74 @@
|
|||||||
|
class InPatientAdvanceResponseModel {
|
||||||
|
int advanceNumber;
|
||||||
|
Null errorCode;
|
||||||
|
String message;
|
||||||
|
List<ResponseInpatientAdvanceInfo> responseInpatientAdvanceInfo;
|
||||||
|
int statusCode;
|
||||||
|
|
||||||
|
InPatientAdvanceResponseModel({this.advanceNumber, this.errorCode, this.message, this.responseInpatientAdvanceInfo, this.statusCode});
|
||||||
|
|
||||||
|
InPatientAdvanceResponseModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
advanceNumber = json['advanceNumber'];
|
||||||
|
errorCode = json['errorCode'];
|
||||||
|
message = json['message'];
|
||||||
|
if (json['responseInpatientAdvanceInfo'] != null) {
|
||||||
|
responseInpatientAdvanceInfo = <ResponseInpatientAdvanceInfo>[];
|
||||||
|
json['responseInpatientAdvanceInfo'].forEach((v) {
|
||||||
|
responseInpatientAdvanceInfo.add(new ResponseInpatientAdvanceInfo.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
statusCode = json['statusCode'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['advanceNumber'] = this.advanceNumber;
|
||||||
|
data['errorCode'] = this.errorCode;
|
||||||
|
data['message'] = this.message;
|
||||||
|
if (this.responseInpatientAdvanceInfo != null) {
|
||||||
|
data['responseInpatientAdvanceInfo'] = this.responseInpatientAdvanceInfo.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['statusCode'] = this.statusCode;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ResponseInpatientAdvanceInfo {
|
||||||
|
int admissionNo;
|
||||||
|
int admissionReqNo;
|
||||||
|
String createdOn;
|
||||||
|
int patientId;
|
||||||
|
int projectId;
|
||||||
|
num requestedAmount;
|
||||||
|
String setupId;
|
||||||
|
int status;
|
||||||
|
int paymentRequestID;
|
||||||
|
|
||||||
|
ResponseInpatientAdvanceInfo({this.admissionNo, this.admissionReqNo, this.createdOn, this.patientId, this.projectId, this.requestedAmount, this.setupId, this.status, this.paymentRequestID});
|
||||||
|
|
||||||
|
ResponseInpatientAdvanceInfo.fromJson(Map<String, dynamic> json) {
|
||||||
|
admissionNo = json['admissionNo'];
|
||||||
|
admissionReqNo = json['admissionReqNo'];
|
||||||
|
createdOn = json['createdOn'];
|
||||||
|
patientId = json['patientId'];
|
||||||
|
projectId = json['projectId'];
|
||||||
|
requestedAmount = json['requestedAmount'];
|
||||||
|
setupId = json['setupId'];
|
||||||
|
status = json['status'];
|
||||||
|
paymentRequestID = json['PaymentRequestId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['admissionNo'] = this.admissionNo;
|
||||||
|
data['admissionReqNo'] = this.admissionReqNo;
|
||||||
|
data['createdOn'] = this.createdOn;
|
||||||
|
data['patientId'] = this.patientId;
|
||||||
|
data['projectId'] = this.projectId;
|
||||||
|
data['requestedAmount'] = this.requestedAmount;
|
||||||
|
data['setupId'] = this.setupId;
|
||||||
|
data['status'] = this.status;
|
||||||
|
data['PaymentRequestId'] = this.paymentRequestID;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,74 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class GetMealItemsScheduleResponseModel {
|
||||||
|
int itemID;
|
||||||
|
String description;
|
||||||
|
String descriptionN;
|
||||||
|
dynamic comment;
|
||||||
|
dynamic commentN;
|
||||||
|
String imageURL;
|
||||||
|
bool isDefault;
|
||||||
|
int categoryID;
|
||||||
|
String categoryDescription;
|
||||||
|
String categoryDescriptionN;
|
||||||
|
int scheduleID;
|
||||||
|
int cal;
|
||||||
|
|
||||||
|
GetMealItemsScheduleResponseModel(
|
||||||
|
{this.itemID,
|
||||||
|
this.description,
|
||||||
|
this.descriptionN,
|
||||||
|
this.comment,
|
||||||
|
this.commentN,
|
||||||
|
this.imageURL,
|
||||||
|
this.isDefault,
|
||||||
|
this.categoryID,
|
||||||
|
this.categoryDescription,
|
||||||
|
this.categoryDescriptionN,
|
||||||
|
this.scheduleID,
|
||||||
|
this.cal});
|
||||||
|
|
||||||
|
GetMealItemsScheduleResponseModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
itemID = json['ItemID'];
|
||||||
|
description = json['Description'];
|
||||||
|
descriptionN = json['DescriptionN'];
|
||||||
|
comment = json['Comment'];
|
||||||
|
commentN = json['CommentN'];
|
||||||
|
imageURL = json['ImageURL'];
|
||||||
|
isDefault = json['IsDefault'];
|
||||||
|
categoryID = json['CategoryID'];
|
||||||
|
categoryDescription = json['CategoryDescription'];
|
||||||
|
categoryDescriptionN = json['CategoryDescriptionN'];
|
||||||
|
scheduleID = json['ScheduleID'];
|
||||||
|
cal = json['cal'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['ItemID'] = this.itemID;
|
||||||
|
data['Description'] = this.description;
|
||||||
|
data['DescriptionN'] = this.descriptionN;
|
||||||
|
data['Comment'] = this.comment;
|
||||||
|
data['CommentN'] = this.commentN;
|
||||||
|
data['ImageURL'] = this.imageURL;
|
||||||
|
data['IsDefault'] = this.isDefault;
|
||||||
|
data['CategoryID'] = this.categoryID;
|
||||||
|
data['CategoryDescription'] = this.categoryDescription;
|
||||||
|
data['CategoryDescriptionN'] = this.categoryDescriptionN;
|
||||||
|
data['ScheduleID'] = this.scheduleID;
|
||||||
|
data['cal'] = this.cal;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class GetMealItemsScheduleResponseModelList {
|
||||||
|
String filterName = "";
|
||||||
|
List<GetMealItemsScheduleResponseModel> getMealItemsScheduleResponseModelList = [];
|
||||||
|
|
||||||
|
// int selectedItemID = 0;
|
||||||
|
final ValueNotifier<int> selectedItemID = ValueNotifier(0);
|
||||||
|
|
||||||
|
GetMealItemsScheduleResponseModelList({this.filterName, GetMealItemsScheduleResponseModel getMealItemsScheduleResponseModel}) {
|
||||||
|
getMealItemsScheduleResponseModelList.add(getMealItemsScheduleResponseModel);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,60 @@
|
|||||||
|
class GetMealsScheduleResponseModel {
|
||||||
|
int scheduleID;
|
||||||
|
int mealID;
|
||||||
|
String description;
|
||||||
|
String descriptionN;
|
||||||
|
int weekID;
|
||||||
|
String weekDescription;
|
||||||
|
String weekDescriptionN;
|
||||||
|
String tAT;
|
||||||
|
int dietTypeID;
|
||||||
|
int dayID;
|
||||||
|
bool isShow;
|
||||||
|
String tATTime;
|
||||||
|
|
||||||
|
GetMealsScheduleResponseModel(
|
||||||
|
{this.scheduleID,
|
||||||
|
this.mealID,
|
||||||
|
this.description,
|
||||||
|
this.descriptionN,
|
||||||
|
this.weekID,
|
||||||
|
this.weekDescription,
|
||||||
|
this.weekDescriptionN,
|
||||||
|
this.tAT,
|
||||||
|
this.dietTypeID,
|
||||||
|
this.dayID,
|
||||||
|
this.isShow,
|
||||||
|
this.tATTime});
|
||||||
|
|
||||||
|
GetMealsScheduleResponseModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
scheduleID = json['ScheduleID'];
|
||||||
|
mealID = json['MealID'];
|
||||||
|
description = json['Description'];
|
||||||
|
descriptionN = json['DescriptionN'];
|
||||||
|
weekID = json['WeekID'];
|
||||||
|
weekDescription = json['WeekDescription'];
|
||||||
|
weekDescriptionN = json['WeekDescriptionN'];
|
||||||
|
tAT = json['TAT'];
|
||||||
|
dietTypeID = json['DietTypeID'];
|
||||||
|
dayID = json['DayID'];
|
||||||
|
isShow = json['IsShow'];
|
||||||
|
tATTime = json['TATTime'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['ScheduleID'] = this.scheduleID;
|
||||||
|
data['MealID'] = this.mealID;
|
||||||
|
data['Description'] = this.description;
|
||||||
|
data['DescriptionN'] = this.descriptionN;
|
||||||
|
data['WeekID'] = this.weekID;
|
||||||
|
data['WeekDescription'] = this.weekDescription;
|
||||||
|
data['WeekDescriptionN'] = this.weekDescriptionN;
|
||||||
|
data['TAT'] = this.tAT;
|
||||||
|
data['DietTypeID'] = this.dietTypeID;
|
||||||
|
data['DayID'] = this.dayID;
|
||||||
|
data['IsShow'] = this.isShow;
|
||||||
|
data['TATTime'] = this.tATTime;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,85 @@
|
|||||||
|
class GetMedicalInstructions {
|
||||||
|
dynamic propertyChanged;
|
||||||
|
int admissionRequestNoField;
|
||||||
|
String clinicNameField;
|
||||||
|
String doctorNameField;
|
||||||
|
String expectedAdmissionDateField;
|
||||||
|
List<MedicaLInstructionsField> medicaLInstructionsField;
|
||||||
|
dynamic medicalInstructionsXMLField;
|
||||||
|
String medicalRemarksField;
|
||||||
|
int projectIdField;
|
||||||
|
String projectNameField;
|
||||||
|
String setupIdField;
|
||||||
|
|
||||||
|
GetMedicalInstructions(
|
||||||
|
{this.propertyChanged,
|
||||||
|
this.admissionRequestNoField,
|
||||||
|
this.clinicNameField,
|
||||||
|
this.doctorNameField,
|
||||||
|
this.expectedAdmissionDateField,
|
||||||
|
this.medicaLInstructionsField,
|
||||||
|
this.medicalInstructionsXMLField,
|
||||||
|
this.medicalRemarksField,
|
||||||
|
this.projectIdField,
|
||||||
|
this.projectNameField,
|
||||||
|
this.setupIdField});
|
||||||
|
|
||||||
|
GetMedicalInstructions.fromJson(Map<String, dynamic> json) {
|
||||||
|
propertyChanged = json['PropertyChanged'];
|
||||||
|
admissionRequestNoField = json['admissionRequestNoField'];
|
||||||
|
clinicNameField = json['clinicNameField'];
|
||||||
|
doctorNameField = json['doctorNameField'];
|
||||||
|
expectedAdmissionDateField = json['expectedAdmissionDateField'];
|
||||||
|
if (json['medicaLInstructions'] != null) {
|
||||||
|
medicaLInstructionsField = <MedicaLInstructionsField>[];
|
||||||
|
json['medicaLInstructions'].forEach((v) {
|
||||||
|
medicaLInstructionsField.add(new MedicaLInstructionsField.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
medicalInstructionsXMLField = json['medicalInstructionsXMLField'];
|
||||||
|
medicalRemarksField = json['medicalRemarksField'];
|
||||||
|
projectIdField = json['projectIdField'];
|
||||||
|
projectNameField = json['projectNameField'];
|
||||||
|
setupIdField = json['setupIdField'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['PropertyChanged'] = this.propertyChanged;
|
||||||
|
data['admissionRequestNoField'] = this.admissionRequestNoField;
|
||||||
|
data['clinicNameField'] = this.clinicNameField;
|
||||||
|
data['doctorNameField'] = this.doctorNameField;
|
||||||
|
data['expectedAdmissionDateField'] = this.expectedAdmissionDateField;
|
||||||
|
if (this.medicaLInstructionsField != null) {
|
||||||
|
data['medicaLInstructionsField'] = this.medicaLInstructionsField.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['medicalInstructionsXMLField'] = this.medicalInstructionsXMLField;
|
||||||
|
data['medicalRemarksField'] = this.medicalRemarksField;
|
||||||
|
data['projectIdField'] = this.projectIdField;
|
||||||
|
data['projectNameField'] = this.projectNameField;
|
||||||
|
data['setupIdField'] = this.setupIdField;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class MedicaLInstructionsField {
|
||||||
|
Null propertyChanged;
|
||||||
|
String descriptionField;
|
||||||
|
int parameterCodeField;
|
||||||
|
|
||||||
|
MedicaLInstructionsField({this.propertyChanged, this.descriptionField, this.parameterCodeField});
|
||||||
|
|
||||||
|
MedicaLInstructionsField.fromJson(Map<String, dynamic> json) {
|
||||||
|
propertyChanged = json['PropertyChanged'];
|
||||||
|
descriptionField = json['description'];
|
||||||
|
parameterCodeField = json['parameterCodeField'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['PropertyChanged'] = this.propertyChanged;
|
||||||
|
data['descriptionField'] = this.descriptionField;
|
||||||
|
data['parameterCodeField'] = this.parameterCodeField;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,305 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/insurance/AttachInsuranceCardImageDialog.dart';
|
||||||
|
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
|
||||||
|
import 'package:diplomaticquarterapp/theme/colors.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class BirthNotification extends StatefulWidget {
|
||||||
|
const BirthNotification({Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<BirthNotification> createState() => _BirthNotificationState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _BirthNotificationState extends State<BirthNotification> {
|
||||||
|
TextEditingController motherMRN = new TextEditingController();
|
||||||
|
TextEditingController motherName = new TextEditingController();
|
||||||
|
TextEditingController fatherName = new TextEditingController();
|
||||||
|
TextEditingController fatherNameAR = new TextEditingController();
|
||||||
|
TextEditingController babyName = new TextEditingController();
|
||||||
|
TextEditingController babyNameAR = new TextEditingController();
|
||||||
|
TextEditingController contactNumber = new TextEditingController();
|
||||||
|
|
||||||
|
ProjectViewModel projectViewModel;
|
||||||
|
|
||||||
|
List<String> images = [];
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
projectViewModel = Provider.of(context);
|
||||||
|
motherMRN.text = projectViewModel.user.patientID.toString();
|
||||||
|
motherName.text = projectViewModel.user.firstName + " " + projectViewModel.user.lastName;
|
||||||
|
contactNumber.text = projectViewModel.user.mobileNumber;
|
||||||
|
return AppScaffold(
|
||||||
|
isShowAppBar: true,
|
||||||
|
isShowDecPage: false,
|
||||||
|
showNewAppBarTitle: true,
|
||||||
|
showNewAppBar: true,
|
||||||
|
appBarTitle: TranslationBase.of(context).birthNotificationTitle + " " + TranslationBase.of(context).birthNotificationSubTitle,
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: Container(
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
decoration: containerRadius(Colors.white, 12),
|
||||||
|
margin: EdgeInsets.all(21.0),
|
||||||
|
padding: const EdgeInsets.all(21.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
TranslationBase.of(context).enterDetailBelow + " :",
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16.0,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Color(0xff2B353E),
|
||||||
|
letterSpacing: -0.64,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
mHeight(16),
|
||||||
|
inputWidget(TranslationBase.of(context).mothersMRN, "", motherMRN, isEnable: false),
|
||||||
|
mHeight(16),
|
||||||
|
inputWidget(TranslationBase.of(context).mothersName, "", motherName, isEnable: false),
|
||||||
|
mHeight(16),
|
||||||
|
inputWidget(TranslationBase.of(context).fathersNameEN, "", fatherName),
|
||||||
|
mHeight(16),
|
||||||
|
inputWidget(TranslationBase.of(context).fathersNameAR, "", fatherNameAR),
|
||||||
|
mHeight(16),
|
||||||
|
inputWidget(TranslationBase.of(context).babysNameEN, "", babyName),
|
||||||
|
mHeight(16),
|
||||||
|
inputWidget(TranslationBase.of(context).babysNameAR, "", babyNameAR),
|
||||||
|
mHeight(16),
|
||||||
|
inputWidget(TranslationBase.of(context).contactNumber, "", contactNumber),
|
||||||
|
mHeight(16),
|
||||||
|
DefaultButton(
|
||||||
|
TranslationBase.of(context).scanID,
|
||||||
|
() {
|
||||||
|
confirmAttachInsuranceCardImageDialogDialog(
|
||||||
|
context: context, name: projectViewModel.user.firstName + " " + projectViewModel.user.lastName, fileNo: projectViewModel.user.patientID.toString());
|
||||||
|
},
|
||||||
|
color: CustomColors.accentColor,
|
||||||
|
disabledColor: CustomColors.grey2,
|
||||||
|
),
|
||||||
|
if (images.isNotEmpty) mHeight(16),
|
||||||
|
if (images.isNotEmpty)
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 16.0, bottom: 16.0),
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: <Widget>[
|
||||||
|
Image.memory(
|
||||||
|
base64Decode(images[0]),
|
||||||
|
width: 80.0,
|
||||||
|
height: 80.0,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"image 1.png",
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Color(0xff2B353E),
|
||||||
|
letterSpacing: -0.64,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
images.clear();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Icon(
|
||||||
|
Icons.delete_sharp,
|
||||||
|
color: Colors.red[300],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
mHeight(16),
|
||||||
|
Text(
|
||||||
|
"● " + TranslationBase.of(context).birthNotificationNotes1,
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Color(0xff2B353E),
|
||||||
|
letterSpacing: -0.64,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
mHeight(16),
|
||||||
|
Text(
|
||||||
|
"● " + TranslationBase.of(context).birthNotificationNotes2,
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Color(0xff2B353E),
|
||||||
|
letterSpacing: -0.64,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
mHeight(16),
|
||||||
|
Text(
|
||||||
|
"● " + TranslationBase.of(context).birthNotificationNotes3,
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Color(0xff2B353E),
|
||||||
|
letterSpacing: -0.64,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
mHeight(100.0),
|
||||||
|
// DefaultButton(
|
||||||
|
// TranslationBase.of(context).submit,
|
||||||
|
// (fatherNameAR.text.isEmpty || fatherName.text.isEmpty || babyNameAR.text.isEmpty || babyName.text.isEmpty) ? null : () {
|
||||||
|
// submitBirthNotification();
|
||||||
|
// },
|
||||||
|
// color: CustomColors.accentColor,
|
||||||
|
// disabledColor: CustomColors.grey2,
|
||||||
|
// ),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
bottomSheet: Container(
|
||||||
|
color: Colors.white,
|
||||||
|
width: double.infinity,
|
||||||
|
padding: EdgeInsets.all(20),
|
||||||
|
child: DefaultButton(
|
||||||
|
TranslationBase.of(context).submit,
|
||||||
|
(fatherNameAR.text.isEmpty || fatherName.text.isEmpty || babyNameAR.text.isEmpty || babyName.text.isEmpty || images.isEmpty)
|
||||||
|
? null
|
||||||
|
: () {
|
||||||
|
submitBirthNotification();
|
||||||
|
},
|
||||||
|
color: CustomColors.accentColor,
|
||||||
|
disabledColor: CustomColors.grey2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void submitBirthNotification() {
|
||||||
|
ClinicListService service = new ClinicListService();
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
service
|
||||||
|
.submitBirthNotification(
|
||||||
|
projectViewModel.user.patientID, projectViewModel.inPatientProjectID, fatherNameAR.text, fatherName.text, babyNameAR.text, babyName.text, contactNumber.text, images[0], context)
|
||||||
|
.then((res) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
}).catchError((err) {
|
||||||
|
print(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void confirmAttachInsuranceCardImageDialogDialog({BuildContext context, String name, String fileNo}) {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (cxt) => AttachInsuranceCardImageDialog(
|
||||||
|
fileNo: fileNo,
|
||||||
|
name: name,
|
||||||
|
image: (file, image) async {
|
||||||
|
images.clear();
|
||||||
|
images.add(image);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
isBirthNotification: true,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
|
||||||
|
return Container(
|
||||||
|
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
color: Colors.white,
|
||||||
|
border: Border.all(
|
||||||
|
color: Color(0xffefefef),
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: hasSelection ? () {} : null,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
_labelText,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 11,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Color(0xff2B353E),
|
||||||
|
letterSpacing: -0.44,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextField(
|
||||||
|
enabled: isEnable,
|
||||||
|
scrollPadding: EdgeInsets.zero,
|
||||||
|
keyboardType: TextInputType.name,
|
||||||
|
controller: _controller,
|
||||||
|
onChanged: (value) => {},
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
height: 21 / 14,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: Color(0xff2B353E),
|
||||||
|
letterSpacing: -0.44,
|
||||||
|
),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
isDense: true,
|
||||||
|
hintText: _hintText,
|
||||||
|
hintStyle: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
height: 21 / 14,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: Color(0xff575757),
|
||||||
|
letterSpacing: -0.56,
|
||||||
|
),
|
||||||
|
prefixIconConstraints: BoxConstraints(minWidth: 50),
|
||||||
|
prefixIcon: prefix == null
|
||||||
|
? null
|
||||||
|
: Text(
|
||||||
|
"+" + prefix,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
height: 21 / 14,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Color(0xff2E303A),
|
||||||
|
letterSpacing: -0.56,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
contentPadding: EdgeInsets.zero,
|
||||||
|
border: InputBorder.none,
|
||||||
|
focusedBorder: InputBorder.none,
|
||||||
|
enabledBorder: InputBorder.none,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/InPatientServices/get_inpatient_advance_history_response_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
|
||||||
|
import 'package:diplomaticquarterapp/theme/colors.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/my_rich_text.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class InPatientPaidAdvancePayment extends StatefulWidget {
|
||||||
|
const InPatientPaidAdvancePayment({Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<InPatientPaidAdvancePayment> createState() => _InPatientPaidAdvancePaymentState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _InPatientPaidAdvancePaymentState extends State<InPatientPaidAdvancePayment> {
|
||||||
|
ProjectViewModel projectViewModel;
|
||||||
|
InPatientAdvanceHistoryResponseModel inPatientAdvanceHistoryResponseModel;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
|
getInPatientAdvancePaymentHistory();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
projectViewModel = Provider.of(context);
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
child: inPatientAdvanceHistoryResponseModel != null && inPatientAdvanceHistoryResponseModel.responseInpatientAdvanceInfo != null
|
||||||
|
? ListView.separated(
|
||||||
|
itemCount: inPatientAdvanceHistoryResponseModel.responseInpatientAdvanceInfo.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return Container(
|
||||||
|
decoration: cardRadius(12),
|
||||||
|
padding: EdgeInsets.all(12),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
MyRichText(
|
||||||
|
TranslationBase.of(context).admissionNo + ": ", inPatientAdvanceHistoryResponseModel.responseInpatientAdvanceInfo[index].admissionNo.toString(), projectViewModel.isArabic),
|
||||||
|
MyRichText(TranslationBase.of(context).admissionReqNo + ": ", inPatientAdvanceHistoryResponseModel.responseInpatientAdvanceInfo[index].admissionReqNo.toString(),
|
||||||
|
projectViewModel.isArabic),
|
||||||
|
MyRichText(
|
||||||
|
TranslationBase.of(context).date + ": ",
|
||||||
|
DateUtil.formatDateToDate(DateUtil.convertStringToDate(inPatientAdvanceHistoryResponseModel.responseInpatientAdvanceInfo[index].createdOn), false),
|
||||||
|
projectViewModel.isArabic),
|
||||||
|
MyRichText(
|
||||||
|
TranslationBase.of(context).amount_ + ": ", inPatientAdvanceHistoryResponseModel.responseInpatientAdvanceInfo[index].requestedAmount.toString(), projectViewModel.isArabic),
|
||||||
|
MyRichText(TranslationBase.of(context).status + ": ", getStatus(inPatientAdvanceHistoryResponseModel.responseInpatientAdvanceInfo[index]), projectViewModel.isArabic),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
|
return SizedBox(
|
||||||
|
height: 12.0,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
: getNoDataWidget(context),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String getStatus(ResponseInpatientAdvanceInfo responseInpatientAdvanceInfo) {
|
||||||
|
switch (responseInpatientAdvanceInfo.status) {
|
||||||
|
case 1:
|
||||||
|
return "Hold";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
return "Active";
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
return "Cancelled";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void getInPatientAdvancePaymentHistory() {
|
||||||
|
ClinicListService service = new ClinicListService();
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
service
|
||||||
|
.getInPatientAdvancePaymentHistory(projectViewModel.inPatientProjectID, projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.admissionNo : 0,
|
||||||
|
projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.admissionRequestNo : projectViewModel.getAdmissionRequestInfoResponseModel.admissionRequestNo, context)
|
||||||
|
.then((res) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
inPatientAdvanceHistoryResponseModel = InPatientAdvanceHistoryResponseModel.fromJson(res["responseInpatient"]);
|
||||||
|
setState(() {});
|
||||||
|
}).catchError((err) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
print(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,285 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/InPatientServices/get_inpatient_advance_requests_response_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
|
||||||
|
import 'package:diplomaticquarterapp/theme/colors.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:share_plus/share_plus.dart';
|
||||||
|
|
||||||
|
class InPatientPendingAdvancePayment extends StatefulWidget {
|
||||||
|
InPatientAdvanceResponseModel inPatientAdvanceResponseModel;
|
||||||
|
bool isHasData;
|
||||||
|
|
||||||
|
InPatientPendingAdvancePayment({this.isHasData, this.inPatientAdvanceResponseModel});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<InPatientPendingAdvancePayment> createState() => _InPatientPendingAdvancePaymentState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _InPatientPendingAdvancePaymentState extends State<InPatientPendingAdvancePayment> {
|
||||||
|
ProjectViewModel projectViewModel;
|
||||||
|
InAppBrowser browser = new InAppBrowser();
|
||||||
|
|
||||||
|
var _InAppBrowserOptions = InAppBrowserClassOptions(
|
||||||
|
inAppWebViewGroupOptions: InAppWebViewGroupOptions(
|
||||||
|
crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true, transparentBackground: false),
|
||||||
|
ios: IOSInAppWebViewOptions(applePayAPIEnabled: true, isFraudulentWebsiteWarningEnabled: false)),
|
||||||
|
crossPlatform: InAppBrowserOptions(hideUrlBar: true, toolbarTopBackgroundColor: Colors.black),
|
||||||
|
android: AndroidInAppBrowserOptions(),
|
||||||
|
ios:
|
||||||
|
IOSInAppBrowserOptions(hideToolbarBottom: true, toolbarBottomBackgroundColor: Colors.white, closeButtonColor: Colors.white, presentationStyle: IOSUIModalPresentationStyle.OVER_FULL_SCREEN));
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
// browser = new InAppBrowser(onLoadStartCallback: onBrowserLoadStart);
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
projectViewModel = Provider.of(context);
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: double.infinity,
|
||||||
|
child: Container(
|
||||||
|
decoration: cardRadius(12),
|
||||||
|
margin: EdgeInsets.zero,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(12.0),
|
||||||
|
child: widget.isHasData && widget.inPatientAdvanceResponseModel.responseInpatientAdvanceInfo != null
|
||||||
|
? Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"Payment request for: ",
|
||||||
|
// TranslationBase.of(context).covidBookAppo,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 16,
|
||||||
|
letterSpacing: -0.64,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
mHeight(6),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
TranslationBase.of(context).patientName + ":",
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 10,
|
||||||
|
letterSpacing: -0.6,
|
||||||
|
color: CustomColors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
mWidth(3),
|
||||||
|
Text(
|
||||||
|
projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 12,
|
||||||
|
letterSpacing: -0.48,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
TranslationBase.of(context).identificationNumber + ":",
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 10,
|
||||||
|
letterSpacing: -0.6,
|
||||||
|
color: CustomColors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
mWidth(3),
|
||||||
|
Text(
|
||||||
|
projectViewModel.user.patientIdentificationNo,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 12,
|
||||||
|
letterSpacing: -0.48,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
TranslationBase.of(context).mrn + ":",
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 10,
|
||||||
|
letterSpacing: -0.6,
|
||||||
|
color: CustomColors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
mWidth(3),
|
||||||
|
Text(
|
||||||
|
projectViewModel.user.patientID.toString(),
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 12,
|
||||||
|
letterSpacing: -0.48,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
: getNoDataWidget(context),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
mHeight(12),
|
||||||
|
// Expanded(child: Container()),
|
||||||
|
widget.isHasData
|
||||||
|
? Container(
|
||||||
|
decoration: cardRadius(12.0),
|
||||||
|
margin: EdgeInsets.zero,
|
||||||
|
padding: EdgeInsets.all(12.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
TranslationBase.of(context).patientShareTotalToDo,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 16,
|
||||||
|
letterSpacing: -0.64,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
TranslationBase.of(context).sar + " ${widget.inPatientAdvanceResponseModel.responseInpatientAdvanceInfo[0].requestedAmount}",
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 24,
|
||||||
|
letterSpacing: -0.64,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: 12),
|
||||||
|
Text(
|
||||||
|
TranslationBase.of(context).YouCanPayByTheFollowingOptions,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Color(0xff2B353E),
|
||||||
|
letterSpacing: -0.64,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 12),
|
||||||
|
SizedBox(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.75,
|
||||||
|
child: getPaymentMethods(),
|
||||||
|
),
|
||||||
|
SizedBox(height: 12),
|
||||||
|
DefaultButton(
|
||||||
|
TranslationBase.of(context).payNow.toUpperCase(),
|
||||||
|
() {
|
||||||
|
getInPatientPaymentLink(false);
|
||||||
|
},
|
||||||
|
// : null,
|
||||||
|
color: CustomColors.green,
|
||||||
|
disabledColor: CustomColors.grey2,
|
||||||
|
),
|
||||||
|
SizedBox(height: 12),
|
||||||
|
Text(
|
||||||
|
TranslationBase.of(context).copyLinkTxt,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Color(0xff2B353E),
|
||||||
|
letterSpacing: -0.64,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 12),
|
||||||
|
DefaultButton(
|
||||||
|
TranslationBase.of(context).copyLink.toUpperCase(),
|
||||||
|
() {
|
||||||
|
getInPatientPaymentLink(true);
|
||||||
|
},
|
||||||
|
svgIcon: "assets/images/new/copy.svg",
|
||||||
|
color: CustomColors.accentColor,
|
||||||
|
disabledColor: CustomColors.grey2,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Container(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
onBrowserLoadStart(String url) {
|
||||||
|
MyInAppBrowser.successURLS.forEach((element) {
|
||||||
|
if (url.contains(element)) {
|
||||||
|
if (browser.isOpened()) browser.close();
|
||||||
|
MyInAppBrowser.isPaymentDone = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
MyInAppBrowser.errorURLS.forEach((element) {
|
||||||
|
if (url.contains(element)) {
|
||||||
|
if (browser.isOpened()) browser.close();
|
||||||
|
MyInAppBrowser.isPaymentDone = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void getInPatientPaymentLink(bool isCopy) {
|
||||||
|
ClinicListService service = new ClinicListService();
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
int orderID = num.parse(DateTime.now().microsecondsSinceEpoch.toString().substring(7, 15));
|
||||||
|
int clinicID = projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.clinicID : 17;
|
||||||
|
service
|
||||||
|
.getInPatientPaymentLink(
|
||||||
|
projectViewModel.inPatientProjectID,
|
||||||
|
projectViewModel.getAdmissionInfoResponseModel.admissionNo,
|
||||||
|
orderID,
|
||||||
|
projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
|
||||||
|
projectViewModel.user.emailAddress,
|
||||||
|
widget.inPatientAdvanceResponseModel.responseInpatientAdvanceInfo[0].requestedAmount,
|
||||||
|
projectViewModel.user.patientIdentificationNo,
|
||||||
|
clinicID,
|
||||||
|
widget.inPatientAdvanceResponseModel.responseInpatientAdvanceInfo[0].paymentRequestID,
|
||||||
|
context)
|
||||||
|
.then((res) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
if (res["MessageStatus"] == 1) {
|
||||||
|
String paymentLink = res["PaymentUrl"];
|
||||||
|
print(paymentLink);
|
||||||
|
if (isCopy) {
|
||||||
|
Share.share(paymentLink);
|
||||||
|
} else {
|
||||||
|
this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(paymentLink)), options: _InAppBrowserOptions);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
AppToast.showErrorToast(message: res["endUserMessage"]);
|
||||||
|
}
|
||||||
|
}).catchError((err) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
print(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,93 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/InPatientServices/get_general_instructions_response_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class GeneralInstructions extends StatelessWidget {
|
||||||
|
List<GetGeneralInstructions> getGeneralInstructionsList;
|
||||||
|
ProjectViewModel projectViewModel;
|
||||||
|
|
||||||
|
GeneralInstructions({@required this.getGeneralInstructionsList});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
projectViewModel = Provider.of(context);
|
||||||
|
return AppScaffold(
|
||||||
|
isShowAppBar: true,
|
||||||
|
isShowDecPage: false,
|
||||||
|
showNewAppBarTitle: true,
|
||||||
|
showNewAppBar: true,
|
||||||
|
appBarTitle: TranslationBase.of(context).InPatientServicesHeader,
|
||||||
|
body: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(21.0),
|
||||||
|
child: Text(TranslationBase.of(context).generalInstructions,
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 21.0,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Color(0xff2B353E),
|
||||||
|
letterSpacing: -0.64,
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
child: Card(
|
||||||
|
elevation: 0.0,
|
||||||
|
margin: EdgeInsets.only(left: 16.0, right: 16.0, bottom: 16.0),
|
||||||
|
color: Colors.white,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
side: BorderSide(color: Colors.transparent, width: 0.0),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(16.0),
|
||||||
|
child: Container(
|
||||||
|
child: ListView.separated(
|
||||||
|
itemCount: getGeneralInstructionsList.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return Container(
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
child: SvgPicture.asset("assets/images/new-design/ionic-ios-checkmark-circle.svg"),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.75,
|
||||||
|
margin: EdgeInsets.only(left: 5.0, right: 5.0),
|
||||||
|
child: Text(projectViewModel.isArabic ? getGeneralInstructionsList[index].textN : getGeneralInstructionsList[index].text,
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Color(0xff2B353E),
|
||||||
|
letterSpacing: -0.64,
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
));
|
||||||
|
},
|
||||||
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 14, right: 14),
|
||||||
|
child: mHeight(16.0),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,169 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class HelpPRO extends StatefulWidget {
|
||||||
|
const HelpPRO({Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<HelpPRO> createState() => _HelpPROState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _HelpPROState extends State<HelpPRO> {
|
||||||
|
TextEditingController assistText = new TextEditingController();
|
||||||
|
ProjectViewModel projectViewModel;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
projectViewModel = Provider.of(context);
|
||||||
|
return AppScaffold(
|
||||||
|
isShowAppBar: true,
|
||||||
|
isShowDecPage: false,
|
||||||
|
showNewAppBarTitle: true,
|
||||||
|
showNewAppBar: true,
|
||||||
|
appBarTitle: TranslationBase.of(context).patientRelationOffice,
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: Container(
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
decoration: containerRadius(Colors.white, 12),
|
||||||
|
margin: EdgeInsets.all(21.0),
|
||||||
|
padding: const EdgeInsets.all(21.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
TranslationBase.of(context).assistYou,
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16.0,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Color(0xff2B353E),
|
||||||
|
letterSpacing: -0.64,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
mHeight(16),
|
||||||
|
inputWidget(TranslationBase.of(context).enterDetails, "", assistText),
|
||||||
|
mHeight(16),
|
||||||
|
DefaultButton(
|
||||||
|
TranslationBase.of(context).send,
|
||||||
|
() {
|
||||||
|
if (assistText.text.isNotEmpty) {
|
||||||
|
callReceivePrescriptionAPI(context);
|
||||||
|
} else {
|
||||||
|
Utils.showErrorToast(TranslationBase.of(context).emptyMessage);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
|
||||||
|
return Container(
|
||||||
|
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
color: Colors.white,
|
||||||
|
border: Border.all(
|
||||||
|
color: Color(0xffefefef),
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: hasSelection ? () {} : null,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
_labelText,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 11,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Color(0xff2B353E),
|
||||||
|
letterSpacing: -0.44,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextField(
|
||||||
|
enabled: isEnable,
|
||||||
|
scrollPadding: EdgeInsets.zero,
|
||||||
|
keyboardType: TextInputType.name,
|
||||||
|
controller: _controller,
|
||||||
|
onChanged: (value) => {},
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
height: 21 / 14,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: Color(0xff2B353E),
|
||||||
|
letterSpacing: -0.44,
|
||||||
|
),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
isDense: true,
|
||||||
|
hintText: _hintText,
|
||||||
|
hintStyle: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
height: 21 / 14,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: Color(0xff575757),
|
||||||
|
letterSpacing: -0.56,
|
||||||
|
),
|
||||||
|
prefixIconConstraints: BoxConstraints(minWidth: 50),
|
||||||
|
prefixIcon: prefix == null
|
||||||
|
? null
|
||||||
|
: Text(
|
||||||
|
"+" + prefix,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
height: 21 / 14,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Color(0xff2E303A),
|
||||||
|
letterSpacing: -0.56,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
contentPadding: EdgeInsets.zero,
|
||||||
|
border: InputBorder.none,
|
||||||
|
focusedBorder: InputBorder.none,
|
||||||
|
enabledBorder: InputBorder.none,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void callReceivePrescriptionAPI(BuildContext context) {
|
||||||
|
ClinicListService service = new ClinicListService();
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
service
|
||||||
|
.insertInPatientOrder(projectViewModel.getAdmissionInfoResponseModel, 1, (projectViewModel.user.firstName + " " + projectViewModel.user.lastName),
|
||||||
|
(projectViewModel.user.firstNameN + " " + projectViewModel.user.lastNameN), projectViewModel.user.mobileNumber, assistText.text, context)
|
||||||
|
.then((res) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
AppToast.showSuccessToast(message: TranslationBase.of(context).successSendReport);
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
}).catchError((err) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
print(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,77 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/InPatientServices/get_inpatient_advance_requests_response_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/InPatientServices/components/inpatient_paid_advance_payment.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/InPatientServices/components/inpatient_pending_advance_payment.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class InPatientAdvancePayment extends StatefulWidget {
|
||||||
|
InPatientAdvanceResponseModel inPatientAdvanceResponseModel;
|
||||||
|
bool isHasData;
|
||||||
|
|
||||||
|
InPatientAdvancePayment({this.isHasData, this.inPatientAdvanceResponseModel});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<InPatientAdvancePayment> createState() => _InPatientAdvancePaymentState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _InPatientAdvancePaymentState extends State<InPatientAdvancePayment> with SingleTickerProviderStateMixin {
|
||||||
|
TabController _tabController;
|
||||||
|
ProjectViewModel projectViewModel;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
_tabController = TabController(length: 2, vsync: this);
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
projectViewModel = Provider.of(context);
|
||||||
|
return AppScaffold(
|
||||||
|
isShowAppBar: true,
|
||||||
|
isShowDecPage: false,
|
||||||
|
showNewAppBarTitle: true,
|
||||||
|
showNewAppBar: true,
|
||||||
|
appBarTitle: TranslationBase.of(context).advancePayment,
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
TabBar(
|
||||||
|
controller: _tabController,
|
||||||
|
indicatorWeight: 3.0,
|
||||||
|
indicatorSize: TabBarIndicatorSize.tab,
|
||||||
|
labelColor: Color(0xff2B353E),
|
||||||
|
unselectedLabelColor: Color(0xff575757),
|
||||||
|
labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
labelStyle: TextStyle(
|
||||||
|
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
letterSpacing: -0.48,
|
||||||
|
),
|
||||||
|
unselectedLabelStyle: TextStyle(
|
||||||
|
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
letterSpacing: -0.48,
|
||||||
|
),
|
||||||
|
tabs: [Text(TranslationBase.of(context).pending), Text(TranslationBase.of(context).history)],
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: TabBarView(
|
||||||
|
physics: BouncingScrollPhysics(),
|
||||||
|
controller: _tabController,
|
||||||
|
children: [
|
||||||
|
InPatientPendingAdvancePayment(isHasData: widget.isHasData, inPatientAdvanceResponseModel: widget.inPatientAdvanceResponseModel),
|
||||||
|
InPatientPaidAdvancePayment(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,378 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/InPatientServices/get_general_instructions_response_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/InPatientServices/birth_notification.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/InPatientServices/general_instructions.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/InPatientServices/help_PRO.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/InPatientServices/inpatient_advance_payment.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/InPatientServices/meal_plan.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/InPatientServices/medical_instructions.dart';
|
||||||
|
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
|
import '../../models/InPatientServices/get_inpatient_advance_requests_response_model.dart';
|
||||||
|
import '../../models/InPatientServices/get_medical_instructions_response_model.dart';
|
||||||
|
|
||||||
|
class InPatientServicesHome extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
State<InPatientServicesHome> createState() => _InPatientServicesHomeState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _InPatientServicesHomeState extends State<InPatientServicesHome> {
|
||||||
|
ProjectViewModel projectViewModel;
|
||||||
|
InPatientAdvanceResponseModel inPatientAdvanceResponseModel;
|
||||||
|
bool isReceivePrescriptionEnabled = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
|
checkDischargeMedications(context);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
projectViewModel = Provider.of(context);
|
||||||
|
List<Widget> inPatientServiceList = getInPatientServicesList(context);
|
||||||
|
return AppScaffold(
|
||||||
|
isShowAppBar: true,
|
||||||
|
isShowDecPage: false,
|
||||||
|
showNewAppBarTitle: true,
|
||||||
|
showNewAppBar: true,
|
||||||
|
appBarTitle: TranslationBase.of(context).InPatientServicesHeader,
|
||||||
|
body: Container(
|
||||||
|
margin: EdgeInsets.all(20.0),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(left: 12, right: 12),
|
||||||
|
child: GridView.builder(
|
||||||
|
shrinkWrap: true,
|
||||||
|
primary: false,
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12),
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
itemCount: inPatientServiceList.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return inPatientServiceList[index];
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Widget> getInPatientServicesList(BuildContext context) {
|
||||||
|
List<Widget> serviceList = List();
|
||||||
|
|
||||||
|
serviceList.add(
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
if (projectViewModel.isPatientAdmitted ? true : checkAdmissionRequestDate()) openGeneralInstructions(context);
|
||||||
|
},
|
||||||
|
child: MedicalProfileItem(
|
||||||
|
title: TranslationBase.of(context).generalInstructionsTitle,
|
||||||
|
imagePath: 'general_instructions.svg',
|
||||||
|
subTitle: TranslationBase.of(context).generalInstructionsSubTitle,
|
||||||
|
width: 50.0,
|
||||||
|
height: 40.0,
|
||||||
|
isInPatient: true,
|
||||||
|
isEnable: projectViewModel.isPatientAdmitted ? true : checkAdmissionRequestDate(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
serviceList.add(
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
if (projectViewModel.isPatientAdmitted ? true : checkAdmissionRequestDate()) openMedicalInstructions(context);
|
||||||
|
},
|
||||||
|
child: MedicalProfileItem(
|
||||||
|
title: TranslationBase.of(context).medicalInstructionsTitle,
|
||||||
|
imagePath: 'medical_instructions.svg',
|
||||||
|
subTitle: TranslationBase.of(context).medicalInstructionsSubTitle,
|
||||||
|
width: 50.0,
|
||||||
|
height: 40.0,
|
||||||
|
isInPatient: true,
|
||||||
|
isEnable: projectViewModel.isPatientAdmitted ? true : checkAdmissionRequestDate(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
serviceList.add(
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
if (projectViewModel.isPatientAdmitted) {
|
||||||
|
Navigator.push(context, FadePage(page: MealPlanPage()));
|
||||||
|
} else {
|
||||||
|
AppToast.showErrorToast(message: "This service is only available to admitted patients");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: MedicalProfileItem(
|
||||||
|
title: TranslationBase.of(context).mealPlanTitle,
|
||||||
|
imagePath: 'meal_plan.svg',
|
||||||
|
subTitle: TranslationBase.of(context).mealPlanSubTitle,
|
||||||
|
width: 50.0,
|
||||||
|
height: 40.0,
|
||||||
|
isInPatient: true,
|
||||||
|
isEnable: projectViewModel.isPatientAdmitted),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
serviceList.add(
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
openBirthNotificationsPage(context);
|
||||||
|
},
|
||||||
|
child: MedicalProfileItem(
|
||||||
|
title: TranslationBase.of(context).birthNotificationTitle,
|
||||||
|
imagePath: 'birth_notification.svg',
|
||||||
|
subTitle: TranslationBase.of(context).birthNotificationSubTitle,
|
||||||
|
width: 50.0,
|
||||||
|
height: 40.0,
|
||||||
|
isInPatient: true,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
// serviceList.add(
|
||||||
|
// InkWell(
|
||||||
|
// onTap: () {
|
||||||
|
// // Navigator.push(context, FadePage(page: AdvancePaymentPage()));
|
||||||
|
// },
|
||||||
|
// child: MedicalProfileItem(
|
||||||
|
// title: TranslationBase.of(context).admissionNoticeTitle,
|
||||||
|
// imagePath: 'admission_notice.svg',
|
||||||
|
// subTitle: TranslationBase.of(context).admissionNoticeSubTitle,
|
||||||
|
// width: 50.0,
|
||||||
|
// height: 40.0,
|
||||||
|
// isInPatient: true,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
|
||||||
|
serviceList.add(
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
getInPatientAdvancePaymentRequests(context);
|
||||||
|
},
|
||||||
|
child: MedicalProfileItem(
|
||||||
|
title: TranslationBase.of(context).advancePayment,
|
||||||
|
imagePath: 'advance_payment.svg',
|
||||||
|
subTitle: TranslationBase.of(context).payment,
|
||||||
|
width: 50.0,
|
||||||
|
height: 40.0,
|
||||||
|
isInPatient: true,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
serviceList.add(
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
// Navigator.push(context, FadePage(page: AdvancePaymentPage()));
|
||||||
|
if (isReceivePrescriptionEnabled) receivePrescriptionAPI(context);
|
||||||
|
},
|
||||||
|
child: MedicalProfileItem(
|
||||||
|
title: TranslationBase.of(context).receive,
|
||||||
|
imagePath: 'receive_prescription.svg',
|
||||||
|
subTitle: TranslationBase.of(context).prescriptions,
|
||||||
|
width: 50.0,
|
||||||
|
height: 40.0,
|
||||||
|
isInPatient: true,
|
||||||
|
isEnable: isReceivePrescriptionEnabled),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
serviceList.add(
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
checkCurrentTime(context);
|
||||||
|
},
|
||||||
|
child: MedicalProfileItem(
|
||||||
|
title: TranslationBase.of(context).help,
|
||||||
|
imagePath: 'help_pro.svg',
|
||||||
|
subTitle: TranslationBase.of(context).PRO,
|
||||||
|
width: 50.0,
|
||||||
|
height: 40.0,
|
||||||
|
isInPatient: true,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
return serviceList;
|
||||||
|
}
|
||||||
|
|
||||||
|
void receivePrescriptionAPI(BuildContext context) {
|
||||||
|
AlertDialogBox(
|
||||||
|
context: context,
|
||||||
|
confirmMessage: TranslationBase.of(context).successSendReport,
|
||||||
|
okText: TranslationBase.of(context).ok,
|
||||||
|
okFunction: () {
|
||||||
|
AlertDialogBox.closeAlertDialog(context);
|
||||||
|
callReceivePrescriptionAPI(context);
|
||||||
|
}).showAlertDialog(context);
|
||||||
|
|
||||||
|
// ConfirmDialog dialog = new ConfirmDialog(
|
||||||
|
// context: context,
|
||||||
|
// confirmMessage: TranslationBase.of(context).successSendReport,
|
||||||
|
// okText: TranslationBase.of(context).ok,
|
||||||
|
// cancelText: TranslationBase.of(context).cancel_nocaps,
|
||||||
|
// okFunction: () {
|
||||||
|
// Navigator.of(context).pop();
|
||||||
|
// },
|
||||||
|
// cancelFunction: () => {});
|
||||||
|
// dialog.showAlertDialog(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
void checkDischargeMedications(BuildContext context) {
|
||||||
|
ClinicListService service = new ClinicListService();
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
service.getDischargeMedicationOrder(projectViewModel.getAdmissionInfoResponseModel).then((res) {
|
||||||
|
print(res["PatientHasDischargeMedicineList"].length);
|
||||||
|
setState(() {
|
||||||
|
if (res["PatientHasDischargeMedicineList"].length != 0) {
|
||||||
|
isReceivePrescriptionEnabled = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
}).catchError((err) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
print(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void callReceivePrescriptionAPI(BuildContext context) {
|
||||||
|
ClinicListService service = new ClinicListService();
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
service
|
||||||
|
.insertInPatientOrder(projectViewModel.getAdmissionInfoResponseModel, 2, (projectViewModel.user.firstName + " " + projectViewModel.user.lastName),
|
||||||
|
(projectViewModel.user.firstNameN + " " + projectViewModel.user.lastNameN), projectViewModel.user.mobileNumber, "I need my medicines", context)
|
||||||
|
.then((res) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
}).catchError((err) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
print(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void openBirthNotificationsPage(BuildContext context) {
|
||||||
|
ClinicListService service = new ClinicListService();
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
service.getBirthNotification(projectViewModel.user.patientID, context).then((res) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
if (res["MessageStatus"] == 1) {
|
||||||
|
print(res['birthNotification']);
|
||||||
|
Navigator.push(context, FadePage(page: BirthNotification()));
|
||||||
|
} else {
|
||||||
|
AppToast.showErrorToast(message: res["endUserMessage"]);
|
||||||
|
}
|
||||||
|
}).catchError((err) {
|
||||||
|
print(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void openGeneralInstructions(BuildContext context) {
|
||||||
|
ClinicListService service = new ClinicListService();
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
service.getGeneralInstructions(projectViewModel.inPatientProjectID, context).then((res) {
|
||||||
|
if (res['generalInstructions'].length != 0) {
|
||||||
|
List<GetGeneralInstructions> getGeneralInstructionsList = [];
|
||||||
|
res['generalInstructions'].forEach((v) {
|
||||||
|
getGeneralInstructionsList.add(new GetGeneralInstructions.fromJson(v));
|
||||||
|
});
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
print(res['generalInstructions']);
|
||||||
|
Navigator.push(context, FadePage(page: GeneralInstructions(getGeneralInstructionsList: getGeneralInstructionsList)));
|
||||||
|
} else {
|
||||||
|
AppToast.showErrorToast(message: TranslationBase.of(context).noGeneralInstructions);
|
||||||
|
}
|
||||||
|
}).catchError((err) {
|
||||||
|
print(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void openMedicalInstructions(BuildContext context) {
|
||||||
|
ClinicListService service = new ClinicListService();
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
service.getMedicalInstructions(projectViewModel.inPatientProjectID, context).then((res) {
|
||||||
|
if (res['MedicalInstruction'] != null && res['MedicalInstruction'].length != 0) {
|
||||||
|
List<GetMedicalInstructions> getMedicalInstructionsList = [];
|
||||||
|
res['MedicalInstruction'].forEach((v) {
|
||||||
|
getMedicalInstructionsList.add(new GetMedicalInstructions.fromJson(v));
|
||||||
|
});
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
print(res['MedicalInstruction']);
|
||||||
|
Navigator.push(context, FadePage(page: MedicalInstructionsPage(getMedicalInstructionsList: getMedicalInstructionsList)));
|
||||||
|
} else {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
AppToast.showErrorToast(message: TranslationBase.of(context).noMedicalInstructions);
|
||||||
|
}
|
||||||
|
}).catchError((err) {
|
||||||
|
print(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void getInPatientAdvancePaymentRequests(BuildContext context) {
|
||||||
|
ClinicListService service = new ClinicListService();
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
service
|
||||||
|
.getInPatientAdvancePaymentRequests(projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.projectID : projectViewModel.getAdmissionRequestInfoResponseModel.projectId, projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.admissionNo : 0,
|
||||||
|
projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.admissionRequestNo : projectViewModel.getAdmissionRequestInfoResponseModel.admissionRequestNo, context)
|
||||||
|
.then((res) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
if (res["MessageStatus"] == 1) {
|
||||||
|
if (res['responseInpatient'] != null) {
|
||||||
|
inPatientAdvanceResponseModel = InPatientAdvanceResponseModel.fromJson(res["responseInpatient"]);
|
||||||
|
Navigator.push(context, FadePage(page: InPatientAdvancePayment(isHasData: inPatientAdvanceResponseModel.responseInpatientAdvanceInfo != null, inPatientAdvanceResponseModel: inPatientAdvanceResponseModel)));
|
||||||
|
} else {
|
||||||
|
AppToast.showErrorToast(message: TranslationBase.of(context).noData);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Navigator.push(context, FadePage(page: InPatientAdvancePayment(isHasData: inPatientAdvanceResponseModel.responseInpatientAdvanceInfo != null, inPatientAdvanceResponseModel: inPatientAdvanceResponseModel)));
|
||||||
|
}
|
||||||
|
}).catchError((err) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
print(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void checkCurrentTime(BuildContext context) {
|
||||||
|
print(DateTime.now().hour);
|
||||||
|
print(DateTime.now().minute);
|
||||||
|
if (DateTime.now().hour >= 7 && DateTime.now().hour <= 22) {
|
||||||
|
Navigator.push(context, FadePage(page: HelpPRO()));
|
||||||
|
} else {
|
||||||
|
ConfirmDialog dialog = new ConfirmDialog(
|
||||||
|
context: context,
|
||||||
|
confirmMessage: TranslationBase.of(context).proErrorMessage,
|
||||||
|
okText: TranslationBase.of(context).callNow,
|
||||||
|
cancelText: TranslationBase.of(context).cancel_nocaps,
|
||||||
|
okFunction: () => {ConfirmDialog.closeAlertDialog(context), launchUrl(Uri.parse("tel://" + "011 525 9553"))},
|
||||||
|
cancelFunction: () => {});
|
||||||
|
dialog.showAlertDialog(context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool checkAdmissionRequestDate() {
|
||||||
|
print(DateUtil.convertStringToDate(projectViewModel.getAdmissionRequestInfoResponseModel.expectedAdmissionDate));
|
||||||
|
print(DateUtil.convertStringToDate(projectViewModel.getAdmissionRequestInfoResponseModel.expectedAdmissionDate).difference(DateTime.now()).inHours);
|
||||||
|
if (DateUtil.convertStringToDate(projectViewModel.getAdmissionRequestInfoResponseModel.expectedAdmissionDate).difference(DateTime.now()).inHours > 24) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,641 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/InPatientServices/get_admitted_patient_response_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/InPatientServices/get_meal_items_schedule_response_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/InPatientServices/get_meals_schedule_response_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
|
||||||
|
import 'package:diplomaticquarterapp/theme/colors.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/my_rich_text.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class MealPlanPage extends StatefulWidget {
|
||||||
|
const MealPlanPage({Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<MealPlanPage> createState() => _MealPlanPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MealPlanPageState extends State<MealPlanPage> {
|
||||||
|
ProjectViewModel projectViewModel;
|
||||||
|
GetAdmittedPatientsResponseModel getAdmittedPatientsResponseModel;
|
||||||
|
List<GetMealsScheduleResponseModel> getMealsScheduleResponseModelList = [];
|
||||||
|
|
||||||
|
List<GetMealItemsScheduleResponseModel> getMealItemsScheduleResponseModelBreakfast = [];
|
||||||
|
List<GetMealItemsScheduleResponseModel> getMealItemsScheduleResponseModelLunch = [];
|
||||||
|
List<GetMealItemsScheduleResponseModel> getMealItemsScheduleResponseModelDinner = [];
|
||||||
|
|
||||||
|
List<GetMealItemsScheduleResponseModelList> _getMealItemsScheduleResponseModelBreakfast = [];
|
||||||
|
List<GetMealItemsScheduleResponseModelList> _getMealItemsScheduleResponseModelLunch = [];
|
||||||
|
List<GetMealItemsScheduleResponseModelList> _getMealItemsScheduleResponseModelDinner = [];
|
||||||
|
|
||||||
|
int currentDay = 0;
|
||||||
|
int currentWeek = 0;
|
||||||
|
|
||||||
|
int selectedMealScheduleID = 0;
|
||||||
|
|
||||||
|
final ValueNotifier<bool> isFasting = ValueNotifier(false);
|
||||||
|
bool isFastingVal = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
|
getAdmittedPatientDetails();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
projectViewModel = Provider.of(context);
|
||||||
|
return AppScaffold(
|
||||||
|
isShowAppBar: true,
|
||||||
|
isShowDecPage: false,
|
||||||
|
showNewAppBarTitle: true,
|
||||||
|
showNewAppBar: true,
|
||||||
|
appBarTitle: TranslationBase.of(context).mealPlanTitle,
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(21.0),
|
||||||
|
child: getMealsScheduleResponseModelList.length != 0
|
||||||
|
? Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
decoration: containerRadius((getMealsScheduleResponseModelList[0].isShow) ? Colors.white : Colors.grey[300], 12),
|
||||||
|
child: AppExpandableNotifier(
|
||||||
|
title: "Breakfast TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[0].tATTime),
|
||||||
|
isTitleSingleLine: false,
|
||||||
|
widgetColor: Colors.transparent,
|
||||||
|
isExpand: getMealsScheduleResponseModelList[0].isShow,
|
||||||
|
isDisabled: !getMealsScheduleResponseModelList[0].isShow,
|
||||||
|
bodyWidget: Column(
|
||||||
|
children: [
|
||||||
|
getDivider(),
|
||||||
|
ListView.separated(
|
||||||
|
physics: BouncingScrollPhysics(),
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return Container(
|
||||||
|
padding: EdgeInsets.all(21.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(_getMealItemsScheduleResponseModelBreakfast[index].filterName,
|
||||||
|
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 18.0, letterSpacing: -0.64, color: CustomColors.darkGrey)),
|
||||||
|
SizedBox(
|
||||||
|
height: 12.0,
|
||||||
|
),
|
||||||
|
ListView.separated(
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemBuilder: (context, index2) {
|
||||||
|
return Container(
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
ValueListenableBuilder<int>(
|
||||||
|
valueListenable: _getMealItemsScheduleResponseModelBreakfast[index].selectedItemID,
|
||||||
|
builder: (context, val, child) {
|
||||||
|
return Radio(
|
||||||
|
value: _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList[index2].itemID,
|
||||||
|
groupValue: _getMealItemsScheduleResponseModelBreakfast[index].selectedItemID.value,
|
||||||
|
activeColor: Colors.red[800],
|
||||||
|
onChanged: (value) {
|
||||||
|
_getMealItemsScheduleResponseModelBreakfast[index].selectedItemID.value = value;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
LargeAvatar(
|
||||||
|
name: _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList[index2].description,
|
||||||
|
url: "https://www.pumpkinnspice.com/wp-content/uploads/2016/03/easy-breakfast-quesadillas-11-683x1024.jpg",
|
||||||
|
width: 60,
|
||||||
|
height: 60,
|
||||||
|
radius: 5,
|
||||||
|
disableProfileView: true,
|
||||||
|
),
|
||||||
|
SizedBox(width: 11),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: <Widget>[
|
||||||
|
MyRichText(
|
||||||
|
"",
|
||||||
|
projectViewModel.isArabic
|
||||||
|
? _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList[index2].descriptionN
|
||||||
|
: _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList[index2].description,
|
||||||
|
projectViewModel.isArabic),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
separatorBuilder: (context, index) {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.all(16.0),
|
||||||
|
child: Divider(
|
||||||
|
height: 1.5,
|
||||||
|
thickness: 1.0,
|
||||||
|
color: Colors.grey.shade200,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
itemCount: _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList.length),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
separatorBuilder: (context, index) {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.only(left: 15, right: 15),
|
||||||
|
child: Divider(
|
||||||
|
height: 1.5,
|
||||||
|
thickness: 1.0,
|
||||||
|
color: Colors.grey.shade200,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
itemCount: _getMealItemsScheduleResponseModelBreakfast.length),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
mHeight(21),
|
||||||
|
Container(
|
||||||
|
decoration: containerRadius(getMealsScheduleResponseModelList[1].isShow ? Colors.white : Colors.grey[300], 12),
|
||||||
|
child: AppExpandableNotifier(
|
||||||
|
title: "Lunch TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[1].tATTime),
|
||||||
|
isTitleSingleLine: false,
|
||||||
|
widgetColor: Colors.transparent,
|
||||||
|
isExpand: getMealsScheduleResponseModelList[1].isShow,
|
||||||
|
isDisabled: !getMealsScheduleResponseModelList[1].isShow,
|
||||||
|
bodyWidget: Column(
|
||||||
|
children: [
|
||||||
|
getDivider(),
|
||||||
|
ListView.separated(
|
||||||
|
physics: BouncingScrollPhysics(),
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return Container(
|
||||||
|
padding: EdgeInsets.all(21.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(_getMealItemsScheduleResponseModelLunch[index].filterName,
|
||||||
|
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 18.0, letterSpacing: -0.64, color: CustomColors.darkGrey)),
|
||||||
|
SizedBox(
|
||||||
|
height: 12.0,
|
||||||
|
),
|
||||||
|
ListView.separated(
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemBuilder: (context, index2) {
|
||||||
|
return Container(
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
ValueListenableBuilder<int>(
|
||||||
|
valueListenable: _getMealItemsScheduleResponseModelLunch[index].selectedItemID,
|
||||||
|
builder: (context, val, child) {
|
||||||
|
return Radio(
|
||||||
|
value: _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList[index2].itemID,
|
||||||
|
groupValue: _getMealItemsScheduleResponseModelLunch[index].selectedItemID.value,
|
||||||
|
activeColor: Colors.red[800],
|
||||||
|
onChanged: (value) {
|
||||||
|
_getMealItemsScheduleResponseModelLunch[index].selectedItemID.value = value;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
LargeAvatar(
|
||||||
|
name: _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList[index2].description,
|
||||||
|
url: "https://www.pumpkinnspice.com/wp-content/uploads/2016/03/easy-breakfast-quesadillas-11-683x1024.jpg",
|
||||||
|
width: 60,
|
||||||
|
height: 60,
|
||||||
|
radius: 5,
|
||||||
|
disableProfileView: true,
|
||||||
|
),
|
||||||
|
SizedBox(width: 11),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: <Widget>[
|
||||||
|
MyRichText(
|
||||||
|
"",
|
||||||
|
projectViewModel.isArabic
|
||||||
|
? _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList[index2].descriptionN
|
||||||
|
: _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList[index2].description,
|
||||||
|
projectViewModel.isArabic),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
separatorBuilder: (context, index) {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.all(16.0),
|
||||||
|
child: Divider(
|
||||||
|
height: 1.5,
|
||||||
|
thickness: 1.0,
|
||||||
|
color: Colors.grey.shade200,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
itemCount: _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList.length),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
separatorBuilder: (context, index) {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.only(left: 15, right: 15),
|
||||||
|
child: Divider(
|
||||||
|
height: 1.5,
|
||||||
|
thickness: 1.0,
|
||||||
|
color: Colors.grey.shade200,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
itemCount: _getMealItemsScheduleResponseModelLunch.length),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
mHeight(21),
|
||||||
|
Container(
|
||||||
|
decoration: containerRadius(getMealsScheduleResponseModelList[2].isShow ? Colors.white : Colors.grey[300], 12),
|
||||||
|
child: AppExpandableNotifier(
|
||||||
|
title: "Dinner TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[2].tATTime),
|
||||||
|
isTitleSingleLine: false,
|
||||||
|
widgetColor: Colors.transparent,
|
||||||
|
isExpand: getMealsScheduleResponseModelList[2].isShow,
|
||||||
|
isDisabled: !getMealsScheduleResponseModelList[2].isShow,
|
||||||
|
bodyWidget: Column(
|
||||||
|
children: [
|
||||||
|
getDivider(),
|
||||||
|
ListView.separated(
|
||||||
|
physics: BouncingScrollPhysics(),
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return Container(
|
||||||
|
padding: EdgeInsets.all(21.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(_getMealItemsScheduleResponseModelDinner[index].filterName,
|
||||||
|
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 18.0, letterSpacing: -0.64, color: CustomColors.darkGrey)),
|
||||||
|
SizedBox(
|
||||||
|
height: 12.0,
|
||||||
|
),
|
||||||
|
ListView.separated(
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemBuilder: (context, index2) {
|
||||||
|
return Container(
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
ValueListenableBuilder<int>(
|
||||||
|
valueListenable: _getMealItemsScheduleResponseModelDinner[index].selectedItemID,
|
||||||
|
builder: (context, val, child) {
|
||||||
|
return Radio(
|
||||||
|
value: _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList[index2].itemID,
|
||||||
|
groupValue: _getMealItemsScheduleResponseModelDinner[index].selectedItemID.value,
|
||||||
|
activeColor: Colors.red[800],
|
||||||
|
onChanged: (value) {
|
||||||
|
_getMealItemsScheduleResponseModelDinner[index].selectedItemID.value = value;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
LargeAvatar(
|
||||||
|
name: _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList[index2].description,
|
||||||
|
url: "https://www.pumpkinnspice.com/wp-content/uploads/2016/03/easy-breakfast-quesadillas-11-683x1024.jpg",
|
||||||
|
width: 60,
|
||||||
|
height: 60,
|
||||||
|
radius: 5,
|
||||||
|
disableProfileView: true,
|
||||||
|
),
|
||||||
|
SizedBox(width: 11),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: <Widget>[
|
||||||
|
MyRichText(
|
||||||
|
"",
|
||||||
|
projectViewModel.isArabic
|
||||||
|
? _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList[index2].descriptionN
|
||||||
|
: _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList[index2].description,
|
||||||
|
projectViewModel.isArabic),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
separatorBuilder: (context, index) {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.all(16.0),
|
||||||
|
child: Divider(
|
||||||
|
height: 1.5,
|
||||||
|
thickness: 1.0,
|
||||||
|
color: Colors.grey.shade200,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
itemCount: _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList.length),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
separatorBuilder: (context, index) {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.only(left: 15, right: 15),
|
||||||
|
child: Divider(
|
||||||
|
height: 1.5,
|
||||||
|
thickness: 1.0,
|
||||||
|
color: Colors.grey.shade200,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
itemCount: _getMealItemsScheduleResponseModelDinner.length),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
: Container(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
bottomSheet: Container(
|
||||||
|
color: Colors.white,
|
||||||
|
width: double.infinity,
|
||||||
|
padding: EdgeInsets.all(20),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
ValueListenableBuilder<bool>(
|
||||||
|
valueListenable: isFasting,
|
||||||
|
builder: (context, val, child) {
|
||||||
|
return Checkbox(
|
||||||
|
onChanged: (bool value) {
|
||||||
|
isFasting.value = value;
|
||||||
|
isFastingVal = value;
|
||||||
|
},
|
||||||
|
value: isFastingVal,
|
||||||
|
activeColor: Color(0xFFc5272d),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
Text(
|
||||||
|
TranslationBase.of(context).isFasting,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
letterSpacing: -0.48,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
mHeight(12),
|
||||||
|
DefaultButton(
|
||||||
|
TranslationBase.of(context).placeOrder,
|
||||||
|
() {
|
||||||
|
placeOrder();
|
||||||
|
},
|
||||||
|
color: Color(0xff359846),
|
||||||
|
disabledColor: Colors.grey,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void placeOrder() {
|
||||||
|
List<String> selectedItemIDs = [];
|
||||||
|
|
||||||
|
if (_getMealItemsScheduleResponseModelBreakfast.isNotEmpty) {
|
||||||
|
_getMealItemsScheduleResponseModelBreakfast.forEach((element) {
|
||||||
|
selectedItemIDs.add(element.selectedItemID.value.toString());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_getMealItemsScheduleResponseModelLunch.isNotEmpty) {
|
||||||
|
_getMealItemsScheduleResponseModelLunch.forEach((element) {
|
||||||
|
selectedItemIDs.add(element.selectedItemID.value.toString());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_getMealItemsScheduleResponseModelDinner.isNotEmpty) {
|
||||||
|
_getMealItemsScheduleResponseModelDinner.forEach((element) {
|
||||||
|
selectedItemIDs.add(element.selectedItemID.value.toString());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
ClinicListService service = new ClinicListService();
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
service
|
||||||
|
.placeMealPlanOrder(getAdmittedPatientsResponseModel.projectID, selectedMealScheduleID, selectedItemIDs.join(","), projectViewModel.user.patientID,
|
||||||
|
getAdmittedPatientsResponseModel.admissionNo, getAdmittedPatientsResponseModel.isHasCompanion, isFastingVal, context)
|
||||||
|
.then((res) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
AppToast.showSuccessToast(message: "Your meal order has been received successfully");
|
||||||
|
Navigator.pop(context);
|
||||||
|
}).catchError((err) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
print(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget getDivider() {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.only(left: 15, right: 15),
|
||||||
|
child: Divider(
|
||||||
|
height: 1.5,
|
||||||
|
thickness: 2.0,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void getAdmittedPatientDetails() {
|
||||||
|
ClinicListService service = new ClinicListService();
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
service.getAdmittedPatientDetails(projectViewModel.user.patientID, projectViewModel.inPatientProjectID, projectViewModel.getAdmissionInfoResponseModel.admissionNo, 0, 0, 0, context).then((res) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
if (res["List_MOP_AdmittedPatients"] != null && res["List_MOP_AdmittedPatients"].length != 0) {
|
||||||
|
print(res["List_MOP_AdmittedPatients"]);
|
||||||
|
getAdmittedPatientsResponseModel = new GetAdmittedPatientsResponseModel.fromJson(res["List_MOP_AdmittedPatients"][0]);
|
||||||
|
print(getAdmittedPatientsResponseModel.dietType);
|
||||||
|
getCurrentWeekIDAndDay(getAdmittedPatientsResponseModel.dietType);
|
||||||
|
} else {
|
||||||
|
AppToast.showErrorToast(message: "No data found for admitted patient");
|
||||||
|
getCurrentWeekIDAndDay(1);
|
||||||
|
}
|
||||||
|
}).catchError((err) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
print(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void getCurrentWeekIDAndDay(int dietType) {
|
||||||
|
ClinicListService service = new ClinicListService();
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
service.getCurrentWeekIDAndDay(context).then((res) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
currentDay = res["CurrentDay"];
|
||||||
|
currentWeek = res["CurrentWeek"];
|
||||||
|
getMealsOfScheduleID(dietType);
|
||||||
|
}).catchError((err) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
print(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void getMealsOfScheduleID(int dietType) {
|
||||||
|
ClinicListService service = new ClinicListService();
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
service.getMealsOfScheduleID(projectViewModel.inPatientProjectID, projectViewModel.getAdmissionInfoResponseModel.admissionNo, dietType, currentWeek, currentDay, context).then((res) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
if (res["List_MOP_MealsOfScheduleID_Mobile"] != null && res["List_MOP_MealsOfScheduleID_Mobile"].length != 0) {
|
||||||
|
res['List_MOP_MealsOfScheduleID_Mobile'].forEach((scheduleItem) {
|
||||||
|
getMealsScheduleResponseModelList.add(GetMealsScheduleResponseModel.fromJson(scheduleItem));
|
||||||
|
});
|
||||||
|
if (getMealsScheduleResponseModelList[0].isShow) {
|
||||||
|
selectedMealScheduleID = getMealsScheduleResponseModelList[0].scheduleID;
|
||||||
|
getDefaultItemsOfScheduleID(getMealsScheduleResponseModelList[0].scheduleID, 1);
|
||||||
|
}
|
||||||
|
if (getMealsScheduleResponseModelList[1].isShow) {
|
||||||
|
selectedMealScheduleID = getMealsScheduleResponseModelList[1].scheduleID;
|
||||||
|
getDefaultItemsOfScheduleID(getMealsScheduleResponseModelList[1].scheduleID, 2);
|
||||||
|
}
|
||||||
|
if (getMealsScheduleResponseModelList[2].isShow) {
|
||||||
|
selectedMealScheduleID = getMealsScheduleResponseModelList[2].scheduleID;
|
||||||
|
getDefaultItemsOfScheduleID(getMealsScheduleResponseModelList[2].scheduleID, 3);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
AppToast.showErrorToast(message: "No meal schedule found for admitted patient");
|
||||||
|
}
|
||||||
|
}).catchError((err) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
print(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void getDefaultItemsOfScheduleID(int scheduleID, int mealType) {
|
||||||
|
ClinicListService service = new ClinicListService();
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
service.getDefaultItemsOfScheduleID(projectViewModel.inPatientProjectID, scheduleID, context).then((res) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
if (res["List_MOP_DefaultItemsOfMealModel"] != null && res["List_MOP_DefaultItemsOfMealModel"].length != 0) {
|
||||||
|
if (mealType == 1) {
|
||||||
|
res['List_MOP_DefaultItemsOfMealModel'].forEach((scheduleItem) {
|
||||||
|
getMealItemsScheduleResponseModelBreakfast.add(GetMealItemsScheduleResponseModel.fromJson(scheduleItem));
|
||||||
|
});
|
||||||
|
sortMealsByCategoryBreakfast();
|
||||||
|
}
|
||||||
|
if (mealType == 2) {
|
||||||
|
res['List_MOP_DefaultItemsOfMealModel'].forEach((scheduleItem) {
|
||||||
|
getMealItemsScheduleResponseModelLunch.add(GetMealItemsScheduleResponseModel.fromJson(scheduleItem));
|
||||||
|
});
|
||||||
|
sortMealsByCategoryLunch();
|
||||||
|
}
|
||||||
|
if (mealType == 3) {
|
||||||
|
res['List_MOP_DefaultItemsOfMealModel'].forEach((scheduleItem) {
|
||||||
|
getMealItemsScheduleResponseModelDinner.add(GetMealItemsScheduleResponseModel.fromJson(scheduleItem));
|
||||||
|
});
|
||||||
|
sortMealsByCategoryDinner();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
AppToast.showErrorToast(message: "No meal items found for admitted patient");
|
||||||
|
}
|
||||||
|
setState(() {});
|
||||||
|
}).catchError((err) {
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
print(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void sortMealsByCategoryBreakfast() {
|
||||||
|
getMealItemsScheduleResponseModelBreakfast.forEach((element) {
|
||||||
|
List<GetMealItemsScheduleResponseModelList> breakfastMealItems = _getMealItemsScheduleResponseModelBreakfast
|
||||||
|
.where((elementClinic) => elementClinic.filterName == (projectViewModel.isArabic ? element.categoryDescriptionN : element.categoryDescription))
|
||||||
|
.toList();
|
||||||
|
if (breakfastMealItems.length != 0) {
|
||||||
|
_getMealItemsScheduleResponseModelBreakfast[_getMealItemsScheduleResponseModelBreakfast.indexOf(breakfastMealItems[0])].getMealItemsScheduleResponseModelList.add(element);
|
||||||
|
} else {
|
||||||
|
_getMealItemsScheduleResponseModelBreakfast
|
||||||
|
.add(GetMealItemsScheduleResponseModelList(filterName: projectViewModel.isArabic ? element.categoryDescriptionN : element.categoryDescription, getMealItemsScheduleResponseModel: element));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
_getMealItemsScheduleResponseModelBreakfast.forEach((element) {
|
||||||
|
element.getMealItemsScheduleResponseModelList.forEach((elementInner) {
|
||||||
|
if (elementInner.isDefault) {
|
||||||
|
element.selectedItemID.value = elementInner.itemID;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void sortMealsByCategoryLunch() {
|
||||||
|
getMealItemsScheduleResponseModelLunch.forEach((element) {
|
||||||
|
List<GetMealItemsScheduleResponseModelList> breakfastMealItems = _getMealItemsScheduleResponseModelLunch
|
||||||
|
.where((elementClinic) => elementClinic.filterName == (projectViewModel.isArabic ? element.categoryDescriptionN : element.categoryDescription))
|
||||||
|
.toList();
|
||||||
|
if (breakfastMealItems.length != 0) {
|
||||||
|
_getMealItemsScheduleResponseModelLunch[_getMealItemsScheduleResponseModelLunch.indexOf(breakfastMealItems[0])].getMealItemsScheduleResponseModelList.add(element);
|
||||||
|
} else {
|
||||||
|
_getMealItemsScheduleResponseModelLunch
|
||||||
|
.add(GetMealItemsScheduleResponseModelList(filterName: projectViewModel.isArabic ? element.categoryDescriptionN : element.categoryDescription, getMealItemsScheduleResponseModel: element));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
_getMealItemsScheduleResponseModelLunch.forEach((element) {
|
||||||
|
element.getMealItemsScheduleResponseModelList.forEach((elementInner) {
|
||||||
|
if (elementInner.isDefault) {
|
||||||
|
element.selectedItemID.value = elementInner.itemID;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void sortMealsByCategoryDinner() {
|
||||||
|
getMealItemsScheduleResponseModelDinner.forEach((element) {
|
||||||
|
List<GetMealItemsScheduleResponseModelList> breakfastMealItems = _getMealItemsScheduleResponseModelDinner
|
||||||
|
.where((elementClinic) => elementClinic.filterName == (projectViewModel.isArabic ? element.categoryDescriptionN : element.categoryDescription))
|
||||||
|
.toList();
|
||||||
|
if (breakfastMealItems.length != 0) {
|
||||||
|
_getMealItemsScheduleResponseModelDinner[_getMealItemsScheduleResponseModelDinner.indexOf(breakfastMealItems[0])].getMealItemsScheduleResponseModelList.add(element);
|
||||||
|
} else {
|
||||||
|
_getMealItemsScheduleResponseModelDinner
|
||||||
|
.add(GetMealItemsScheduleResponseModelList(filterName: projectViewModel.isArabic ? element.categoryDescriptionN : element.categoryDescription, getMealItemsScheduleResponseModel: element));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
_getMealItemsScheduleResponseModelDinner.forEach((element) {
|
||||||
|
element.getMealItemsScheduleResponseModelList.forEach((elementInner) {
|
||||||
|
if (elementInner.isDefault) {
|
||||||
|
element.selectedItemID.value = elementInner.itemID;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,100 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
import '../../models/InPatientServices/get_medical_instructions_response_model.dart';
|
||||||
|
|
||||||
|
class MedicalInstructionsPage extends StatefulWidget {
|
||||||
|
List<GetMedicalInstructions> getMedicalInstructionsList;
|
||||||
|
|
||||||
|
MedicalInstructionsPage({@required this.getMedicalInstructionsList});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<MedicalInstructionsPage> createState() => _MedicalInstructionsPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MedicalInstructionsPageState extends State<MedicalInstructionsPage> {
|
||||||
|
ProjectViewModel projectViewModel;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
projectViewModel = Provider.of(context);
|
||||||
|
return AppScaffold(
|
||||||
|
isShowAppBar: true,
|
||||||
|
isShowDecPage: false,
|
||||||
|
showNewAppBarTitle: true,
|
||||||
|
showNewAppBar: true,
|
||||||
|
appBarTitle: TranslationBase.of(context).InPatientServicesHeader,
|
||||||
|
body: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(21.0),
|
||||||
|
child: Text(TranslationBase.of(context).medicalInstructions,
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 21.0,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Color(0xff2B353E),
|
||||||
|
letterSpacing: -0.64,
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
child: Card(
|
||||||
|
elevation: 0.0,
|
||||||
|
margin: EdgeInsets.only(left: 16.0, right: 16.0, bottom: 16.0),
|
||||||
|
color: Colors.white,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
side: BorderSide(color: Colors.transparent, width: 0.0),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(16.0),
|
||||||
|
child: Container(
|
||||||
|
child: ListView.separated(
|
||||||
|
itemCount: widget.getMedicalInstructionsList[0].medicaLInstructionsField.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return Container(
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
child: SvgPicture.asset("assets/images/new-design/ionic-ios-checkmark-circle.svg"),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.75,
|
||||||
|
margin: EdgeInsets.only(left: 5.0, right: 5.0),
|
||||||
|
child: Text(widget.getMedicalInstructionsList[0].medicaLInstructionsField[index].descriptionField,
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Color(0xff2B353E),
|
||||||
|
letterSpacing: -0.64,
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
));
|
||||||
|
},
|
||||||
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 14, right: 14),
|
||||||
|
child: mHeight(16.0),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|