Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into get_pending_orders
Conflicts: lib/core/service/operation_report_servive.dartmerge-requests/868/head
commit
9270f58615
Binary file not shown.
|
After Width: | Height: | Size: 969 B |
@ -0,0 +1,112 @@
|
|||||||
|
class CheckActivationCodeModel {
|
||||||
|
int patientMobileNumber;
|
||||||
|
String mobileNo;
|
||||||
|
int projectOutSA;
|
||||||
|
int loginType;
|
||||||
|
String zipCode;
|
||||||
|
bool isRegister;
|
||||||
|
String logInTokenID;
|
||||||
|
int searchType;
|
||||||
|
int patientID;
|
||||||
|
int nationalID;
|
||||||
|
int patientIdentificationID;
|
||||||
|
bool forRegisteration;
|
||||||
|
String activationCode;
|
||||||
|
double versionID;
|
||||||
|
int channel;
|
||||||
|
int languageID;
|
||||||
|
String iPAdress;
|
||||||
|
String generalid;
|
||||||
|
int patientOutSA;
|
||||||
|
Null sessionID;
|
||||||
|
bool isDentalAllowedBackend;
|
||||||
|
int deviceTypeID;
|
||||||
|
String dOB;
|
||||||
|
int isHijri;
|
||||||
|
String healthId;
|
||||||
|
|
||||||
|
CheckActivationCodeModel(
|
||||||
|
{this.patientMobileNumber,
|
||||||
|
this.mobileNo,
|
||||||
|
this.projectOutSA,
|
||||||
|
this.loginType,
|
||||||
|
this.zipCode,
|
||||||
|
this.isRegister,
|
||||||
|
this.logInTokenID,
|
||||||
|
this.searchType,
|
||||||
|
this.patientID,
|
||||||
|
this.nationalID,
|
||||||
|
this.patientIdentificationID,
|
||||||
|
this.forRegisteration,
|
||||||
|
this.activationCode,
|
||||||
|
this.versionID,
|
||||||
|
this.channel,
|
||||||
|
this.languageID,
|
||||||
|
this.iPAdress,
|
||||||
|
this.generalid,
|
||||||
|
this.patientOutSA,
|
||||||
|
this.sessionID,
|
||||||
|
this.isDentalAllowedBackend,
|
||||||
|
this.deviceTypeID,
|
||||||
|
this.dOB,
|
||||||
|
this.isHijri,
|
||||||
|
this.healthId});
|
||||||
|
|
||||||
|
CheckActivationCodeModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
patientMobileNumber = json['PatientMobileNumber'];
|
||||||
|
mobileNo = json['MobileNo'];
|
||||||
|
projectOutSA = json['ProjectOutSA'];
|
||||||
|
loginType = json['LoginType'];
|
||||||
|
zipCode = json['ZipCode'];
|
||||||
|
isRegister = json['isRegister'];
|
||||||
|
logInTokenID = json['LogInTokenID'];
|
||||||
|
searchType = json['SearchType'];
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
nationalID = json['NationalID'];
|
||||||
|
patientIdentificationID = json['PatientIdentificationID'];
|
||||||
|
forRegisteration = json['ForRegisteration'];
|
||||||
|
activationCode = json['activationCode'];
|
||||||
|
versionID = json['VersionID'];
|
||||||
|
channel = json['Channel'];
|
||||||
|
languageID = json['LanguageID'];
|
||||||
|
iPAdress = json['IPAdress'];
|
||||||
|
generalid = json['generalid'];
|
||||||
|
patientOutSA = json['PatientOutSA'];
|
||||||
|
sessionID = json['SessionID'];
|
||||||
|
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||||
|
deviceTypeID = json['DeviceTypeID'];
|
||||||
|
dOB = json['DOB'];
|
||||||
|
isHijri = json['IsHijri'];
|
||||||
|
healthId = json['HealthId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['PatientMobileNumber'] = this.patientMobileNumber;
|
||||||
|
data['MobileNo'] = this.mobileNo;
|
||||||
|
data['ProjectOutSA'] = this.projectOutSA;
|
||||||
|
data['LoginType'] = this.loginType;
|
||||||
|
data['ZipCode'] = this.zipCode;
|
||||||
|
data['isRegister'] = this.isRegister;
|
||||||
|
data['LogInTokenID'] = this.logInTokenID;
|
||||||
|
data['SearchType'] = this.searchType;
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['NationalID'] = this.nationalID;
|
||||||
|
data['PatientIdentificationID'] = this.patientIdentificationID;
|
||||||
|
data['ForRegisteration'] = this.forRegisteration;
|
||||||
|
data['activationCode'] = this.activationCode;
|
||||||
|
data['VersionID'] = this.versionID;
|
||||||
|
data['Channel'] = this.channel;
|
||||||
|
data['LanguageID'] = this.languageID;
|
||||||
|
data['IPAdress'] = this.iPAdress;
|
||||||
|
data['generalid'] = this.generalid;
|
||||||
|
data['PatientOutSA'] = this.patientOutSA;
|
||||||
|
data['SessionID'] = this.sessionID;
|
||||||
|
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||||
|
data['DeviceTypeID'] = this.deviceTypeID;
|
||||||
|
data['DOB'] = this.dOB;
|
||||||
|
data['IsHijri'] = this.isHijri;
|
||||||
|
data['HealthId'] = this.healthId;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,80 @@
|
|||||||
|
class CheckPatientForRegistrationModel {
|
||||||
|
int patientIdentificationID;
|
||||||
|
int patientMobileNumber;
|
||||||
|
String zipCode;
|
||||||
|
double versionID;
|
||||||
|
int channel;
|
||||||
|
int languageID;
|
||||||
|
String iPAdress;
|
||||||
|
String generalid;
|
||||||
|
int patientOutSA;
|
||||||
|
Null sessionID;
|
||||||
|
bool isDentalAllowedBackend;
|
||||||
|
int deviceTypeID;
|
||||||
|
String tokenID;
|
||||||
|
int patientID;
|
||||||
|
bool isRegister;
|
||||||
|
String dOB;
|
||||||
|
int isHijri;
|
||||||
|
|
||||||
|
CheckPatientForRegistrationModel(
|
||||||
|
{this.patientIdentificationID,
|
||||||
|
this.patientMobileNumber,
|
||||||
|
this.zipCode,
|
||||||
|
this.versionID,
|
||||||
|
this.channel,
|
||||||
|
this.languageID,
|
||||||
|
this.iPAdress,
|
||||||
|
this.generalid,
|
||||||
|
this.patientOutSA,
|
||||||
|
this.sessionID,
|
||||||
|
this.isDentalAllowedBackend,
|
||||||
|
this.deviceTypeID,
|
||||||
|
this.tokenID,
|
||||||
|
this.patientID,
|
||||||
|
this.isRegister,
|
||||||
|
this.dOB,
|
||||||
|
this.isHijri});
|
||||||
|
|
||||||
|
CheckPatientForRegistrationModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
patientIdentificationID = json['PatientIdentificationID'];
|
||||||
|
patientMobileNumber = json['PatientMobileNumber'];
|
||||||
|
zipCode = json['ZipCode'];
|
||||||
|
versionID = json['VersionID'];
|
||||||
|
channel = json['Channel'];
|
||||||
|
languageID = json['LanguageID'];
|
||||||
|
iPAdress = json['IPAdress'];
|
||||||
|
generalid = json['generalid'];
|
||||||
|
patientOutSA = json['PatientOutSA'];
|
||||||
|
sessionID = json['SessionID'];
|
||||||
|
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||||
|
deviceTypeID = json['DeviceTypeID'];
|
||||||
|
tokenID = json['TokenID'];
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
isRegister = json['isRegister'];
|
||||||
|
dOB = json['DOB'];
|
||||||
|
isHijri = json['IsHijri'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['PatientIdentificationID'] = this.patientIdentificationID;
|
||||||
|
data['PatientMobileNumber'] = this.patientMobileNumber;
|
||||||
|
data['ZipCode'] = this.zipCode;
|
||||||
|
data['VersionID'] = this.versionID;
|
||||||
|
data['Channel'] = this.channel;
|
||||||
|
data['LanguageID'] = this.languageID;
|
||||||
|
data['IPAdress'] = this.iPAdress;
|
||||||
|
data['generalid'] = this.generalid;
|
||||||
|
data['PatientOutSA'] = this.patientOutSA;
|
||||||
|
data['SessionID'] = this.sessionID;
|
||||||
|
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||||
|
data['DeviceTypeID'] = this.deviceTypeID;
|
||||||
|
data['TokenID'] = this.tokenID;
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['isRegister'] = this.isRegister;
|
||||||
|
data['DOB'] = this.dOB;
|
||||||
|
data['IsHijri'] = this.isHijri;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,185 @@
|
|||||||
|
class PatientRegistrationModel {
|
||||||
|
Patientobject patientobject;
|
||||||
|
String patientIdentificationID;
|
||||||
|
String patientMobileNumber;
|
||||||
|
String logInTokenID;
|
||||||
|
double versionID;
|
||||||
|
int channel;
|
||||||
|
int languageID;
|
||||||
|
String iPAdress;
|
||||||
|
String generalid;
|
||||||
|
int patientOutSA;
|
||||||
|
Null sessionID;
|
||||||
|
bool isDentalAllowedBackend;
|
||||||
|
int deviceTypeID;
|
||||||
|
String tokenID;
|
||||||
|
String dOB;
|
||||||
|
int isHijri;
|
||||||
|
String healthId;
|
||||||
|
String zipCode;
|
||||||
|
|
||||||
|
PatientRegistrationModel(
|
||||||
|
{this.patientobject,
|
||||||
|
this.patientIdentificationID,
|
||||||
|
this.patientMobileNumber,
|
||||||
|
this.logInTokenID,
|
||||||
|
this.versionID,
|
||||||
|
this.channel,
|
||||||
|
this.languageID,
|
||||||
|
this.iPAdress,
|
||||||
|
this.generalid,
|
||||||
|
this.patientOutSA,
|
||||||
|
this.sessionID,
|
||||||
|
this.isDentalAllowedBackend,
|
||||||
|
this.deviceTypeID,
|
||||||
|
this.tokenID,
|
||||||
|
this.dOB,
|
||||||
|
this.isHijri,
|
||||||
|
this.healthId,
|
||||||
|
this.zipCode});
|
||||||
|
|
||||||
|
PatientRegistrationModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
patientobject = json['Patientobject'] != null
|
||||||
|
? new Patientobject.fromJson(json['Patientobject'])
|
||||||
|
: null;
|
||||||
|
patientIdentificationID = json['PatientIdentificationID'];
|
||||||
|
patientMobileNumber = json['PatientMobileNumber'];
|
||||||
|
logInTokenID = json['LogInTokenID'];
|
||||||
|
versionID = json['VersionID'];
|
||||||
|
channel = json['Channel'];
|
||||||
|
languageID = json['LanguageID'];
|
||||||
|
iPAdress = json['IPAdress'];
|
||||||
|
generalid = json['generalid'];
|
||||||
|
patientOutSA = json['PatientOutSA'];
|
||||||
|
sessionID = json['SessionID'];
|
||||||
|
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||||
|
deviceTypeID = json['DeviceTypeID'];
|
||||||
|
tokenID = json['TokenID'];
|
||||||
|
dOB = json['DOB'];
|
||||||
|
isHijri = json['IsHijri'];
|
||||||
|
healthId = json['HealthId'];
|
||||||
|
zipCode = json['ZipCode'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
if (this.patientobject != null) {
|
||||||
|
data['Patientobject'] = this.patientobject.toJson();
|
||||||
|
}
|
||||||
|
data['PatientIdentificationID'] = this.patientIdentificationID;
|
||||||
|
data['PatientMobileNumber'] = this.patientMobileNumber;
|
||||||
|
data['LogInTokenID'] = this.logInTokenID;
|
||||||
|
data['VersionID'] = this.versionID;
|
||||||
|
data['Channel'] = this.channel;
|
||||||
|
data['LanguageID'] = this.languageID;
|
||||||
|
data['IPAdress'] = this.iPAdress;
|
||||||
|
data['generalid'] = this.generalid;
|
||||||
|
data['PatientOutSA'] = this.patientOutSA;
|
||||||
|
data['SessionID'] = this.sessionID;
|
||||||
|
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||||
|
data['DeviceTypeID'] = this.deviceTypeID;
|
||||||
|
data['TokenID'] = this.tokenID;
|
||||||
|
data['DOB'] = this.dOB;
|
||||||
|
data['IsHijri'] = this.isHijri;
|
||||||
|
data['HealthId'] = this.healthId;
|
||||||
|
data['ZipCode'] = this.zipCode;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Patientobject {
|
||||||
|
bool tempValue;
|
||||||
|
int patientIdentificationType;
|
||||||
|
String patientIdentificationNo;
|
||||||
|
int mobileNumber;
|
||||||
|
int patientOutSA;
|
||||||
|
String firstNameN;
|
||||||
|
String middleNameN;
|
||||||
|
String lastNameN;
|
||||||
|
String firstName;
|
||||||
|
String middleName;
|
||||||
|
String lastName;
|
||||||
|
String strDateofBirth;
|
||||||
|
String dateofBirth;
|
||||||
|
int gender;
|
||||||
|
String nationalityID;
|
||||||
|
String dateofBirthN;
|
||||||
|
String emailAddress;
|
||||||
|
String sourceType;
|
||||||
|
String preferredLanguage;
|
||||||
|
String marital;
|
||||||
|
String eHealthIDField;
|
||||||
|
|
||||||
|
Patientobject(
|
||||||
|
{this.tempValue,
|
||||||
|
this.patientIdentificationType,
|
||||||
|
this.patientIdentificationNo,
|
||||||
|
this.mobileNumber,
|
||||||
|
this.patientOutSA,
|
||||||
|
this.firstNameN,
|
||||||
|
this.middleNameN,
|
||||||
|
this.lastNameN,
|
||||||
|
this.firstName,
|
||||||
|
this.middleName,
|
||||||
|
this.lastName,
|
||||||
|
this.strDateofBirth,
|
||||||
|
this.dateofBirth,
|
||||||
|
this.gender,
|
||||||
|
this.nationalityID,
|
||||||
|
this.dateofBirthN,
|
||||||
|
this.emailAddress,
|
||||||
|
this.sourceType,
|
||||||
|
this.preferredLanguage,
|
||||||
|
this.marital,
|
||||||
|
this.eHealthIDField});
|
||||||
|
|
||||||
|
Patientobject.fromJson(Map<String, dynamic> json) {
|
||||||
|
tempValue = json['TempValue'];
|
||||||
|
patientIdentificationType = json['PatientIdentificationType'];
|
||||||
|
patientIdentificationNo = json['PatientIdentificationNo'];
|
||||||
|
mobileNumber = json['MobileNumber'];
|
||||||
|
patientOutSA = json['PatientOutSA'];
|
||||||
|
firstNameN = json['FirstNameN'];
|
||||||
|
middleNameN = json['MiddleNameN'];
|
||||||
|
lastNameN = json['LastNameN'];
|
||||||
|
firstName = json['FirstName'];
|
||||||
|
middleName = json['MiddleName'];
|
||||||
|
lastName = json['LastName'];
|
||||||
|
strDateofBirth = json['StrDateofBirth'];
|
||||||
|
dateofBirth = json['DateofBirth'];
|
||||||
|
gender = json['Gender'];
|
||||||
|
nationalityID = json['NationalityID'];
|
||||||
|
dateofBirthN = json['DateofBirthN'];
|
||||||
|
emailAddress = json['EmailAddress'];
|
||||||
|
sourceType = json['SourceType'];
|
||||||
|
preferredLanguage = json['PreferredLanguage'];
|
||||||
|
marital = json['Marital'];
|
||||||
|
eHealthIDField = json['eHealthIDField'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['TempValue'] = this.tempValue;
|
||||||
|
data['PatientIdentificationType'] = this.patientIdentificationType;
|
||||||
|
data['PatientIdentificationNo'] = this.patientIdentificationNo;
|
||||||
|
data['MobileNumber'] = this.mobileNumber;
|
||||||
|
data['PatientOutSA'] = this.patientOutSA;
|
||||||
|
data['FirstNameN'] = this.firstNameN;
|
||||||
|
data['MiddleNameN'] = this.middleNameN;
|
||||||
|
data['LastNameN'] = this.lastNameN;
|
||||||
|
data['FirstName'] = this.firstName;
|
||||||
|
data['MiddleName'] = this.middleName;
|
||||||
|
data['LastName'] = this.lastName;
|
||||||
|
data['StrDateofBirth'] = this.strDateofBirth;
|
||||||
|
data['DateofBirth'] = this.dateofBirth;
|
||||||
|
data['Gender'] = this.gender;
|
||||||
|
data['NationalityID'] = this.nationalityID;
|
||||||
|
data['DateofBirthN'] = this.dateofBirthN;
|
||||||
|
data['EmailAddress'] = this.emailAddress;
|
||||||
|
data['SourceType'] = this.sourceType;
|
||||||
|
data['PreferredLanguage'] = this.preferredLanguage;
|
||||||
|
data['Marital'] = this.marital;
|
||||||
|
data['eHealthIDField'] = this.eHealthIDField;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,109 @@
|
|||||||
|
class SendActivationCodeByOTPNotificationTypeForRegistrationModel {
|
||||||
|
int patientMobileNumber;
|
||||||
|
String mobileNo;
|
||||||
|
int projectOutSA;
|
||||||
|
int loginType;
|
||||||
|
String zipCode;
|
||||||
|
bool isRegister;
|
||||||
|
String logInTokenID;
|
||||||
|
int searchType;
|
||||||
|
int patientID;
|
||||||
|
int nationalID;
|
||||||
|
int patientIdentificationID;
|
||||||
|
int oTPSendType;
|
||||||
|
int languageID;
|
||||||
|
double versionID;
|
||||||
|
int channel;
|
||||||
|
String iPAdress;
|
||||||
|
String generalid;
|
||||||
|
int patientOutSA;
|
||||||
|
Null sessionID;
|
||||||
|
bool isDentalAllowedBackend;
|
||||||
|
int deviceTypeID;
|
||||||
|
String dOB;
|
||||||
|
int isHijri;
|
||||||
|
String healthId;
|
||||||
|
|
||||||
|
SendActivationCodeByOTPNotificationTypeForRegistrationModel(
|
||||||
|
{this.patientMobileNumber,
|
||||||
|
this.mobileNo,
|
||||||
|
this.projectOutSA,
|
||||||
|
this.loginType,
|
||||||
|
this.zipCode,
|
||||||
|
this.isRegister,
|
||||||
|
this.logInTokenID,
|
||||||
|
this.searchType,
|
||||||
|
this.patientID,
|
||||||
|
this.nationalID,
|
||||||
|
this.patientIdentificationID,
|
||||||
|
this.oTPSendType,
|
||||||
|
this.languageID,
|
||||||
|
this.versionID,
|
||||||
|
this.channel,
|
||||||
|
this.iPAdress,
|
||||||
|
this.generalid,
|
||||||
|
this.patientOutSA,
|
||||||
|
this.sessionID,
|
||||||
|
this.isDentalAllowedBackend,
|
||||||
|
this.deviceTypeID,
|
||||||
|
this.dOB,
|
||||||
|
this.isHijri,
|
||||||
|
this.healthId});
|
||||||
|
|
||||||
|
SendActivationCodeByOTPNotificationTypeForRegistrationModel.fromJson(
|
||||||
|
Map<String, dynamic> json) {
|
||||||
|
patientMobileNumber = json['PatientMobileNumber'];
|
||||||
|
mobileNo = json['MobileNo'];
|
||||||
|
projectOutSA = json['ProjectOutSA'];
|
||||||
|
loginType = json['LoginType'];
|
||||||
|
zipCode = json['ZipCode'];
|
||||||
|
isRegister = json['isRegister'];
|
||||||
|
logInTokenID = json['LogInTokenID'];
|
||||||
|
searchType = json['SearchType'];
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
nationalID = json['NationalID'];
|
||||||
|
patientIdentificationID = json['PatientIdentificationID'];
|
||||||
|
oTPSendType = json['OTP_SendType'];
|
||||||
|
languageID = json['LanguageID'];
|
||||||
|
versionID = json['VersionID'];
|
||||||
|
channel = json['Channel'];
|
||||||
|
iPAdress = json['IPAdress'];
|
||||||
|
generalid = json['generalid'];
|
||||||
|
patientOutSA = json['PatientOutSA'];
|
||||||
|
sessionID = json['SessionID'];
|
||||||
|
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||||
|
deviceTypeID = json['DeviceTypeID'];
|
||||||
|
dOB = json['DOB'];
|
||||||
|
isHijri = json['IsHijri'];
|
||||||
|
healthId = json['HealthId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['PatientMobileNumber'] = this.patientMobileNumber;
|
||||||
|
data['MobileNo'] = this.mobileNo;
|
||||||
|
data['ProjectOutSA'] = this.projectOutSA;
|
||||||
|
data['LoginType'] = this.loginType;
|
||||||
|
data['ZipCode'] = this.zipCode;
|
||||||
|
data['isRegister'] = this.isRegister;
|
||||||
|
data['LogInTokenID'] = this.logInTokenID;
|
||||||
|
data['SearchType'] = this.searchType;
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['NationalID'] = this.nationalID;
|
||||||
|
data['PatientIdentificationID'] = this.patientIdentificationID;
|
||||||
|
data['OTP_SendType'] = this.oTPSendType;
|
||||||
|
data['LanguageID'] = this.languageID;
|
||||||
|
data['VersionID'] = this.versionID;
|
||||||
|
data['Channel'] = this.channel;
|
||||||
|
data['IPAdress'] = this.iPAdress;
|
||||||
|
data['generalid'] = this.generalid;
|
||||||
|
data['PatientOutSA'] = this.patientOutSA;
|
||||||
|
data['SessionID'] = this.sessionID;
|
||||||
|
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||||
|
data['DeviceTypeID'] = this.deviceTypeID;
|
||||||
|
data['DOB'] = this.dOB;
|
||||||
|
data['IsHijri'] = this.isHijri;
|
||||||
|
data['HealthId'] = this.healthId;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
class DiabeticType {
|
||||||
|
int value;
|
||||||
|
String nameEn;
|
||||||
|
String nameAr;
|
||||||
|
|
||||||
|
DiabeticType({this.value, this.nameEn, this.nameAr});
|
||||||
|
|
||||||
|
DiabeticType.fromJson(Map<String, dynamic> json) {
|
||||||
|
value = json['value'];
|
||||||
|
nameEn = json['nameEn'];
|
||||||
|
nameAr = json['nameAr'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['value'] = this.value;
|
||||||
|
data['nameEn'] = this.nameEn;
|
||||||
|
data['nameAr'] = this.nameAr;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
class GetDiabeticChartValuesRequestModel {
|
||||||
|
int deviceTypeID;
|
||||||
|
int patientID;
|
||||||
|
int resultType;
|
||||||
|
int admissionNo;
|
||||||
|
String setupID;
|
||||||
|
bool patientOutSA;
|
||||||
|
int patientType;
|
||||||
|
int patientTypeID;
|
||||||
|
|
||||||
|
GetDiabeticChartValuesRequestModel(
|
||||||
|
{this.deviceTypeID,
|
||||||
|
this.patientID,
|
||||||
|
this.resultType,
|
||||||
|
this.admissionNo,
|
||||||
|
this.setupID,
|
||||||
|
this.patientOutSA,
|
||||||
|
this.patientType,
|
||||||
|
this.patientTypeID});
|
||||||
|
|
||||||
|
GetDiabeticChartValuesRequestModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
deviceTypeID = json['DeviceTypeID'];
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
resultType = json['ResultType'];
|
||||||
|
admissionNo = json['AdmissionNo'];
|
||||||
|
setupID = json['SetupID'];
|
||||||
|
patientOutSA = json['PatientOutSA'];
|
||||||
|
patientType = json['PatientType'];
|
||||||
|
patientTypeID = json['PatientTypeID'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['DeviceTypeID'] = this.deviceTypeID;
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['ResultType'] = this.resultType;
|
||||||
|
data['AdmissionNo'] = this.admissionNo;
|
||||||
|
data['SetupID'] = this.setupID;
|
||||||
|
data['PatientOutSA'] = this.patientOutSA;
|
||||||
|
data['PatientType'] = this.patientType;
|
||||||
|
data['PatientTypeID'] = this.patientTypeID;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
class GetDiabeticChartValuesResponseModel {
|
||||||
|
String resultType;
|
||||||
|
int admissionNo;
|
||||||
|
String dateChart;
|
||||||
|
int resultValue;
|
||||||
|
int createdBy;
|
||||||
|
String createdOn;
|
||||||
|
|
||||||
|
GetDiabeticChartValuesResponseModel(
|
||||||
|
{this.resultType,
|
||||||
|
this.admissionNo,
|
||||||
|
this.dateChart,
|
||||||
|
this.resultValue,
|
||||||
|
this.createdBy,
|
||||||
|
this.createdOn});
|
||||||
|
|
||||||
|
GetDiabeticChartValuesResponseModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
resultType = json['ResultType'];
|
||||||
|
admissionNo = json['AdmissionNo'];
|
||||||
|
dateChart = json['DateChart'];
|
||||||
|
resultValue = json['ResultValue'];
|
||||||
|
createdBy = json['CreatedBy'];
|
||||||
|
createdOn = json['CreatedOn'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['ResultType'] = this.resultType;
|
||||||
|
data['AdmissionNo'] = this.admissionNo;
|
||||||
|
data['DateChart'] = this.dateChart;
|
||||||
|
data['ResultValue'] = this.resultValue;
|
||||||
|
data['CreatedBy'] = this.createdBy;
|
||||||
|
data['CreatedOn'] = this.createdOn;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckActivationCodeModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
||||||
|
|
||||||
|
class PatientRegistrationService extends BaseService {
|
||||||
|
checkPatientForRegistration(
|
||||||
|
CheckPatientForRegistrationModel registrationModel) async {
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.post(CHECK_PATIENT_FOR_REGISTRATION,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: registrationModel.toJson());
|
||||||
|
}
|
||||||
|
|
||||||
|
sendActivationCodeByOTPNotificationType(
|
||||||
|
SendActivationCodeByOTPNotificationTypeForRegistrationModel
|
||||||
|
registrationModel) async {
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.post(SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: registrationModel.toJson());
|
||||||
|
}
|
||||||
|
|
||||||
|
checkActivationCode(CheckActivationCodeModel registrationModel) async {
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_PATIENT,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: registrationModel.toJson());
|
||||||
|
}
|
||||||
|
|
||||||
|
registrationPatient(PatientRegistrationModel registrationModel) async {
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.post(PATIENT_REGISTRATION,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: registrationModel.toJson());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckActivationCodeModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/service/PatientRegistrationService.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
|
||||||
|
|
||||||
|
import '../../locator.dart';
|
||||||
|
|
||||||
|
class PatientRegistrationViewModel extends BaseViewModel {
|
||||||
|
PatientRegistrationService _patientRegistrationService =
|
||||||
|
locator<PatientRegistrationService>();
|
||||||
|
|
||||||
|
Future checkPatientForRegistration(
|
||||||
|
CheckPatientForRegistrationModel registrationModel) async {
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _patientRegistrationService
|
||||||
|
.checkPatientForRegistration(registrationModel);
|
||||||
|
if (_patientRegistrationService.hasError) {
|
||||||
|
error = _patientRegistrationService.error;
|
||||||
|
setState(ViewState.Error);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future sendActivationCodeByOTPNotificationType(
|
||||||
|
SendActivationCodeByOTPNotificationTypeForRegistrationModel
|
||||||
|
registrationModel) async {
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _patientRegistrationService
|
||||||
|
.sendActivationCodeByOTPNotificationType(registrationModel);
|
||||||
|
if (_patientRegistrationService.hasError) {
|
||||||
|
error = _patientRegistrationService.error;
|
||||||
|
setState(ViewState.Error);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future checkActivationCode(CheckActivationCodeModel registrationModel) async {
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _patientRegistrationService.checkActivationCode(registrationModel);
|
||||||
|
if (_patientRegistrationService.hasError) {
|
||||||
|
error = _patientRegistrationService.error;
|
||||||
|
setState(ViewState.Error);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future registrationPatient(PatientRegistrationModel registrationModel) async {
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _patientRegistrationService.registrationPatient(registrationModel);
|
||||||
|
if (_patientRegistrationService.hasError) {
|
||||||
|
error = _patientRegistrationService.error;
|
||||||
|
setState(ViewState.Error);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,255 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/diabetic_chart/DiabeticType.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
import 'diabetic_details_blood_pressurewideget.dart';
|
||||||
|
|
||||||
|
class DiabeticChart extends StatefulWidget {
|
||||||
|
DiabeticChart({
|
||||||
|
Key key,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_DiabeticChartState createState() => _DiabeticChartState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DiabeticChartState extends State<DiabeticChart> {
|
||||||
|
List<TimeSeriesSales2> timeSeriesData1 = [];
|
||||||
|
|
||||||
|
List<TimeSeriesSales2> timeSeriesData2 = [];
|
||||||
|
|
||||||
|
List<DiabeticType> diabeticType = [
|
||||||
|
DiabeticType(nameAr: "Urine Glucose", nameEn: "Urine Glucose", value: 1),
|
||||||
|
DiabeticType(nameAr: "Urine Acet", nameEn: "Urine Acet", value: 2),
|
||||||
|
DiabeticType(nameAr: "Blood Glucose", nameEn: "Blood Glucose", value: 3),
|
||||||
|
DiabeticType(nameAr: "Blood Glucose(Glucometer)", nameEn: "Blood Glucose(Glucometer)", value: 4)
|
||||||
|
];
|
||||||
|
|
||||||
|
DiabeticType selectedDiabeticType;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||||
|
PatiantInformtion patient = routeArgs['patient'];
|
||||||
|
ProjectViewModel projectsProvider = Provider.of(context);
|
||||||
|
return BaseView<PatientViewModel>(
|
||||||
|
onModelReady: (model) async {
|
||||||
|
selectedDiabeticType = diabeticType[2];
|
||||||
|
|
||||||
|
await model.getDiabeticChartValues(patient, selectedDiabeticType.value, isLocalBusy: false);
|
||||||
|
generateData(model);
|
||||||
|
},
|
||||||
|
builder: (_, model, w) => AppScaffold(
|
||||||
|
baseViewModel: model,
|
||||||
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
|
appBar: PatientProfileAppBar(
|
||||||
|
patient,
|
||||||
|
isInpatient: true,
|
||||||
|
),
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.7,
|
||||||
|
child: DropdownButtonHideUnderline(
|
||||||
|
child: DropdownButton(
|
||||||
|
dropdownColor: Colors.white,
|
||||||
|
iconEnabledColor: Colors.black,
|
||||||
|
isExpanded: true,
|
||||||
|
value: selectedDiabeticType.value,
|
||||||
|
iconSize: 25,
|
||||||
|
elevation: 16,
|
||||||
|
selectedItemBuilder: (BuildContext context) {
|
||||||
|
return diabeticType
|
||||||
|
.map((item) {
|
||||||
|
return Row(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.end,
|
||||||
|
children: <Widget>[
|
||||||
|
Column(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
|
||||||
|
padding: EdgeInsets.all(2),
|
||||||
|
margin: EdgeInsets.all(2),
|
||||||
|
decoration: new BoxDecoration(
|
||||||
|
color: Colors.red[800],
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(
|
||||||
|
20),
|
||||||
|
),
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
minWidth: 20,
|
||||||
|
minHeight: 20,
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: AppText(
|
||||||
|
diabeticType
|
||||||
|
.length
|
||||||
|
.toString(),
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: projectsProvider
|
||||||
|
.isArabic
|
||||||
|
? 10
|
||||||
|
: 11,
|
||||||
|
textAlign:
|
||||||
|
TextAlign.center,
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
AppText(
|
||||||
|
selectedDiabeticType.nameEn,
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
textAlign: TextAlign.end),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}).toList();
|
||||||
|
},
|
||||||
|
onChanged: (newValue) async {
|
||||||
|
await onChangeFunc(newValue, model, patient);
|
||||||
|
setState(() {
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
|
items: diabeticType
|
||||||
|
.map((item) {
|
||||||
|
return DropdownMenuItem(
|
||||||
|
child: AppText(
|
||||||
|
item.nameEn,
|
||||||
|
textAlign: TextAlign.left,
|
||||||
|
),
|
||||||
|
value: item.value,
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
timeSeriesData1.length != 0 || timeSeriesData2.length != 0
|
||||||
|
? Padding(
|
||||||
|
padding: const EdgeInsets.all(10.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.symmetric(horizontal: 8),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(12)),
|
||||||
|
child: LineChartForDiabetic(
|
||||||
|
title: selectedDiabeticType.nameEn,
|
||||||
|
isOX: false,
|
||||||
|
timeSeries1: timeSeriesData1,
|
||||||
|
// timeSeries2: timeSeriesData2,
|
||||||
|
indexes: timeSeriesData1.length ~/ 5.5,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.symmetric(
|
||||||
|
horizontal: 8, vertical: 16),
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
top: 16, right: 18.0, left: 16.0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(12)),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
AppText(
|
||||||
|
TranslationBase.of(context).graphDetails,
|
||||||
|
fontSize: SizeConfig.textMultiplier * 2.3,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontFamily: 'Poppins',
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 8,
|
||||||
|
),
|
||||||
|
DiabeticDetails(
|
||||||
|
diabeticDetailsList:
|
||||||
|
model.diabeticChartValuesList,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: ErrorMessage(error: TranslationBase.of(context).noItem),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
generateData(PatientViewModel model) {
|
||||||
|
if (model.diabeticChartValuesList.length > 0) {
|
||||||
|
model.diabeticChartValuesList.toList().forEach(
|
||||||
|
(element) {
|
||||||
|
DateTime elementDate =
|
||||||
|
AppDateUtils.getDateTimeFromServerFormat(element.dateChart);
|
||||||
|
if (element.resultValue.toInt() != 0)
|
||||||
|
timeSeriesData1.add(
|
||||||
|
TimeSeriesSales2(
|
||||||
|
new DateTime(
|
||||||
|
elementDate.year, elementDate.month, elementDate.day),
|
||||||
|
element.resultValue.toDouble(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
if (element.resultValue.toInt() != 0)
|
||||||
|
timeSeriesData2.add(
|
||||||
|
TimeSeriesSales2(
|
||||||
|
new DateTime(
|
||||||
|
elementDate.year, elementDate.month, elementDate.day),
|
||||||
|
element.resultValue.toDouble(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onChangeFunc(newValue, PatientViewModel model, patient) async {
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
setState(() {
|
||||||
|
selectedDiabeticType = diabeticType[newValue-1];
|
||||||
|
timeSeriesData1.clear();
|
||||||
|
timeSeriesData2.clear();
|
||||||
|
});
|
||||||
|
|
||||||
|
await model.getDiabeticChartValues(patient, selectedDiabeticType.value,isLocalBusy:true);
|
||||||
|
if(model.state == ViewState.ErrorLocal){
|
||||||
|
Helpers.showErrorToast(model.error);
|
||||||
|
}
|
||||||
|
generateData(model);
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,123 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class DiabeticDetails extends StatefulWidget {
|
||||||
|
final List<GetDiabeticChartValuesResponseModel> diabeticDetailsList;
|
||||||
|
|
||||||
|
DiabeticDetails(
|
||||||
|
{Key key, this.diabeticDetailsList,});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _VitalSignDetailsWidgetState extends State<DiabeticDetails> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
ProjectViewModel projectViewModel = Provider.of(context);
|
||||||
|
return Container(
|
||||||
|
margin: EdgeInsets.all(0),
|
||||||
|
child: Container(
|
||||||
|
color: Colors.transparent,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(8),
|
||||||
|
child: AppText(
|
||||||
|
TranslationBase.of(context).date,
|
||||||
|
fontSize: SizeConfig.textMultiplier * 1.5,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
|
||||||
|
fontFamily: 'Poppins',
|
||||||
|
),
|
||||||
|
// height: 60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(8),
|
||||||
|
child: Container(
|
||||||
|
child: AppText(
|
||||||
|
"Result",
|
||||||
|
fontSize: SizeConfig.textMultiplier * 1.5,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontFamily: 'Poppins',
|
||||||
|
),
|
||||||
|
// height: 60
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const Divider(
|
||||||
|
height: 1,
|
||||||
|
thickness: 1,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
Table(
|
||||||
|
border: TableBorder(
|
||||||
|
horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]),
|
||||||
|
),
|
||||||
|
children: fullData(projectViewModel),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<TableRow> fullData(ProjectViewModel projectViewModel) {
|
||||||
|
List<TableRow> tableRow = [];
|
||||||
|
widget.diabeticDetailsList.forEach((diabetic) {
|
||||||
|
var data = diabetic.resultValue;
|
||||||
|
DateTime elementDate =
|
||||||
|
AppDateUtils.getDateTimeFromServerFormat(diabetic.dateChart);
|
||||||
|
if (data != 0)
|
||||||
|
tableRow.add(TableRow(children: [
|
||||||
|
Container(
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
color: Colors.white,
|
||||||
|
child: AppText(
|
||||||
|
'${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(elementDate.weekday) : AppDateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(elementDate.month) : AppDateUtils.getMonth(elementDate.month)}, ${elementDate.year} ${AppDateUtils.getHour(elementDate)}',
|
||||||
|
// textAlign: TextAlign.center,
|
||||||
|
fontSize: SizeConfig.textMultiplier * 1.6,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
|
||||||
|
fontFamily: 'Poppins',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
color: Colors.white,
|
||||||
|
child: AppText(
|
||||||
|
'${diabetic.resultValue}',
|
||||||
|
// textAlign: TextAlign.center,
|
||||||
|
fontSize: SizeConfig.textMultiplier * 1.6,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
|
||||||
|
fontFamily: 'Poppins',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]));
|
||||||
|
});
|
||||||
|
return tableRow;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,237 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:fl_chart/fl_chart.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class LineChartForDiabetic extends StatelessWidget {
|
||||||
|
final String title;
|
||||||
|
final List<TimeSeriesSales2> timeSeries1;
|
||||||
|
final int indexes;
|
||||||
|
final bool isOX;
|
||||||
|
|
||||||
|
LineChartForDiabetic(
|
||||||
|
{this.title, this.timeSeries1, this.indexes, this.isOX= false});
|
||||||
|
|
||||||
|
List<int> xAxixs = List();
|
||||||
|
List<double> yAxixs = List();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
getXaxix();
|
||||||
|
return AspectRatio(
|
||||||
|
aspectRatio: 1.1,
|
||||||
|
child: Container(
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(18)),
|
||||||
|
// color: Colors.white,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
children: <Widget>[
|
||||||
|
const SizedBox(
|
||||||
|
height: 4,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.only(right: 18.0, left: 16.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
AppText(
|
||||||
|
title,
|
||||||
|
fontSize: SizeConfig.textMultiplier * 2.1,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontFamily: 'Poppins',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.only(right: 18.0, left: 16.0, top: 15),
|
||||||
|
child: LineChart(
|
||||||
|
sampleData1(context),
|
||||||
|
swapAnimationDuration: const Duration(milliseconds: 250),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
getXaxix() {
|
||||||
|
for (int index = 0; index < timeSeries1.length; index++) {
|
||||||
|
int mIndex = indexes * index;
|
||||||
|
if (mIndex < timeSeries1.length) {
|
||||||
|
xAxixs.add(mIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LineChartData sampleData1(context) {
|
||||||
|
return LineChartData(
|
||||||
|
lineTouchData: LineTouchData(
|
||||||
|
touchTooltipData: LineTouchTooltipData(
|
||||||
|
tooltipBgColor: Colors.white,
|
||||||
|
),
|
||||||
|
touchCallback: (LineTouchResponse touchResponse) {},
|
||||||
|
handleBuiltInTouches: true,
|
||||||
|
),
|
||||||
|
gridData: FlGridData(
|
||||||
|
show: true, drawVerticalLine: true, drawHorizontalLine: true),
|
||||||
|
titlesData: FlTitlesData(
|
||||||
|
bottomTitles: SideTitles(
|
||||||
|
showTitles: true,
|
||||||
|
getTextStyles: (value) => const TextStyle(
|
||||||
|
color: Colors.black,
|
||||||
|
fontSize: 10,
|
||||||
|
),
|
||||||
|
rotateAngle: -65,
|
||||||
|
//rotateAngle:-65,
|
||||||
|
interval: 100,
|
||||||
|
margin: 22,
|
||||||
|
getTitles: (value) {
|
||||||
|
if (timeSeries1.length < 15) {
|
||||||
|
if (timeSeries1.length > value.toInt()) {
|
||||||
|
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
|
||||||
|
} else
|
||||||
|
return '';
|
||||||
|
} else {
|
||||||
|
if (value.toInt() == 0)
|
||||||
|
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
|
||||||
|
if (value.toInt() == timeSeries1.length - 1)
|
||||||
|
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
|
||||||
|
if (xAxixs.contains(value.toInt())) {
|
||||||
|
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
),
|
||||||
|
leftTitles: SideTitles(
|
||||||
|
showTitles: true,
|
||||||
|
getTextStyles: (value) => const TextStyle(
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 10,
|
||||||
|
),
|
||||||
|
interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200,
|
||||||
|
|
||||||
|
margin: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
borderData: FlBorderData(
|
||||||
|
show: true,
|
||||||
|
border: const Border(
|
||||||
|
bottom: BorderSide(
|
||||||
|
color: Colors.black,
|
||||||
|
width: 0.5,
|
||||||
|
),
|
||||||
|
left: BorderSide(
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
right: BorderSide(
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
top: BorderSide(
|
||||||
|
color: Colors.transparent,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
minX: 0,
|
||||||
|
maxX: (timeSeries1.length - 1).toDouble(),
|
||||||
|
maxY: getMaxY() + 0.3,
|
||||||
|
minY: getMinY(),
|
||||||
|
lineBarsData: getData(context),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
double getMaxY() {
|
||||||
|
double max = 0;
|
||||||
|
timeSeries1.forEach((element) {
|
||||||
|
double resultValueDouble = element.sales;
|
||||||
|
if (resultValueDouble > max) max = resultValueDouble;
|
||||||
|
});
|
||||||
|
// timeSeries2.forEach((element) {
|
||||||
|
// double resultValueDouble = element.sales;
|
||||||
|
// if (resultValueDouble > max) max = resultValueDouble;
|
||||||
|
// });
|
||||||
|
|
||||||
|
return max.roundToDouble();
|
||||||
|
}
|
||||||
|
|
||||||
|
double getMinY() {
|
||||||
|
double min = timeSeries1[0].sales;
|
||||||
|
timeSeries1.forEach((element) {
|
||||||
|
double resultValueDouble = element.sales;
|
||||||
|
if (resultValueDouble < min) min = resultValueDouble;
|
||||||
|
});
|
||||||
|
// timeSeries2.forEach((element) {
|
||||||
|
// double resultValueDouble = element.sales;
|
||||||
|
// if (resultValueDouble < min) min = resultValueDouble;
|
||||||
|
// });
|
||||||
|
|
||||||
|
int value = min.toInt();
|
||||||
|
|
||||||
|
return value.toDouble();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<LineChartBarData> getData(context) {
|
||||||
|
List<FlSpot> spots = List();
|
||||||
|
for (int index = 0; index < timeSeries1.length; index++) {
|
||||||
|
spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales));
|
||||||
|
}
|
||||||
|
|
||||||
|
List<FlSpot> spots2 = List();
|
||||||
|
// for (int index = 0; index < timeSeries2.length; index++) {
|
||||||
|
// spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales));
|
||||||
|
// }
|
||||||
|
|
||||||
|
final LineChartBarData lineChartBarData1 = LineChartBarData(
|
||||||
|
spots: spots,
|
||||||
|
isCurved: true,
|
||||||
|
colors: [Colors.red],
|
||||||
|
barWidth: 5,
|
||||||
|
isStrokeCapRound: true,
|
||||||
|
dotData: FlDotData(
|
||||||
|
show: false,
|
||||||
|
),
|
||||||
|
belowBarData: BarAreaData(
|
||||||
|
show: false,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
final LineChartBarData lineChartBarData2 = LineChartBarData(
|
||||||
|
spots: spots2,
|
||||||
|
isCurved: true,
|
||||||
|
colors: [Colors.red],
|
||||||
|
barWidth: 5,
|
||||||
|
isStrokeCapRound: true,
|
||||||
|
dotData: FlDotData(
|
||||||
|
show: false,
|
||||||
|
),
|
||||||
|
belowBarData: BarAreaData(
|
||||||
|
show: false,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
List<LineChartBarData> lineChartData = List();
|
||||||
|
if(spots.isNotEmpty){
|
||||||
|
lineChartData.add(lineChartBarData1);
|
||||||
|
}
|
||||||
|
if(spots2.isNotEmpty){
|
||||||
|
lineChartData.add(lineChartBarData2);
|
||||||
|
}
|
||||||
|
return lineChartData;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,211 @@
|
|||||||
|
import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page-stepper-widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'RegisterSearchPatientPage.dart';
|
||||||
|
|
||||||
|
class RegisterPatientPage extends StatefulWidget {
|
||||||
|
const RegisterPatientPage({Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_RegisterPatientPageState createState() => _RegisterPatientPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _RegisterPatientPageState extends State<RegisterPatientPage>
|
||||||
|
with TickerProviderStateMixin {
|
||||||
|
PageController _controller;
|
||||||
|
int _currentIndex = 0;
|
||||||
|
bool _isLoading = false;
|
||||||
|
|
||||||
|
changePageViewIndex(pageIndex, {isChangeState = true}) {
|
||||||
|
if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true);
|
||||||
|
_controller.jumpToPage(pageIndex);
|
||||||
|
setState(() {
|
||||||
|
_currentIndex = pageIndex;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void changeLoadingState(bool isLoading) {
|
||||||
|
setState(() {
|
||||||
|
_isLoading = isLoading;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
_controller = new PageController();
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_controller.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final screenSize = MediaQuery.of(context).size;
|
||||||
|
|
||||||
|
return BaseView<PatientRegistrationViewModel>(
|
||||||
|
builder: (_, model, w) => AppScaffold(
|
||||||
|
baseViewModel: model,
|
||||||
|
isShowAppBar: true,
|
||||||
|
isLoading: _isLoading,
|
||||||
|
appBar: PatientSearchHeader(
|
||||||
|
title: TranslationBase.of(context).registeraPatient,
|
||||||
|
),
|
||||||
|
body: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
PageStepperWidget(
|
||||||
|
stepsCount: 3,
|
||||||
|
currentStepIndex: _currentIndex + 1,
|
||||||
|
screenSize: screenSize,
|
||||||
|
stepsTitles: [
|
||||||
|
"Search",
|
||||||
|
"Activation",
|
||||||
|
"Confirmation",
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
color: Theme.of(context).scaffoldBackgroundColor,
|
||||||
|
child: PageView(
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
controller: _controller,
|
||||||
|
onPageChanged: (index) {
|
||||||
|
setState(() {
|
||||||
|
_currentIndex = index;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
children: <Widget>[
|
||||||
|
RegisterSearchPatientPage(),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
_isLoading
|
||||||
|
? Container(
|
||||||
|
height: 0,
|
||||||
|
)
|
||||||
|
: pagerButtons(model),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget pagerButtons(PatientRegistrationViewModel model) {
|
||||||
|
switch (_currentIndex) {
|
||||||
|
case 2:
|
||||||
|
return Container(
|
||||||
|
margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: AppButton(
|
||||||
|
title: TranslationBase.of(context).cancel,
|
||||||
|
hasBorder: true,
|
||||||
|
vPadding: 12,
|
||||||
|
hPadding: 8,
|
||||||
|
borderColor: Color(0xFFeaeaea),
|
||||||
|
color: Color(0xFFeaeaea),
|
||||||
|
fontColor: Colors.black,
|
||||||
|
fontSize: 2.2,
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 8,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: AppButton(
|
||||||
|
title: TranslationBase.of(context).noteConfirm,
|
||||||
|
hasBorder: true,
|
||||||
|
vPadding: 12,
|
||||||
|
hPadding: 8,
|
||||||
|
borderColor: Color(0xFF359846),
|
||||||
|
color: Color(0xFF359846),
|
||||||
|
fontColor: Colors.white,
|
||||||
|
fontSize: 2.0,
|
||||||
|
onPressed: () {},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
default:
|
||||||
|
return Container(
|
||||||
|
color: Colors.white,
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 16, horizontal: 16),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: AppButton(
|
||||||
|
title: TranslationBase.of(context).cancel,
|
||||||
|
hasBorder: true,
|
||||||
|
vPadding: 12,
|
||||||
|
hPadding: 8,
|
||||||
|
borderColor: Color(0xFFeaeaea),
|
||||||
|
color: Color(0xFFeaeaea),
|
||||||
|
fontColor: Colors.black,
|
||||||
|
fontSize: 2.2,
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 8,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: AppButton(
|
||||||
|
title: TranslationBase.of(context).next,
|
||||||
|
hasBorder: true,
|
||||||
|
vPadding: 12,
|
||||||
|
hPadding: 8,
|
||||||
|
borderColor: Color(0xFFB8382B),
|
||||||
|
color: Color(0xFFB8382B),
|
||||||
|
fontColor: Colors.white,
|
||||||
|
fontSize: 2.0,
|
||||||
|
onPressed: () {
|
||||||
|
changePageViewIndex(_currentIndex + 1);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,202 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart';
|
||||||
|
|
||||||
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||||
|
|
||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
|
||||||
|
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class RegisterSearchPatientPage extends StatefulWidget {
|
||||||
|
const RegisterSearchPatientPage({Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_RegisterSearchPatientPageState createState() =>
|
||||||
|
_RegisterSearchPatientPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
||||||
|
String countryError;
|
||||||
|
dynamic _selectedCountry;
|
||||||
|
|
||||||
|
final _phoneController = TextEditingController();
|
||||||
|
String phoneError;
|
||||||
|
|
||||||
|
final _idController = TextEditingController();
|
||||||
|
String idError;
|
||||||
|
|
||||||
|
DateTime _birthDate;
|
||||||
|
String birthdateError;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final screenSize = MediaQuery.of(context).size;
|
||||||
|
|
||||||
|
return BaseView<PatientRegistrationViewModel>(
|
||||||
|
builder: (_, model, w) => AppScaffold(
|
||||||
|
baseViewModel: model,
|
||||||
|
isShowAppBar: false,
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
margin: EdgeInsets.all(16.0),
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
AppText(
|
||||||
|
"Please enter mobile number or Identification number",
|
||||||
|
fontFamily: 'Poppins',
|
||||||
|
fontSize: SizeConfig.textMultiplier * 2.2,
|
||||||
|
fontWeight: FontWeight.w800,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
AppTextFieldCustom(
|
||||||
|
height: screenSize.height * 0.075,
|
||||||
|
hintText: "Country",
|
||||||
|
isTextFieldHasSuffix: true,
|
||||||
|
validationError: countryError,
|
||||||
|
dropDownText: _selectedCountry != null
|
||||||
|
? _selectedCountry['nameEn']
|
||||||
|
: null,
|
||||||
|
enabled: false,
|
||||||
|
/*onClick: model.dietTypesList != null && model.dietTypesList.length > 0
|
||||||
|
? () {
|
||||||
|
openListDialogField('nameEn', 'id', model.dietTypesList, (selectedValue) {
|
||||||
|
setState(() {
|
||||||
|
_selectedCountry = selectedValue;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
: () async {
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
await model
|
||||||
|
.getDietTypes(patient.patientId)
|
||||||
|
.then((_) => GifLoaderDialogUtils.hideDialog(context));
|
||||||
|
if (model.state == ViewState.Idle && model.dietTypesList.length > 0) {
|
||||||
|
openListDialogField('nameEn', 'id', model.dietTypesList, (selectedValue) {
|
||||||
|
setState(() {
|
||||||
|
_selectedCountry = selectedValue;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else if (model.state == ViewState.ErrorLocal) {
|
||||||
|
DrAppToastMsg.showErrorToast(model.error);
|
||||||
|
} else {
|
||||||
|
DrAppToastMsg.showErrorToast("Empty List");
|
||||||
|
}
|
||||||
|
},*/
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
AppTextFieldCustom(
|
||||||
|
height: screenSize.height * 0.075,
|
||||||
|
hintText: "Phone Number",
|
||||||
|
inputType: TextInputType.phone,
|
||||||
|
controller: _phoneController,
|
||||||
|
validationError: phoneError,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
AppTextFieldCustom(
|
||||||
|
height: screenSize.height * 0.075,
|
||||||
|
hintText: "ID Number",
|
||||||
|
inputType: TextInputType.phone,
|
||||||
|
controller: _idController,
|
||||||
|
validationError: idError,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
AppText(
|
||||||
|
"Calender",
|
||||||
|
fontSize: SizeConfig.textMultiplier * 1.8,
|
||||||
|
fontWeight: FontWeight.w800,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
AppTextFieldCustom(
|
||||||
|
height: screenSize.height * 0.075,
|
||||||
|
hintText: "Birthdate",
|
||||||
|
dropDownText: _birthDate != null
|
||||||
|
? "${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "yyyy-MM-dd")}"
|
||||||
|
: null,
|
||||||
|
enabled: false,
|
||||||
|
isTextFieldHasSuffix: true,
|
||||||
|
validationError: birthdateError,
|
||||||
|
suffixIcon: IconButton(
|
||||||
|
icon: Icon(
|
||||||
|
Icons.calendar_today,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
onPressed: null,
|
||||||
|
),
|
||||||
|
onClick: () {
|
||||||
|
if (_birthDate == null) {
|
||||||
|
_birthDate = DateTime.now();
|
||||||
|
}
|
||||||
|
_selectDate(context, _birthDate, (picked) {
|
||||||
|
setState(() {
|
||||||
|
_birthDate = picked;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future _selectDate(BuildContext context, DateTime dateTime,
|
||||||
|
Function(DateTime picked) updateDate) async {
|
||||||
|
final DateTime picked = await showDatePicker(
|
||||||
|
context: context,
|
||||||
|
initialDate: dateTime,
|
||||||
|
firstDate: DateTime.now(),
|
||||||
|
lastDate: DateTime(2040),
|
||||||
|
initialEntryMode: DatePickerEntryMode.calendar,
|
||||||
|
);
|
||||||
|
if (picked != null && picked != dateTime) {
|
||||||
|
updateDate(picked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void openListDialogField(String attributeName, String attributeValueId,
|
||||||
|
List<dynamic> list, Function(dynamic selectedValue) okFunction) {
|
||||||
|
ListSelectDialog dialog = ListSelectDialog(
|
||||||
|
list: list,
|
||||||
|
attributeName: attributeName,
|
||||||
|
attributeValueId: attributeValueId,
|
||||||
|
usingSearch: true,
|
||||||
|
okText: TranslationBase.of(context).ok,
|
||||||
|
okFunction: (selectedValue) {
|
||||||
|
okFunction(selectedValue);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
showDialog(
|
||||||
|
barrierDismissible: false,
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return dialog;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue