Merge branch 'development' into patients-new-design
# Conflicts: # pubspec.lockmerge-requests/367/head
commit
a13dd07734
Binary file not shown.
After Width: | Height: | Size: 388 B |
Binary file not shown.
After Width: | Height: | Size: 594 B |
Binary file not shown.
After Width: | Height: | Size: 639 B |
@ -0,0 +1,2 @@
|
||||
enum FilterType { Clinic, Hospital }
|
||||
|
@ -0,0 +1,140 @@
|
||||
class InsuranceApprovalDetails {
|
||||
String procedureName;
|
||||
String status;
|
||||
String isInvoicedDesc;
|
||||
|
||||
InsuranceApprovalDetails({
|
||||
this.procedureName,
|
||||
this.status,
|
||||
this.isInvoicedDesc,
|
||||
});
|
||||
|
||||
InsuranceApprovalDetails.fromJson(Map<String, dynamic> json) {
|
||||
try {
|
||||
isInvoicedDesc = json['IsInvoicedDesc'];
|
||||
status = json['Status'];
|
||||
procedureName = json['ProcedureName'];
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class InsuranceApprovalModel {
|
||||
InsuranceApprovalDetails approvalDetails;
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
String sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
int patientID;
|
||||
String tokenID;
|
||||
int patientTypeID;
|
||||
int patientType;
|
||||
int eXuldAPPNO;
|
||||
int projectID;
|
||||
String doctorName;
|
||||
String clinicName;
|
||||
String patientDescription;
|
||||
int approvalNo;
|
||||
String approvalStatusDescption;
|
||||
int unUsedCount;
|
||||
|
||||
//String companyName;
|
||||
String expiryDate;
|
||||
String rceiptOn;
|
||||
int appointmentNo;
|
||||
|
||||
InsuranceApprovalModel(
|
||||
{this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID,
|
||||
this.patientID,
|
||||
this.tokenID,
|
||||
this.patientTypeID,
|
||||
this.patientType,
|
||||
this.eXuldAPPNO,
|
||||
this.projectID,
|
||||
this.doctorName,
|
||||
this.clinicName,
|
||||
this.patientDescription,
|
||||
this.approvalNo,
|
||||
this.approvalStatusDescption,
|
||||
this.unUsedCount,
|
||||
//this.companyName,
|
||||
this.expiryDate,
|
||||
this.rceiptOn,
|
||||
this.approvalDetails,
|
||||
this.appointmentNo});
|
||||
|
||||
InsuranceApprovalDetails x = InsuranceApprovalDetails();
|
||||
|
||||
InsuranceApprovalModel.fromJson(Map<String, dynamic> json) {
|
||||
try {
|
||||
rceiptOn = json['ReceiptOn'];
|
||||
expiryDate = json['ExpiryDate'];
|
||||
//companyName = json['CompanyName'];
|
||||
unUsedCount = json['TotaUnUsedCount'];
|
||||
approvalStatusDescption = json['ApprovalStatusDescption'];
|
||||
approvalNo = json['ApprovalNo'];
|
||||
patientDescription = json['IsInOutPatientDescription'];
|
||||
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'];
|
||||
patientID = json['PatientID'];
|
||||
tokenID = json['TokenID'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
patientType = json['PatientType'];
|
||||
eXuldAPPNO = json['EXuldAPPNO'];
|
||||
projectID = json['ProjectID'];
|
||||
doctorName = json['DoctorName'];
|
||||
clinicName = json['ClinicName'];
|
||||
approvalDetails =
|
||||
InsuranceApprovalDetails.fromJson(json['ApporvalDetails'][0]);
|
||||
appointmentNo = json['AppointmentNo'];
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
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['PatientID'] = this.patientID;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
data['PatientType'] = this.patientType;
|
||||
if (appointmentNo == null) {
|
||||
data['EXuldAPPNO'] = this.eXuldAPPNO;
|
||||
data['ProjectID'] = this.projectID;
|
||||
}
|
||||
if (appointmentNo != null) {
|
||||
data['AppointmentNo'] = this.appointmentNo;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
class LabOrderResult {
|
||||
String description;
|
||||
dynamic femaleInterpretativeData;
|
||||
int gender;
|
||||
int lineItemNo;
|
||||
dynamic maleInterpretativeData;
|
||||
dynamic notes;
|
||||
String packageID;
|
||||
int patientID;
|
||||
String projectID;
|
||||
String referanceRange;
|
||||
String resultValue;
|
||||
String sampleCollectedOn;
|
||||
String sampleReceivedOn;
|
||||
String setupID;
|
||||
dynamic superVerifiedOn;
|
||||
String testCode;
|
||||
String uOM;
|
||||
String verifiedOn;
|
||||
String verifiedOnDateTime;
|
||||
|
||||
LabOrderResult(
|
||||
{this.description,
|
||||
this.femaleInterpretativeData,
|
||||
this.gender,
|
||||
this.lineItemNo,
|
||||
this.maleInterpretativeData,
|
||||
this.notes,
|
||||
this.packageID,
|
||||
this.patientID,
|
||||
this.projectID,
|
||||
this.referanceRange,
|
||||
this.resultValue,
|
||||
this.sampleCollectedOn,
|
||||
this.sampleReceivedOn,
|
||||
this.setupID,
|
||||
this.superVerifiedOn,
|
||||
this.testCode,
|
||||
this.uOM,
|
||||
this.verifiedOn,
|
||||
this.verifiedOnDateTime});
|
||||
|
||||
LabOrderResult.fromJson(Map<String, dynamic> json) {
|
||||
description = json['Description'];
|
||||
femaleInterpretativeData = json['FemaleInterpretativeData'];
|
||||
gender = json['Gender'];
|
||||
lineItemNo = json['LineItemNo'];
|
||||
maleInterpretativeData = json['MaleInterpretativeData'];
|
||||
notes = json['Notes'];
|
||||
packageID = json['PackageID'];
|
||||
patientID = json['PatientID'];
|
||||
projectID = json['ProjectID'];
|
||||
referanceRange = json['ReferanceRange'];
|
||||
resultValue = json['ResultValue'];
|
||||
sampleCollectedOn = json['SampleCollectedOn'];
|
||||
sampleReceivedOn = json['SampleReceivedOn'];
|
||||
setupID = json['SetupID'];
|
||||
superVerifiedOn = json['SuperVerifiedOn'];
|
||||
testCode = json['TestCode'];
|
||||
uOM = json['UOM'];
|
||||
verifiedOn = json['VerifiedOn'];
|
||||
verifiedOnDateTime = json['VerifiedOnDateTime'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['Description'] = this.description;
|
||||
data['FemaleInterpretativeData'] = this.femaleInterpretativeData;
|
||||
data['Gender'] = this.gender;
|
||||
data['LineItemNo'] = this.lineItemNo;
|
||||
data['MaleInterpretativeData'] = this.maleInterpretativeData;
|
||||
data['Notes'] = this.notes;
|
||||
data['PackageID'] = this.packageID;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['ReferanceRange'] = this.referanceRange;
|
||||
data['ResultValue'] = this.resultValue;
|
||||
data['SampleCollectedOn'] = this.sampleCollectedOn;
|
||||
data['SampleReceivedOn'] = this.sampleReceivedOn;
|
||||
data['SetupID'] = this.setupID;
|
||||
data['SuperVerifiedOn'] = this.superVerifiedOn;
|
||||
data['TestCode'] = this.testCode;
|
||||
data['UOM'] = this.uOM;
|
||||
data['VerifiedOn'] = this.verifiedOn;
|
||||
data['VerifiedOnDateTime'] = this.verifiedOnDateTime;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
class LabResult {
|
||||
String description;
|
||||
dynamic femaleInterpretativeData;
|
||||
int gender;
|
||||
int lineItemNo;
|
||||
dynamic maleInterpretativeData;
|
||||
String notes;
|
||||
String packageID;
|
||||
int patientID;
|
||||
String projectID;
|
||||
String referanceRange;
|
||||
String resultValue;
|
||||
String sampleCollectedOn;
|
||||
String sampleReceivedOn;
|
||||
String setupID;
|
||||
dynamic superVerifiedOn;
|
||||
String testCode;
|
||||
String uOM;
|
||||
String verifiedOn;
|
||||
dynamic verifiedOnDateTime;
|
||||
|
||||
LabResult(
|
||||
{this.description,
|
||||
this.femaleInterpretativeData,
|
||||
this.gender,
|
||||
this.lineItemNo,
|
||||
this.maleInterpretativeData,
|
||||
this.notes,
|
||||
this.packageID,
|
||||
this.patientID,
|
||||
this.projectID,
|
||||
this.referanceRange,
|
||||
this.resultValue,
|
||||
this.sampleCollectedOn,
|
||||
this.sampleReceivedOn,
|
||||
this.setupID,
|
||||
this.superVerifiedOn,
|
||||
this.testCode,
|
||||
this.uOM,
|
||||
this.verifiedOn,
|
||||
this.verifiedOnDateTime});
|
||||
|
||||
LabResult.fromJson(Map<String, dynamic> json) {
|
||||
description = json['Description'];
|
||||
femaleInterpretativeData = json['FemaleInterpretativeData'];
|
||||
gender = json['Gender'];
|
||||
lineItemNo = json['LineItemNo'];
|
||||
maleInterpretativeData = json['MaleInterpretativeData'];
|
||||
notes = json['Notes'];
|
||||
packageID = json['PackageID'];
|
||||
patientID = json['PatientID'];
|
||||
projectID = json['ProjectID'];
|
||||
referanceRange = json['ReferanceRange'];
|
||||
resultValue = json['ResultValue'];
|
||||
sampleCollectedOn = json['SampleCollectedOn'];
|
||||
sampleReceivedOn = json['SampleReceivedOn'];
|
||||
setupID = json['SetupID'];
|
||||
superVerifiedOn = json['SuperVerifiedOn'];
|
||||
testCode = json['TestCode'];
|
||||
uOM = json['UOM'];
|
||||
verifiedOn = json['VerifiedOn'];
|
||||
verifiedOnDateTime = json['VerifiedOnDateTime'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['Description'] = this.description;
|
||||
data['FemaleInterpretativeData'] = this.femaleInterpretativeData;
|
||||
data['Gender'] = this.gender;
|
||||
data['LineItemNo'] = this.lineItemNo;
|
||||
data['MaleInterpretativeData'] = this.maleInterpretativeData;
|
||||
data['Notes'] = this.notes;
|
||||
data['PackageID'] = this.packageID;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['ReferanceRange'] = this.referanceRange;
|
||||
data['ResultValue'] = this.resultValue;
|
||||
data['SampleCollectedOn'] = this.sampleCollectedOn;
|
||||
data['SampleReceivedOn'] = this.sampleReceivedOn;
|
||||
data['SetupID'] = this.setupID;
|
||||
data['SuperVerifiedOn'] = this.superVerifiedOn;
|
||||
data['TestCode'] = this.testCode;
|
||||
data['UOM'] = this.uOM;
|
||||
data['VerifiedOn'] = this.verifiedOn;
|
||||
data['VerifiedOnDateTime'] = this.verifiedOnDateTime;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class LabResultList {
|
||||
String filterName = "";
|
||||
List<LabResult> patientLabResultList = List();
|
||||
|
||||
LabResultList({this.filterName, LabResult lab}) {
|
||||
patientLabResultList.add(lab);
|
||||
}
|
||||
}
|
@ -0,0 +1,158 @@
|
||||
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||
|
||||
class PatientLabOrders {
|
||||
int actualDoctorRate;
|
||||
String clinicDescription;
|
||||
String clinicDescriptionEnglish;
|
||||
Null clinicDescriptionN;
|
||||
int clinicID;
|
||||
int doctorID;
|
||||
String doctorImageURL;
|
||||
String doctorName;
|
||||
String doctorNameEnglish;
|
||||
Null doctorNameN;
|
||||
int doctorRate;
|
||||
String doctorTitle;
|
||||
int gender;
|
||||
String genderDescription;
|
||||
String invoiceNo;
|
||||
bool isActiveDoctorProfile;
|
||||
bool isDoctorAllowVedioCall;
|
||||
bool isExecludeDoctor;
|
||||
bool isInOutPatient;
|
||||
String isInOutPatientDescription;
|
||||
String isInOutPatientDescriptionN;
|
||||
bool isRead;
|
||||
String nationalityFlagURL;
|
||||
int noOfPatientsRate;
|
||||
DateTime orderDate;
|
||||
String orderNo;
|
||||
String patientID;
|
||||
String projectID;
|
||||
String projectName;
|
||||
Null projectNameN;
|
||||
String qR;
|
||||
String setupID;
|
||||
List<String> speciality;
|
||||
bool isLiveCareAppointment;
|
||||
PatientLabOrders(
|
||||
{this.actualDoctorRate,
|
||||
this.clinicDescription,
|
||||
this.clinicDescriptionEnglish,
|
||||
this.clinicDescriptionN,
|
||||
this.clinicID,
|
||||
this.doctorID,
|
||||
this.doctorImageURL,
|
||||
this.doctorName,
|
||||
this.doctorNameEnglish,
|
||||
this.doctorNameN,
|
||||
this.doctorRate,
|
||||
this.doctorTitle,
|
||||
this.gender,
|
||||
this.genderDescription,
|
||||
this.invoiceNo,
|
||||
this.isActiveDoctorProfile,
|
||||
this.isDoctorAllowVedioCall,
|
||||
this.isExecludeDoctor,
|
||||
this.isInOutPatient,
|
||||
this.isInOutPatientDescription,
|
||||
this.isInOutPatientDescriptionN,
|
||||
this.isRead,
|
||||
this.nationalityFlagURL,
|
||||
this.noOfPatientsRate,
|
||||
this.orderDate,
|
||||
this.orderNo,
|
||||
this.patientID,
|
||||
this.projectID,
|
||||
this.projectName,
|
||||
this.projectNameN,
|
||||
this.qR,
|
||||
this.setupID,
|
||||
this.speciality,this.isLiveCareAppointment});
|
||||
|
||||
PatientLabOrders.fromJson(Map<String, dynamic> json) {
|
||||
actualDoctorRate = json['ActualDoctorRate'];
|
||||
clinicDescription = json['ClinicDescription'];
|
||||
clinicDescriptionEnglish = json['ClinicDescriptionEnglish'];
|
||||
clinicDescriptionN = json['ClinicDescriptionN'];
|
||||
clinicID = json['ClinicID'];
|
||||
doctorID = json['DoctorID'];
|
||||
doctorImageURL = json['DoctorImageURL'];
|
||||
doctorName = json['DoctorName'];
|
||||
doctorNameEnglish = json['DoctorNameEnglish'];
|
||||
doctorNameN = json['DoctorNameN'];
|
||||
doctorRate = json['DoctorRate'];
|
||||
doctorTitle = json['DoctorTitle'];
|
||||
gender = json['Gender'];
|
||||
genderDescription = json['GenderDescription'];
|
||||
invoiceNo = json['InvoiceNo'];
|
||||
isActiveDoctorProfile = json['IsActiveDoctorProfile'];
|
||||
isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall'];
|
||||
isExecludeDoctor = json['IsExecludeDoctor'];
|
||||
isInOutPatient = json['IsInOutPatient'];
|
||||
isInOutPatientDescription = json['IsInOutPatientDescription'];
|
||||
isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN'];
|
||||
isRead = json['IsRead'];
|
||||
nationalityFlagURL = json['NationalityFlagURL'];
|
||||
noOfPatientsRate = json['NoOfPatientsRate'];
|
||||
orderDate = DateUtils.convertStringToDate(json['OrderDate']);
|
||||
orderNo = json['OrderNo'];
|
||||
patientID = json['PatientID'];
|
||||
projectID = json['ProjectID'];
|
||||
projectName = json['ProjectName'];
|
||||
projectNameN = json['ProjectNameN'];
|
||||
qR = json['QR'];
|
||||
setupID = json['SetupID'];
|
||||
isLiveCareAppointment = json['IsLiveCareAppointment'];
|
||||
// speciality = json['Speciality'].cast<String>();
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ActualDoctorRate'] = this.actualDoctorRate;
|
||||
data['ClinicDescription'] = this.clinicDescription;
|
||||
data['ClinicDescriptionEnglish'] = this.clinicDescriptionEnglish;
|
||||
data['ClinicDescriptionN'] = this.clinicDescriptionN;
|
||||
data['ClinicID'] = this.clinicID;
|
||||
data['DoctorID'] = this.doctorID;
|
||||
data['DoctorImageURL'] = this.doctorImageURL;
|
||||
data['DoctorName'] = this.doctorName;
|
||||
data['DoctorNameEnglish'] = this.doctorNameEnglish;
|
||||
data['DoctorNameN'] = this.doctorNameN;
|
||||
data['DoctorRate'] = this.doctorRate;
|
||||
data['DoctorTitle'] = this.doctorTitle;
|
||||
data['Gender'] = this.gender;
|
||||
data['GenderDescription'] = this.genderDescription;
|
||||
data['InvoiceNo'] = this.invoiceNo;
|
||||
data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile;
|
||||
data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall;
|
||||
data['IsExecludeDoctor'] = this.isExecludeDoctor;
|
||||
data['IsInOutPatient'] = this.isInOutPatient;
|
||||
data['IsInOutPatientDescription'] = this.isInOutPatientDescription;
|
||||
data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN;
|
||||
data['IsRead'] = this.isRead;
|
||||
data['NationalityFlagURL'] = this.nationalityFlagURL;
|
||||
data['NoOfPatientsRate'] = this.noOfPatientsRate;
|
||||
data['OrderDate'] = this.orderDate;
|
||||
data['OrderNo'] = this.orderNo;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['ProjectName'] = this.projectName;
|
||||
data['ProjectNameN'] = this.projectNameN;
|
||||
data['QR'] = this.qR;
|
||||
data['SetupID'] = this.setupID;
|
||||
data['Speciality'] = this.speciality;
|
||||
data['IsLiveCareAppointment'] = this.isLiveCareAppointment;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class PatientLabOrdersList {
|
||||
String filterName = "";
|
||||
List<PatientLabOrders> patientLabOrdersList = List();
|
||||
|
||||
PatientLabOrdersList(
|
||||
{this.filterName, PatientLabOrders patientDoctorAppointment}) {
|
||||
patientLabOrdersList.add(patientDoctorAppointment);
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
class PatientLabSpecialResult {
|
||||
String invoiceNo;
|
||||
String moduleID;
|
||||
String resultData;
|
||||
String resultDataHTML;
|
||||
Null resultDataTxt;
|
||||
|
||||
PatientLabSpecialResult(
|
||||
{this.invoiceNo,
|
||||
this.moduleID,
|
||||
this.resultData,
|
||||
this.resultDataHTML,
|
||||
this.resultDataTxt});
|
||||
|
||||
PatientLabSpecialResult.fromJson(Map<String, dynamic> json) {
|
||||
invoiceNo = json['InvoiceNo'];
|
||||
moduleID = json['ModuleID'];
|
||||
resultData = json['ResultData'];
|
||||
resultDataHTML = json['ResultDataHTML'];
|
||||
resultDataTxt = json['ResultDataTxt'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['InvoiceNo'] = this.invoiceNo;
|
||||
data['ModuleID'] = this.moduleID;
|
||||
data['ResultData'] = this.resultData;
|
||||
data['ResultDataHTML'] = this.resultDataHTML;
|
||||
data['ResultDataTxt'] = this.resultDataTxt;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
class RequestPatientLabOrders {
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
String sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
int patientID;
|
||||
String tokenID;
|
||||
int patientTypeID;
|
||||
int patientType;
|
||||
|
||||
RequestPatientLabOrders(
|
||||
{this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID,
|
||||
this.patientID,
|
||||
this.tokenID,
|
||||
this.patientTypeID,
|
||||
this.patientType});
|
||||
|
||||
RequestPatientLabOrders.fromJson(Map<String, dynamic> json) {
|
||||
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'];
|
||||
patientID = json['PatientID'];
|
||||
tokenID = json['TokenID'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
patientType = json['PatientType'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
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['PatientID'] = this.patientID;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
data['PatientType'] = this.patientType;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
class RequestPatientLabSpecialResult {
|
||||
String invoiceNo;
|
||||
String orderNo;
|
||||
String setupID;
|
||||
String projectID;
|
||||
int clinicID;
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
String sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
int patientID;
|
||||
String tokenID;
|
||||
int patientTypeID;
|
||||
int patientType;
|
||||
|
||||
RequestPatientLabSpecialResult(
|
||||
{this.invoiceNo,
|
||||
this.orderNo,
|
||||
this.setupID,
|
||||
this.projectID,
|
||||
this.clinicID,
|
||||
this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID,
|
||||
this.patientID,
|
||||
this.tokenID,
|
||||
this.patientTypeID,
|
||||
this.patientType});
|
||||
|
||||
RequestPatientLabSpecialResult.fromJson(Map<String, dynamic> json) {
|
||||
invoiceNo = json['InvoiceNo'];
|
||||
orderNo = json['OrderNo'];
|
||||
setupID = json['SetupID'];
|
||||
projectID = json['ProjectID'];
|
||||
clinicID = json['ClinicID'];
|
||||
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'];
|
||||
patientID = json['PatientID'];
|
||||
tokenID = json['TokenID'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
patientType = json['PatientType'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['InvoiceNo'] = this.invoiceNo;
|
||||
data['OrderNo'] = this.orderNo;
|
||||
data['SetupID'] = this.setupID;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['ClinicID'] = this.clinicID;
|
||||
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['PatientID'] = this.patientID;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
data['PatientType'] = this.patientType;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,112 @@
|
||||
class RequestSendLabReportEmail {
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
String sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
int patientID;
|
||||
String tokenID;
|
||||
int patientTypeID;
|
||||
int patientType;
|
||||
String to;
|
||||
String dateofBirth;
|
||||
String patientIditificationNum;
|
||||
String patientMobileNumber;
|
||||
String patientName;
|
||||
String setupID;
|
||||
String projectName;
|
||||
String clinicName;
|
||||
String doctorName;
|
||||
String projectID;
|
||||
String invoiceNo;
|
||||
String orderDate;
|
||||
|
||||
RequestSendLabReportEmail(
|
||||
{this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID,
|
||||
this.patientID,
|
||||
this.tokenID,
|
||||
this.patientTypeID,
|
||||
this.patientType,
|
||||
this.to,
|
||||
this.dateofBirth,
|
||||
this.patientIditificationNum,
|
||||
this.patientMobileNumber,
|
||||
this.patientName,
|
||||
this.setupID,
|
||||
this.projectName,
|
||||
this.clinicName,
|
||||
this.doctorName,
|
||||
this.projectID,
|
||||
this.invoiceNo,
|
||||
this.orderDate});
|
||||
|
||||
RequestSendLabReportEmail.fromJson(Map<String, dynamic> json) {
|
||||
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'];
|
||||
patientID = json['PatientID'];
|
||||
tokenID = json['TokenID'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
patientType = json['PatientType'];
|
||||
to = json['To'];
|
||||
dateofBirth = json['DateofBirth'];
|
||||
patientIditificationNum = json['PatientIditificationNum'];
|
||||
patientMobileNumber = json['PatientMobileNumber'];
|
||||
patientName = json['PatientName'];
|
||||
setupID = json['SetupID'];
|
||||
projectName = json['ProjectName'];
|
||||
clinicName = json['ClinicName'];
|
||||
doctorName = json['DoctorName'];
|
||||
projectID = json['ProjectID'];
|
||||
invoiceNo = json['InvoiceNo'];
|
||||
orderDate = json['OrderDate'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
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['PatientID'] = this.patientID;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
data['PatientType'] = this.patientType;
|
||||
data['To'] = this.to;
|
||||
data['DateofBirth'] = this.dateofBirth;
|
||||
data['PatientIditificationNum'] = this.patientIditificationNum;
|
||||
data['PatientMobileNumber'] = this.patientMobileNumber;
|
||||
data['PatientName'] = this.patientName;
|
||||
data['SetupID'] = this.setupID;
|
||||
data['ProjectName'] = this.projectName;
|
||||
data['ClinicName'] = this.clinicName;
|
||||
data['DoctorName'] = this.doctorName;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['InvoiceNo'] = this.invoiceNo;
|
||||
data['OrderDate'] = this.orderDate;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:doctor_app_flutter/core/model/insurance_approval.dart';
|
||||
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
||||
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||
|
||||
class InsuranceCardService extends BaseService {
|
||||
InsuranceApprovalModel _insuranceApprovalModel = InsuranceApprovalModel(
|
||||
isDentalAllowedBackend: false,
|
||||
patientTypeID: 1,
|
||||
patientType: 1,
|
||||
eXuldAPPNO: 0,
|
||||
projectID: 0);
|
||||
|
||||
List<InsuranceApprovalModel> _insuranceApproval = List();
|
||||
|
||||
List<InsuranceApprovalModel> get insuranceApproval => _insuranceApproval;
|
||||
|
||||
Future getInsuranceApproval(PatiantInformtion patient,{int appointmentNo}) async {
|
||||
hasError = false;
|
||||
// _cardList.clear();
|
||||
if (appointmentNo != null) {
|
||||
_insuranceApprovalModel.appointmentNo = appointmentNo;
|
||||
_insuranceApprovalModel.eXuldAPPNO = null;
|
||||
_insuranceApprovalModel.projectID = null;
|
||||
} else {
|
||||
_insuranceApprovalModel.appointmentNo = null;
|
||||
_insuranceApprovalModel.eXuldAPPNO = 0;
|
||||
_insuranceApprovalModel.projectID = 0;
|
||||
}
|
||||
|
||||
await baseAppClient.postPatient(GET_PAtIENTS_INSURANCE_APPROVALS,
|
||||
patient: patient,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
print(response['HIS_Approval_List'].length);
|
||||
_insuranceApproval.clear();
|
||||
_insuranceApproval.length = 0;
|
||||
response['HIS_Approval_List'].forEach((item) {
|
||||
_insuranceApproval.add(InsuranceApprovalModel.fromJson(item));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: _insuranceApprovalModel.toJson());
|
||||
}
|
||||
}
|
@ -0,0 +1,136 @@
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart';
|
||||
import 'package:doctor_app_flutter/core/model/labs/lab_result.dart';
|
||||
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
|
||||
import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart';
|
||||
import 'package:doctor_app_flutter/core/model/labs/request_patient_lab_special_result.dart';
|
||||
import 'package:doctor_app_flutter/core/model/labs/request_send_lab_report_email.dart';
|
||||
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||
|
||||
import 'base/base_service.dart';
|
||||
|
||||
class LabsService extends BaseService {
|
||||
List<PatientLabOrders> patientLabOrdersList = List();
|
||||
|
||||
Future getPatientLabOrdersList(PatiantInformtion patient) async {
|
||||
hasError = false;
|
||||
Map<String, dynamic> body = Map();
|
||||
body['isDentalAllowedBackend'] = false;
|
||||
await baseAppClient.postPatient(GET_Patient_LAB_ORDERS, patient: patient,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
patientLabOrdersList.clear();
|
||||
response['ListPLO'].forEach((hospital) {
|
||||
patientLabOrdersList.add(PatientLabOrders.fromJson(hospital));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: body);
|
||||
}
|
||||
|
||||
RequestPatientLabSpecialResult _requestPatientLabSpecialResult =
|
||||
RequestPatientLabSpecialResult();
|
||||
|
||||
List<PatientLabSpecialResult> patientLabSpecialResult = List();
|
||||
List<LabResult> labResultList = List();
|
||||
List<LabOrderResult> labOrdersResultsList = List();
|
||||
|
||||
Future getLaboratoryResult(
|
||||
{String projectID,
|
||||
int clinicID,
|
||||
String invoiceNo,
|
||||
String orderNo,
|
||||
PatiantInformtion patient}) async {
|
||||
hasError = false;
|
||||
_requestPatientLabSpecialResult.projectID = projectID;
|
||||
_requestPatientLabSpecialResult.clinicID = clinicID;
|
||||
_requestPatientLabSpecialResult.invoiceNo = invoiceNo;
|
||||
_requestPatientLabSpecialResult.orderNo = orderNo;
|
||||
|
||||
await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT,
|
||||
patient: patient,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
patientLabSpecialResult.clear();
|
||||
response['ListPLSR'].forEach((hospital) {
|
||||
patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: _requestPatientLabSpecialResult.toJson());
|
||||
}
|
||||
|
||||
Future getPatientLabResult({PatientLabOrders patientLabOrder,PatiantInformtion patient}) async {
|
||||
hasError = false;
|
||||
Map<String, dynamic> body = Map();
|
||||
body['InvoiceNo'] = patientLabOrder.invoiceNo;
|
||||
body['OrderNo'] = patientLabOrder.orderNo;
|
||||
body['isDentalAllowedBackend'] = false;
|
||||
body['SetupID'] = patientLabOrder.setupID;
|
||||
body['ProjectID'] = patientLabOrder.projectID;
|
||||
body['ClinicID'] = patientLabOrder.clinicID;
|
||||
await baseAppClient.postPatient(GET_Patient_LAB_RESULT,
|
||||
patient: patient,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
patientLabSpecialResult.clear();
|
||||
labResultList.clear();
|
||||
response['ListPLR'].forEach((lab) {
|
||||
labResultList.add(LabResult.fromJson(lab));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: body);
|
||||
}
|
||||
|
||||
Future getPatientLabOrdersResults(
|
||||
{PatientLabOrders patientLabOrder, String procedure,PatiantInformtion patient}) async {
|
||||
hasError = false;
|
||||
Map<String, dynamic> body = Map();
|
||||
body['InvoiceNo'] = patientLabOrder.invoiceNo;
|
||||
body['OrderNo'] = patientLabOrder.orderNo;
|
||||
body['isDentalAllowedBackend'] = false;
|
||||
body['SetupID'] = patientLabOrder.setupID;
|
||||
body['ProjectID'] = patientLabOrder.projectID;
|
||||
body['ClinicID'] = patientLabOrder.clinicID;
|
||||
body['Procedure'] = procedure;
|
||||
await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT,
|
||||
patient: patient,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
labOrdersResultsList.clear();
|
||||
response['ListPLR'].forEach((lab) {
|
||||
labOrdersResultsList.add(LabOrderResult.fromJson(lab));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: body);
|
||||
}
|
||||
|
||||
RequestSendLabReportEmail _requestSendLabReportEmail =
|
||||
RequestSendLabReportEmail();
|
||||
|
||||
Future sendLabReportEmail({PatientLabOrders patientLabOrder}) async {
|
||||
// _requestSendLabReportEmail.projectID = patientLabOrder.projectID;
|
||||
// _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo;
|
||||
// _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName;
|
||||
// _requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription;
|
||||
// _requestSendLabReportEmail.patientName = user.firstName +" "+ user.lastName;
|
||||
// _requestSendLabReportEmail.patientIditificationNum =
|
||||
// user.patientIdentificationNo;
|
||||
// _requestSendLabReportEmail.dateofBirth = user.dateofBirth;
|
||||
// _requestSendLabReportEmail.to = user.emailAddress;
|
||||
// _requestSendLabReportEmail.orderDate = '${patientLabOrder.orderDate.year}-${patientLabOrder.orderDate.month}-${patientLabOrder.orderDate.day}';
|
||||
// _requestSendLabReportEmail.patientMobileNumber = user.mobileNumber;
|
||||
// _requestSendLabReportEmail.projectName = patientLabOrder.projectName;
|
||||
// _requestSendLabReportEmail.setupID = user.setupID;
|
||||
//
|
||||
// await baseAppClient.post(SEND_LAB_RESULT_EMAIL,
|
||||
// onSuccess: (dynamic response, int statusCode) {
|
||||
//
|
||||
// }, onFailure: (String error, int statusCode) {
|
||||
// hasError = true;
|
||||
// super.error = error;
|
||||
// }, body: _requestSendLabReportEmail.toJson());
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||
import 'package:doctor_app_flutter/core/model/insurance_approval.dart';
|
||||
import 'package:doctor_app_flutter/core/service/InsuranceCardService.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
|
||||
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||
|
||||
import '../../locator.dart';
|
||||
|
||||
class InsuranceViewModel extends BaseViewModel{
|
||||
|
||||
InsuranceCardService _insuranceCardService = locator<InsuranceCardService>();
|
||||
|
||||
|
||||
List<InsuranceApprovalModel> get insuranceApproval =>
|
||||
_insuranceCardService.insuranceApproval;
|
||||
|
||||
Future getInsuranceApproval(PatiantInformtion patient,{int appointmentNo}) async {
|
||||
error = "";
|
||||
setState(ViewState.Busy);
|
||||
if (appointmentNo != null)
|
||||
await _insuranceCardService.getInsuranceApproval(patient,
|
||||
appointmentNo: appointmentNo);
|
||||
else
|
||||
await _insuranceCardService.getInsuranceApproval(patient);
|
||||
if (_insuranceCardService.hasError) {
|
||||
error = _insuranceCardService.error;
|
||||
setState(ViewState.ErrorLocal);
|
||||
} else
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
@ -0,0 +1,175 @@
|
||||
import 'package:doctor_app_flutter/core/enum/filter_type.dart';
|
||||
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||
import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart';
|
||||
import 'package:doctor_app_flutter/core/model/labs/lab_result.dart';
|
||||
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
|
||||
import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart';
|
||||
import 'package:doctor_app_flutter/core/service/labs_service.dart';
|
||||
import 'package:doctor_app_flutter/locator.dart';
|
||||
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
||||
|
||||
import 'base_view_model.dart';
|
||||
|
||||
class LabsViewModel extends BaseViewModel {
|
||||
FilterType filterType = FilterType.Clinic;
|
||||
LabsService _labsService = locator<LabsService>();
|
||||
|
||||
List<LabOrderResult> get labOrdersResultsList =>
|
||||
_labsService.labOrdersResultsList;
|
||||
|
||||
List<PatientLabOrdersList> _patientLabOrdersListClinic = List();
|
||||
List<PatientLabOrdersList> _patientLabOrdersListHospital = List();
|
||||
|
||||
List<PatientLabOrdersList> get patientLabOrdersList =>
|
||||
filterType == FilterType.Clinic
|
||||
? _patientLabOrdersListClinic
|
||||
: _patientLabOrdersListHospital;
|
||||
|
||||
void getLabs(PatiantInformtion patient) async {
|
||||
setState(ViewState.Busy);
|
||||
await _labsService.getPatientLabOrdersList(patient);
|
||||
if (_labsService.hasError) {
|
||||
error = _labsService.error;
|
||||
setState(ViewState.Error);
|
||||
} else {
|
||||
_labsService.patientLabOrdersList.forEach((element) {
|
||||
List<PatientLabOrdersList> patientLabOrdersClinic =
|
||||
_patientLabOrdersListClinic
|
||||
.where((elementClinic) =>
|
||||
elementClinic.filterName == element.clinicDescription)
|
||||
.toList();
|
||||
|
||||
if (patientLabOrdersClinic.length != 0) {
|
||||
_patientLabOrdersListClinic[_patientLabOrdersListClinic
|
||||
.indexOf(patientLabOrdersClinic[0])]
|
||||
.patientLabOrdersList
|
||||
.add(element);
|
||||
} else {
|
||||
_patientLabOrdersListClinic.add(PatientLabOrdersList(
|
||||
filterName: element.clinicDescription,
|
||||
patientDoctorAppointment: element));
|
||||
}
|
||||
|
||||
// doctor list sort via project
|
||||
List<PatientLabOrdersList> patientLabOrdersHospital =
|
||||
_patientLabOrdersListHospital
|
||||
.where(
|
||||
(elementClinic) =>
|
||||
elementClinic.filterName == element.projectName,
|
||||
)
|
||||
.toList();
|
||||
|
||||
if (patientLabOrdersHospital.length != 0) {
|
||||
_patientLabOrdersListHospital[_patientLabOrdersListHospital
|
||||
.indexOf(patientLabOrdersHospital[0])]
|
||||
.patientLabOrdersList
|
||||
.add(element);
|
||||
} else {
|
||||
_patientLabOrdersListHospital.add(PatientLabOrdersList(
|
||||
filterName: element.projectName,
|
||||
patientDoctorAppointment: element));
|
||||
}
|
||||
});
|
||||
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
setFilterType(FilterType filterType) {
|
||||
this.filterType = filterType;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
List<PatientLabSpecialResult> get patientLabSpecialResult =>
|
||||
_labsService.patientLabSpecialResult;
|
||||
|
||||
List<LabResult> get labResultList => _labsService.labResultList;
|
||||
|
||||
List<LabResultList> labResultLists = List();
|
||||
|
||||
getLaboratoryResult(
|
||||
{String projectID,
|
||||
int clinicID,
|
||||
String invoiceNo,
|
||||
String orderNo,
|
||||
PatiantInformtion patient}) async {
|
||||
setState(ViewState.Busy);
|
||||
await _labsService.getLaboratoryResult(
|
||||
invoiceNo: invoiceNo,
|
||||
orderNo: orderNo,
|
||||
projectID: projectID,
|
||||
clinicID: clinicID,
|
||||
patient: patient);
|
||||
if (_labsService.hasError) {
|
||||
error = _labsService.error;
|
||||
setState(ViewState.Error);
|
||||
} else {
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
getPatientLabResult({PatientLabOrders patientLabOrder,PatiantInformtion patient}) async {
|
||||
setState(ViewState.Busy);
|
||||
await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder,patient: patient);
|
||||
if (_labsService.hasError) {
|
||||
error = _labsService.error;
|
||||
setState(ViewState.Error);
|
||||
} else {
|
||||
_labsService.labResultList.forEach((element) {
|
||||
List<LabResultList> patientLabOrdersClinic = labResultLists
|
||||
.where(
|
||||
(elementClinic) => elementClinic.filterName == element.testCode)
|
||||
.toList();
|
||||
|
||||
if (patientLabOrdersClinic.length != 0) {
|
||||
var value =
|
||||
labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])]
|
||||
.patientLabResultList
|
||||
.where((e) =>
|
||||
e.sampleCollectedOn == element.sampleCollectedOn &&
|
||||
e.resultValue == element.resultValue)
|
||||
.toList();
|
||||
if (value.isEmpty)
|
||||
labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])]
|
||||
.patientLabResultList
|
||||
.add(element);
|
||||
} else {
|
||||
labResultLists
|
||||
.add(LabResultList(filterName: element.testCode, lab: element));
|
||||
}
|
||||
});
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
getPatientLabOrdersResults(
|
||||
{PatientLabOrders patientLabOrder, String procedure,PatiantInformtion patient}) async {
|
||||
setState(ViewState.Busy);
|
||||
await _labsService.getPatientLabOrdersResults(
|
||||
patientLabOrder: patientLabOrder, procedure: procedure,patient: patient);
|
||||
if (_labsService.hasError) {
|
||||
error = _labsService.error;
|
||||
setState(ViewState.Error);
|
||||
} else {
|
||||
bool isShouldClear = false;
|
||||
if (_labsService.labOrdersResultsList.length == 1) {
|
||||
labOrdersResultsList.forEach((element) {
|
||||
if (element.resultValue.contains('/') ||
|
||||
element.resultValue.contains('*') ||
|
||||
element.resultValue.isEmpty) isShouldClear = true;
|
||||
});
|
||||
}
|
||||
if (isShouldClear) _labsService.labOrdersResultsList.clear();
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
sendLabReportEmail({PatientLabOrders patientLabOrder, String mes}) async {
|
||||
await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder);
|
||||
if (_labsService.hasError) {
|
||||
error = _labsService.error;
|
||||
} else
|
||||
DrAppToastMsg.showSuccesToast(mes);
|
||||
}
|
||||
}
|
@ -0,0 +1,428 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/InsuranceViewModel.dart';
|
||||
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../base/base_view.dart';
|
||||
|
||||
class InsuranceApprovalScreenNew extends StatefulWidget {
|
||||
final int appointmentNo;
|
||||
|
||||
InsuranceApprovalScreenNew({this.appointmentNo});
|
||||
|
||||
@override
|
||||
_InsuranceApprovalScreenNewState createState() => _InsuranceApprovalScreenNewState();
|
||||
}
|
||||
|
||||
class _InsuranceApprovalScreenNewState extends State<InsuranceApprovalScreenNew> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||
PatiantInformtion patient = routeArgs['patient'];
|
||||
|
||||
return BaseView<InsuranceViewModel>(
|
||||
onModelReady: widget.appointmentNo != null
|
||||
? (model) =>
|
||||
model.getInsuranceApproval(patient,appointmentNo: widget.appointmentNo)
|
||||
: (model) => model.getInsuranceApproval(patient),
|
||||
builder: (BuildContext context, InsuranceViewModel model, Widget child) =>
|
||||
AppScaffold(
|
||||
isShowAppBar: true,
|
||||
baseViewModel: model,
|
||||
appBarTitle: TranslationBase.of(context).approvals,
|
||||
|
||||
body: SingleChildScrollView(
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: SizeConfig.screenWidth * 0.004,
|
||||
right: SizeConfig.screenWidth * 0.004,
|
||||
top: SizeConfig.screenWidth * 0.04,
|
||||
),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: SizeConfig.screenHeight * 0.09,
|
||||
color: Color(0xffEEEEEE),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
Texts(
|
||||
TranslationBase.of(context).totalApproval,
|
||||
color: Color(0xff60688B),
|
||||
fontSize: 19.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
if (model.insuranceApproval.length > 0)
|
||||
Container(
|
||||
width: 60,
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).primaryColor,
|
||||
borderRadius: BorderRadius.circular(19.0)),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
model.insuranceApproval[0].unUsedCount
|
||||
.toString(),
|
||||
color: Colors.white, fontSize: 17.0,
|
||||
),
|
||||
))
|
||||
],
|
||||
)),
|
||||
...List.generate(
|
||||
model.insuranceApproval.length,
|
||||
(index) => RoundedContainer(
|
||||
backgroundColor: Colors.white,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
ExpansionTile(
|
||||
title: Container(
|
||||
//height: 120.0,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
model.insuranceApproval[index].patientDescription == "In Patient"
|
||||
? Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).primaryColor,
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
16.0)),
|
||||
width: 115.0,
|
||||
padding:
|
||||
EdgeInsets.only(left: 11.5),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).inPatient,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xff505A5D),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
16.0)),
|
||||
width: 115.0,
|
||||
padding:
|
||||
EdgeInsets.only(left: 11.5),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).outpatient,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 10.0),
|
||||
child: Texts(
|
||||
model.insuranceApproval[index]
|
||||
.clinicName,
|
||||
fontSize: 20.0,
|
||||
color: Color(0xff60686B),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
Texts(
|
||||
model.insuranceApproval[index]
|
||||
.doctorName,
|
||||
fontSize: 17.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 12.0, horizontal: 12.0),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: [
|
||||
Texts(
|
||||
TranslationBase.of(context).approvalNo,
|
||||
fontSize: 18.0,
|
||||
),
|
||||
Texts(model.insuranceApproval[index].approvalNo.toString(),
|
||||
fontSize: 18.0,
|
||||
fontWeight: FontWeight.w600,),
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
color: Colors.black,
|
||||
height: 25.0,
|
||||
thickness: 1.0,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Texts(
|
||||
TranslationBase.of(context).procedureStatus ,
|
||||
fontSize: 17.5,
|
||||
),
|
||||
SizedBox(width: 12,),
|
||||
Expanded(
|
||||
child: Texts(
|
||||
model.insuranceApproval[index].approvalStatusDescption,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 17.5,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
color: Colors.black,
|
||||
height: 25.0,
|
||||
thickness: 1.0,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Texts(
|
||||
TranslationBase.of(context).unusedCount,
|
||||
fontSize: 17.5,
|
||||
),
|
||||
Texts(
|
||||
model.insuranceApproval[index].unUsedCount.toString(),
|
||||
fontSize: 17.5,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
color: Colors.black,
|
||||
height: 25.0,
|
||||
thickness: 1.0,
|
||||
),
|
||||
// Text(
|
||||
// 'Company Name: ' +
|
||||
// model.insuranceApproval[index]
|
||||
// .companyName ==
|
||||
// null
|
||||
// ? '000'
|
||||
// : model
|
||||
// .insuranceApproval[index].companyName,
|
||||
// style: TextStyle(
|
||||
// fontSize: 17.5,
|
||||
// fontWeight: FontWeight.w600),
|
||||
// ),
|
||||
Texts(
|
||||
TranslationBase.of(context).companyName,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 17.5,
|
||||
),
|
||||
|
||||
Divider(
|
||||
color: Colors.black,
|
||||
height: 25.0,
|
||||
thickness: 1.0,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Texts(
|
||||
TranslationBase.of(context).receiptOn ,
|
||||
fontSize: 17.5,
|
||||
fontWeight: FontWeight.w600,
|
||||
|
||||
),
|
||||
Texts(
|
||||
convertDateFormat(model.insuranceApproval[index].rceiptOn),
|
||||
fontSize: 17.5,
|
||||
fontWeight: FontWeight.w600,
|
||||
|
||||
),
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
color: Colors.black,
|
||||
height: 25.0,
|
||||
thickness: 1.0,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Texts(
|
||||
TranslationBase.of(context).expiryDate,
|
||||
fontSize: 17.5,
|
||||
fontWeight: FontWeight.w600,
|
||||
|
||||
),
|
||||
Texts(
|
||||
convertDateFormat(model.insuranceApproval[index].expiryDate),
|
||||
fontSize: 17.5,
|
||||
fontWeight: FontWeight.w600,
|
||||
|
||||
),
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
color: Colors.black,
|
||||
height: 55.0,
|
||||
thickness: 1.2,
|
||||
),
|
||||
IntrinsicHeight(
|
||||
child: Row(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Text(TranslationBase.of(
|
||||
context)
|
||||
.procedureName),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: SizeConfig
|
||||
.heightMultiplier *
|
||||
3.0),
|
||||
child: Text(
|
||||
model
|
||||
.insuranceApproval[
|
||||
index]
|
||||
.approvalDetails ==
|
||||
null
|
||||
? ''
|
||||
: model
|
||||
.insuranceApproval[
|
||||
index]
|
||||
.approvalDetails
|
||||
.procedureName,
|
||||
style: TextStyle(
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
fontSize: 15.5),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
VerticalDivider(
|
||||
width: 10.0,
|
||||
thickness: 1.2,
|
||||
color: Colors.black,
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Text(TranslationBase.of(
|
||||
context)
|
||||
.procedureStatus),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: SizeConfig
|
||||
.heightMultiplier *
|
||||
3.0),
|
||||
child: Text(
|
||||
model
|
||||
.insuranceApproval[
|
||||
index]
|
||||
.approvalDetails ==
|
||||
null
|
||||
? ''
|
||||
: model
|
||||
.insuranceApproval[
|
||||
index]
|
||||
.approvalDetails
|
||||
.status,
|
||||
style: TextStyle(
|
||||
fontSize: 17.5,
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w600),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
VerticalDivider(
|
||||
width: 2.3,
|
||||
thickness: 1.2,
|
||||
color: Colors.black,
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Text(TranslationBase.of(
|
||||
context)
|
||||
.usageStatus),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: SizeConfig
|
||||
.heightMultiplier *
|
||||
3.0),
|
||||
child: Text(
|
||||
model
|
||||
.insuranceApproval[
|
||||
index]
|
||||
.approvalDetails ==
|
||||
null
|
||||
? ''
|
||||
: model
|
||||
.insuranceApproval[
|
||||
index]
|
||||
.approvalDetails
|
||||
.isInvoicedDesc,
|
||||
style: TextStyle(
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
fontSize: 17.5),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
color: Colors.black,
|
||||
height: 25.0,
|
||||
thickness: 1.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
convertDateFormat(String Date) {
|
||||
const start = "/Date(";
|
||||
const end = "+0300)";
|
||||
|
||||
final startIndex = Date.indexOf(start);
|
||||
final endIndex = Date.indexOf(end, startIndex + start.length);
|
||||
|
||||
var date = new DateTime.fromMillisecondsSinceEpoch(
|
||||
int.parse(Date.substring(startIndex + start.length, endIndex)));
|
||||
String newDate = date.year.toString() +
|
||||
"-" +
|
||||
date.month.toString().padLeft(2, '0') +
|
||||
"-" +
|
||||
date.day.toString().padLeft(2, '0');
|
||||
|
||||
return newDate.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart';
|
||||
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
import 'lab_result_chart_and_detials.dart';
|
||||
|
||||
class FlowChartPage extends StatelessWidget {
|
||||
final PatientLabOrders patientLabOrder;
|
||||
final String filterName;
|
||||
final PatiantInformtion patient;
|
||||
FlowChartPage({this.patientLabOrder, this.filterName, this.patient});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<LabsViewModel>(
|
||||
onModelReady: (model) => model.getPatientLabOrdersResults(
|
||||
patientLabOrder: patientLabOrder, procedure: filterName,patient: patient),
|
||||
builder: (context, model, w) => AppScaffold(
|
||||
isShowAppBar: true,
|
||||
appBarTitle: filterName,
|
||||
baseViewModel: model,
|
||||
body: SingleChildScrollView(
|
||||
child: model.labOrdersResultsList.isNotEmpty
|
||||
? Container(
|
||||
child: LabResultChartAndDetails(
|
||||
name: filterName,
|
||||
labResult: model.labOrdersResultsList,
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
child: Center(
|
||||
child: Texts('no Data'),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,175 @@
|
||||
import 'package:doctor_app_flutter/core/model/labs/lab_result.dart';
|
||||
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/patients/profile/lab_result/FlowChartPage.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
|
||||
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
|
||||
class LabResultWidget extends StatelessWidget {
|
||||
|
||||
final String filterName ;
|
||||
final List<LabResult> patientLabResultList;
|
||||
final PatientLabOrders patientLabOrder;
|
||||
final PatiantInformtion patient;
|
||||
LabResultWidget({Key key, this.filterName, this.patientLabResultList, this.patientLabOrder, this.patient}) : super(key: key);
|
||||
ProjectViewModel projectViewModel;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
projectViewModel = Provider.of(context);
|
||||
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Texts(filterName),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: FlowChartPage(
|
||||
filterName: filterName,
|
||||
patientLabOrder: patientLabOrder,
|
||||
patient: patient,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Texts(
|
||||
TranslationBase.of(context).showMoreBtn,
|
||||
textDecoration: TextDecoration.underline,
|
||||
color: Colors.blue,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Table(
|
||||
border: TableBorder.symmetric(
|
||||
inside: BorderSide(
|
||||
width: 2.0, color: Colors.grey[300]),
|
||||
),
|
||||
children: fullData(patientLabResultList,context),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
List<TableRow> fullData(List<LabResult> labResultList,context) {
|
||||
List<TableRow> tableRow = [];
|
||||
tableRow.add(
|
||||
TableRow(
|
||||
children: [
|
||||
Container(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).primaryColor,
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: projectViewModel.isArabic
|
||||
? Radius.circular(0.0)
|
||||
: Radius.circular(10.0),
|
||||
topRight: projectViewModel.isArabic
|
||||
? Radius.circular(10.0)
|
||||
: Radius.circular(0.0),
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).description,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
height: 60,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).primaryColor,
|
||||
),
|
||||
child: Center(
|
||||
child: Texts(TranslationBase.of(context).value, color: Colors.white),
|
||||
),
|
||||
height: 60),
|
||||
),
|
||||
Container(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).primaryColor,
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: projectViewModel.isArabic
|
||||
? Radius.circular(10.0)
|
||||
: Radius.circular(0.0),
|
||||
topRight: projectViewModel.isArabic
|
||||
? Radius.circular(0.0)
|
||||
: Radius.circular(10.0),
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: Texts(TranslationBase.of(context).range, color: Colors.white),
|
||||
),
|
||||
height: 60),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
labResultList.forEach((lab) {
|
||||
tableRow.add(
|
||||
TableRow(
|
||||
children: [
|
||||
Container(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
color: Colors.white,
|
||||
child: Center(
|
||||
child: Texts(
|
||||
lab.description,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
color: Colors.white,
|
||||
child: Center(
|
||||
child: Texts(
|
||||
lab.resultValue+" "+lab.uOM,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
color: Colors.white,
|
||||
child: Center(
|
||||
child: Texts(
|
||||
lab.referanceRange,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
});
|
||||
return tableRow;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,119 @@
|
||||
import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.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/Text.dart';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class LabResultDetailsWidget extends StatefulWidget {
|
||||
final List<LabOrderResult> labResult;
|
||||
|
||||
LabResultDetailsWidget({
|
||||
this.labResult,
|
||||
});
|
||||
|
||||
@override
|
||||
_VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState();
|
||||
}
|
||||
|
||||
class _VitalSignDetailsWidgetState extends State<LabResultDetailsWidget> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)),
|
||||
border: Border.all(color: Colors.grey, width: 1),
|
||||
),
|
||||
margin: EdgeInsets.all(20),
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Table(
|
||||
border: TableBorder.symmetric(
|
||||
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
|
||||
),
|
||||
children: fullData(projectViewModel),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
List<TableRow> fullData(ProjectViewModel projectViewModel) {
|
||||
List<TableRow> tableRow = [];
|
||||
tableRow.add(TableRow(children: [
|
||||
Container(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).primaryColor,
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0),
|
||||
topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0),
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).date,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
height: 60,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).primaryColor,
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0),
|
||||
topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0),
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: Texts(TranslationBase.of(context).labResult, color: Colors.white),
|
||||
),
|
||||
height: 60),
|
||||
)
|
||||
]));
|
||||
widget.labResult.forEach((vital) {
|
||||
var date = DateUtils.convertStringToDate(vital.verifiedOnDateTime);
|
||||
tableRow.add(TableRow(children: [
|
||||
Container(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
color: Colors.white,
|
||||
child: Center(
|
||||
child: Texts(
|
||||
'${projectViewModel.isArabic? DateUtils.getWeekDayArabic(date.weekday): DateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic? DateUtils.getMonthArabic(date.month) : DateUtils.getMonth(date.month)} ${date.year}',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
color: Colors.white,
|
||||
child: Center(
|
||||
child: Texts(
|
||||
'${vital.resultValue}',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
]));
|
||||
});
|
||||
return tableRow;
|
||||
}
|
||||
}
|
@ -0,0 +1,229 @@
|
||||
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../core/model/labs/LabOrderResult.dart';
|
||||
|
||||
class LineChartCurved extends StatefulWidget {
|
||||
final String title;
|
||||
final List<LabOrderResult> labResult;
|
||||
|
||||
LineChartCurved({this.title, this.labResult});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => LineChartCurvedState();
|
||||
}
|
||||
|
||||
class LineChartCurvedState extends State<LineChartCurved> {
|
||||
bool isShowingMainData;
|
||||
List<int> xAxixs = List();
|
||||
int indexes = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
getXaxix();
|
||||
isShowingMainData = true;
|
||||
}
|
||||
|
||||
getXaxix() {
|
||||
indexes = widget.labResult.length ~/ 3.5;
|
||||
for (int index = 0; index < widget.labResult.length; index++) {
|
||||
int mIndex = indexes * index;
|
||||
if (mIndex < widget.labResult.length) {
|
||||
xAxixs.add(mIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AspectRatio(
|
||||
aspectRatio: 1.23,
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(18)),
|
||||
// color: Colors.white,
|
||||
),
|
||||
child: Stack(
|
||||
children: <Widget>[
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
const SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Text(
|
||||
widget.title,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 32,
|
||||
fontWeight: FontWeight.bold,
|
||||
letterSpacing: 2),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(right: 16.0, left: 6.0),
|
||||
child: LineChart(
|
||||
sampleData1(),
|
||||
swapAnimationDuration: const Duration(milliseconds: 250),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
LineChartData sampleData1() {
|
||||
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: 12,
|
||||
),
|
||||
margin: 22,
|
||||
rotateAngle:-65,
|
||||
getTitles: (value) {
|
||||
print(value);
|
||||
DateTime date = DateUtils.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime);
|
||||
if (widget.labResult.length < 8) {
|
||||
if (widget.labResult.length > value.toInt()) {
|
||||
return '${date.day}/ ${date.year}';
|
||||
} else
|
||||
return '';
|
||||
} else {
|
||||
if (value.toInt() == 0)
|
||||
return '${date.day}/ ${date.year}';
|
||||
if (value.toInt() == widget.labResult.length - 1)
|
||||
return '${date.day}/ ${date.year}';
|
||||
if (xAxixs.contains(value.toInt())) {
|
||||
return '${date.day}/ ${date.year}';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return '';
|
||||
},
|
||||
),
|
||||
leftTitles: SideTitles(
|
||||
showTitles: true,
|
||||
getTextStyles: (value) => const TextStyle(
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 10,
|
||||
),
|
||||
getTitles: (value) {
|
||||
return '${value.toInt()}';
|
||||
},
|
||||
margin: 8,
|
||||
//reservedSize: 30,
|
||||
),
|
||||
),
|
||||
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: (widget.labResult.length - 1).toDouble(),
|
||||
maxY: getMaxY(),
|
||||
minY: getMinY(),
|
||||
lineBarsData: getData(),
|
||||
);
|
||||
}
|
||||
|
||||
double getMaxY() {
|
||||
double max = 0;
|
||||
widget.labResult.forEach((element) {
|
||||
try{
|
||||
double resultValueDouble = double.parse(element.resultValue);
|
||||
if (resultValueDouble > max) max = resultValueDouble;}
|
||||
catch(e){
|
||||
print(e);
|
||||
}
|
||||
});
|
||||
|
||||
return max.roundToDouble();
|
||||
}
|
||||
|
||||
double getMinY() {
|
||||
double min = 0;
|
||||
try{
|
||||
min = double.parse(widget.labResult[0].resultValue);
|
||||
|
||||
widget.labResult.forEach((element) {
|
||||
double resultValueDouble = double.parse(element.resultValue);
|
||||
if (resultValueDouble < min) min = resultValueDouble;
|
||||
});}catch(e){
|
||||
print(e);
|
||||
}
|
||||
int value = min.toInt();
|
||||
|
||||
return value.toDouble();
|
||||
}
|
||||
|
||||
List<LineChartBarData> getData() {
|
||||
List<FlSpot> spots = List();
|
||||
for (int index = 0; index < widget.labResult.length; index++) {
|
||||
try{
|
||||
var resultValueDouble = double.parse(widget.labResult[index].resultValue);
|
||||
spots.add(FlSpot(index.toDouble(), resultValueDouble));
|
||||
}catch(e){
|
||||
print(e);
|
||||
spots.add(FlSpot(index.toDouble(), 0.0));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
final LineChartBarData lineChartBarData1 = LineChartBarData(
|
||||
spots: spots,
|
||||
isCurved: true,
|
||||
colors: [Theme.of(context).primaryColor],
|
||||
barWidth: 5,
|
||||
isStrokeCapRound: true,
|
||||
dotData: FlDotData(
|
||||
show: false,
|
||||
),
|
||||
belowBarData: BarAreaData(
|
||||
show: false,
|
||||
),
|
||||
);
|
||||
|
||||
return [
|
||||
lineChartBarData1,
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
|
||||
import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:charts_flutter/flutter.dart' as charts;
|
||||
|
||||
import 'Lab_Result_details_wideget.dart';
|
||||
import 'LineChartCurved.dart';
|
||||
|
||||
|
||||
class LabResultChartAndDetails extends StatelessWidget {
|
||||
LabResultChartAndDetails({
|
||||
Key key,
|
||||
@required this.labResult,
|
||||
@required this.name,
|
||||
}) : super(key: key);
|
||||
|
||||
final List<LabOrderResult> labResult;
|
||||
final String name;
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
AppExpandableNotifier(
|
||||
headerWidget: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: LineChartCurved(title: name,labResult:labResult,),
|
||||
),
|
||||
bodyWidget: LabResultDetailsWidget(
|
||||
labResult: labResult.reversed.toList(),
|
||||
),
|
||||
isExpand: true,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart';
|
||||
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'laboratory_result_widget.dart';
|
||||
|
||||
class LaboratoryResultPage extends StatefulWidget {
|
||||
final PatientLabOrders patientLabOrders;
|
||||
final PatiantInformtion patient;
|
||||
|
||||
LaboratoryResultPage({Key key, this.patientLabOrders, this.patient});
|
||||
|
||||
@override
|
||||
_LaboratoryResultPageState createState() => _LaboratoryResultPageState();
|
||||
}
|
||||
|
||||
class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<LabsViewModel>(
|
||||
onModelReady: (model) => model.getLaboratoryResult(
|
||||
invoiceNo: widget.patientLabOrders.invoiceNo,
|
||||
clinicID: widget.patientLabOrders.clinicID,
|
||||
projectID: widget.patientLabOrders.projectID,
|
||||
orderNo: widget.patientLabOrders.orderNo,
|
||||
patient: widget.patient),
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
isShowAppBar: true,
|
||||
appBarTitle: TranslationBase.of(context).labResults,
|
||||
baseViewModel: model,
|
||||
body: Scaffold(
|
||||
body: ListView.builder(
|
||||
itemBuilder: (context, index) => LaboratoryResultWidget(
|
||||
onTap: () async {
|
||||
|
||||
},
|
||||
billNo: widget.patientLabOrders.invoiceNo,
|
||||
details: model.patientLabSpecialResult[index].resultDataHTML,
|
||||
orderNo: widget.patientLabOrders.orderNo,
|
||||
patientLabOrder: widget.patientLabOrders,
|
||||
patient: widget.patient,
|
||||
),
|
||||
itemCount: model.patientLabSpecialResult.length,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,235 @@
|
||||
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/screens/patients/profile/lab_result/LabResultWidget.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_html/flutter_html.dart';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class LaboratoryResultWidget extends StatefulWidget {
|
||||
final GestureTapCallback onTap;
|
||||
final String billNo;
|
||||
final String details;
|
||||
final String orderNo;
|
||||
final PatientLabOrders patientLabOrder;
|
||||
final PatiantInformtion patient;
|
||||
const LaboratoryResultWidget(
|
||||
{Key key,
|
||||
this.onTap,
|
||||
this.billNo,
|
||||
this.details,
|
||||
this.orderNo,
|
||||
this.patientLabOrder, this.patient})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_LaboratoryResultWidgetState createState() => _LaboratoryResultWidgetState();
|
||||
}
|
||||
|
||||
class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
|
||||
bool _isShowMore = true;
|
||||
bool _isShowMoreGeneral = true;
|
||||
ProjectViewModel projectViewModel;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
projectViewModel = Provider.of(context);
|
||||
return BaseView<LabsViewModel>(
|
||||
onModelReady: (model) =>
|
||||
model.getPatientLabResult(patientLabOrder: widget.patientLabOrder,patient: widget.patient),
|
||||
builder: (_, model, w) => NetworkBaseView(
|
||||
baseViewModel: model,
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(15),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.all(8),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(5.0),
|
||||
)),
|
||||
padding: EdgeInsets.all(10.0),
|
||||
margin: EdgeInsets.only(left: 5, right: 5),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Texts(TranslationBase.of(context).invoiceNo),
|
||||
Texts(widget.billNo),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
if (model.labResultLists.isNotEmpty)
|
||||
Container(
|
||||
child: Column(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
setState(
|
||||
() {
|
||||
_isShowMoreGeneral = !_isShowMoreGeneral;
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10.0),
|
||||
margin: EdgeInsets.only(left: 5, right: 5),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(5.0),
|
||||
)),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Texts(TranslationBase.of(context)
|
||||
.generalResult)),
|
||||
Container(
|
||||
width: 25,
|
||||
height: 25,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Theme.of(context).primaryColor),
|
||||
child: Icon(
|
||||
_isShowMoreGeneral
|
||||
? Icons.keyboard_arrow_up
|
||||
: Icons.keyboard_arrow_down,
|
||||
color: Colors.white,
|
||||
size: 22,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
if (_isShowMoreGeneral)
|
||||
AnimatedContainer(
|
||||
padding: EdgeInsets.all(10.0),
|
||||
margin: EdgeInsets.only(left: 5, right: 5),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.circular(5.0),
|
||||
bottomRight: Radius.circular(5.0),
|
||||
),
|
||||
),
|
||||
duration: Duration(milliseconds: 7000),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
...List.generate(
|
||||
model.labResultLists.length,
|
||||
(index) => LabResultWidget(
|
||||
patientLabOrder: widget.patientLabOrder,
|
||||
filterName: model
|
||||
.labResultLists[index].filterName,
|
||||
patientLabResultList: model
|
||||
.labResultLists[index]
|
||||
.patientLabResultList,
|
||||
patient:widget.patient,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_isShowMore = !_isShowMore;
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10.0),
|
||||
margin: EdgeInsets.only(left: 5, right: 5),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(5.0),
|
||||
)),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).specialResult)),
|
||||
Container(
|
||||
width: 25,
|
||||
height: 25,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Theme.of(context).primaryColor),
|
||||
child: Icon(
|
||||
_isShowMore
|
||||
? Icons.keyboard_arrow_up
|
||||
: Icons.keyboard_arrow_down,
|
||||
color: Colors.white,
|
||||
size: 22,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
if (_isShowMore)
|
||||
AnimatedContainer(
|
||||
padding: EdgeInsets.all(10.0),
|
||||
margin: EdgeInsets.only(left: 5, right: 5),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.circular(5.0),
|
||||
bottomRight: Radius.circular(5.0),
|
||||
)),
|
||||
duration: Duration(milliseconds: 7000),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
child: Html(
|
||||
data: widget.details ??
|
||||
TranslationBase.of(context).noDataAvailable,
|
||||
)),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
import 'package:doctor_app_flutter/core/enum/filter_type.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result_page.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
|
||||
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
|
||||
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class LabsHomePage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||
PatiantInformtion patient = routeArgs['patient'];
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
return BaseView<LabsViewModel>(
|
||||
onModelReady: (model) => model.getLabs(patient),
|
||||
builder: (context, LabsViewModel model, widget) => AppScaffold(
|
||||
baseViewModel: model,
|
||||
isShowAppBar: true,
|
||||
appBarTitle: TranslationBase.of(context).labOrders,
|
||||
body: SingleChildScrollView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 1.0,
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () => model.setFilterType(FilterType.Clinic),
|
||||
child: ListTile(
|
||||
title: Text(TranslationBase.of(context).clinic),
|
||||
leading: Radio(
|
||||
value: FilterType.Clinic,
|
||||
groupValue: model.filterType,
|
||||
onChanged: (FilterType value) {
|
||||
model.setFilterType(value);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () => model.setFilterType(FilterType.Hospital),
|
||||
child: ListTile(
|
||||
title: Text(TranslationBase.of(context).hospital),
|
||||
leading: Radio(
|
||||
value: FilterType.Hospital,
|
||||
groupValue: model.filterType,
|
||||
onChanged: (FilterType value) =>
|
||||
model.setFilterType(value),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
...List.generate(
|
||||
model.patientLabOrdersList.length,
|
||||
(index) => AppExpandableNotifier(
|
||||
title: model.patientLabOrdersList[index].filterName,
|
||||
bodyWidget: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: model
|
||||
.patientLabOrdersList[index].patientLabOrdersList
|
||||
.map((labOrder) {
|
||||
return DoctorCard(
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: LaboratoryResultPage(
|
||||
patientLabOrders: labOrder,
|
||||
patient: patient,
|
||||
),
|
||||
),
|
||||
),
|
||||
isInOutPatient: labOrder.isInOutPatient,
|
||||
name: labOrder.doctorName,
|
||||
billNo: ' ${labOrder.invoiceNo}',
|
||||
profileUrl: labOrder.doctorImageURL,
|
||||
subName: labOrder.projectName,
|
||||
isLiveCareAppointment:
|
||||
labOrder.isLiveCareAppointment,
|
||||
date: projectViewModel.isArabic
|
||||
? DateUtils.getMonthDayYearDateFormattedAr(
|
||||
labOrder.orderDate)
|
||||
: DateUtils.getMonthDayYearDateFormatted(
|
||||
labOrder.orderDate),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'Text.dart';
|
||||
|
||||
class StarRating extends StatelessWidget {
|
||||
final double totalAverage;
|
||||
final double size;
|
||||
final int totalCount;
|
||||
final bool forceStars;
|
||||
|
||||
StarRating(
|
||||
{Key key,
|
||||
this.totalAverage: 0.0,
|
||||
this.size: 16.0,
|
||||
this.totalCount = 5,
|
||||
this.forceStars = false})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[
|
||||
if (!forceStars && (totalAverage == null || totalAverage == 0))
|
||||
Texts("New", style: "caption"),
|
||||
if (forceStars || (totalAverage != null && totalAverage > 0))
|
||||
...List.generate(
|
||||
5,
|
||||
(index) => Padding(
|
||||
padding: EdgeInsets.only(right: 1.0),
|
||||
child: Icon(
|
||||
(index + 1) <= (totalAverage ?? 0)
|
||||
? EvaIcons.star
|
||||
: EvaIcons.starOutline,
|
||||
size: size,
|
||||
color: (index + 1) <= (totalAverage ?? 0)
|
||||
? Color.fromRGBO(255, 186, 0, 1.0)
|
||||
: Theme.of(context).hintColor),
|
||||
)),
|
||||
if (totalCount != null) SizedBox(width: 9.0),
|
||||
if (totalCount != null)
|
||||
Texts(
|
||||
"(" + totalCount.toString() + ")",
|
||||
style: "overline",
|
||||
color: Colors.grey[400],
|
||||
)
|
||||
]);
|
||||
}
|
||||
}
|
@ -0,0 +1,126 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:expandable/expandable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
/// App Expandable Notifier with animation
|
||||
/// [headerWidget] widget want to show in the header
|
||||
/// [bodyWidget] widget want to show in the body
|
||||
/// [title] the widget title
|
||||
/// [collapsed] The widget shown in the collapsed state
|
||||
class AppExpandableNotifier extends StatefulWidget {
|
||||
final Widget headerWidget;
|
||||
final Widget bodyWidget;
|
||||
final String title;
|
||||
final Widget collapsed;
|
||||
final bool isExpand;
|
||||
bool expandFlag = false;
|
||||
var controller = new ExpandableController();
|
||||
AppExpandableNotifier(
|
||||
{this.headerWidget,
|
||||
this.bodyWidget,
|
||||
this.title,
|
||||
this.collapsed,
|
||||
this.isExpand = false});
|
||||
|
||||
_AppExpandableNotifier createState() => _AppExpandableNotifier();
|
||||
}
|
||||
|
||||
class _AppExpandableNotifier extends State<AppExpandableNotifier> {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
setState(() {
|
||||
if (widget.isExpand) {
|
||||
widget.expandFlag = widget.isExpand;
|
||||
widget.controller.expanded = true;
|
||||
}
|
||||
});
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return ExpandableNotifier(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 10, right: 10, top: 4),
|
||||
child: Card(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
child: widget.headerWidget,
|
||||
),
|
||||
ScrollOnExpand(
|
||||
scrollOnExpand: true,
|
||||
scrollOnCollapse: false,
|
||||
child: ExpandablePanel(
|
||||
hasIcon: false,
|
||||
theme: const ExpandableThemeData(
|
||||
headerAlignment: ExpandablePanelHeaderAlignment.center,
|
||||
tapBodyToCollapse: true,
|
||||
),
|
||||
header: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
widget.title ?? TranslationBase.of(context).details,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: SizeConfig.textMultiplier * 2,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: new Container(
|
||||
height: 28.0,
|
||||
width: 30.0,
|
||||
decoration: new BoxDecoration(
|
||||
color: Theme.of(context).primaryColor,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: new Center(
|
||||
child: new Icon(
|
||||
widget.expandFlag
|
||||
? Icons.keyboard_arrow_up
|
||||
: Icons.keyboard_arrow_down,
|
||||
color: Colors.white,
|
||||
size: 30.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
widget.expandFlag = !widget.expandFlag;
|
||||
widget.controller.expanded = widget.expandFlag;
|
||||
});
|
||||
}),
|
||||
]),
|
||||
collapsed: widget.collapsed ?? Container(),
|
||||
expanded: widget.bodyWidget,
|
||||
builder: (_, collapsed, expanded) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(left: 5, right: 5, bottom: 5),
|
||||
child: Expandable(
|
||||
controller: widget.controller,
|
||||
collapsed: collapsed,
|
||||
expanded: expanded,
|
||||
theme: const ExpandableThemeData(crossFadePoint: 0),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,198 @@
|
||||
|
||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'StarRating.dart';
|
||||
import 'Text.dart';
|
||||
|
||||
class DoctorCard extends StatelessWidget {
|
||||
final String name;
|
||||
final String subName;
|
||||
final double rat;
|
||||
final String date;
|
||||
final String profileUrl;
|
||||
final String billNo;
|
||||
final Function onTap;
|
||||
final Function onEmailTap;
|
||||
final bool isInOutPatient;
|
||||
final bool isLiveCareAppointment;
|
||||
|
||||
DoctorCard(
|
||||
{this.name,
|
||||
this.subName,
|
||||
this.rat,
|
||||
this.date,
|
||||
this.profileUrl,
|
||||
this.billNo,
|
||||
this.onTap,
|
||||
this.onEmailTap,
|
||||
this.isInOutPatient,
|
||||
this.isLiveCareAppointment = false});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
return Container(
|
||||
margin: EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
width: 0.5,
|
||||
color: Theme.of(context).primaryColor,
|
||||
),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(8.0),
|
||||
),
|
||||
color: Colors.white),
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: projectViewModel.isArabic ? 27 : 20,
|
||||
height: date == null
|
||||
? projectViewModel.isArabic
|
||||
? 185
|
||||
: 100
|
||||
: 180,
|
||||
decoration: BoxDecoration(
|
||||
//Colors.red[900] Color(0xff404545)
|
||||
color: isLiveCareAppointment
|
||||
? Color(0xff404545)
|
||||
: !isInOutPatient
|
||||
? Colors.red[900]
|
||||
: Theme.of(context).primaryColor,
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: projectViewModel.isArabic
|
||||
? Radius.circular(0)
|
||||
: Radius.circular(8),
|
||||
bottomLeft: projectViewModel.isArabic
|
||||
? Radius.circular(0)
|
||||
: Radius.circular(8),
|
||||
topRight: projectViewModel.isArabic
|
||||
? Radius.circular(8)
|
||||
: Radius.circular(0),
|
||||
bottomRight: projectViewModel.isArabic
|
||||
? Radius.circular(8)
|
||||
: Radius.circular(0),
|
||||
),
|
||||
),
|
||||
child: RotatedBox(
|
||||
quarterTurns: 3,
|
||||
child: Center(
|
||||
child: Text(
|
||||
isLiveCareAppointment
|
||||
? TranslationBase.of(context)
|
||||
.liveCare
|
||||
.toUpperCase()
|
||||
: !isInOutPatient
|
||||
? TranslationBase.of(context)
|
||||
.inPatient
|
||||
.toUpperCase()
|
||||
: TranslationBase.of(context)
|
||||
.outpatient
|
||||
.toUpperCase(),
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
)),
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: LargeAvatar(
|
||||
name: name,
|
||||
url: profileUrl,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 4,
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Texts(
|
||||
TranslationBase.of(context).dr +
|
||||
" " +
|
||||
name,
|
||||
bold: true,
|
||||
),
|
||||
Texts(
|
||||
subName,
|
||||
),
|
||||
if (billNo != null)
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Texts(
|
||||
'${TranslationBase.of(context).billNo}: ',
|
||||
),
|
||||
Texts(
|
||||
billNo,
|
||||
)
|
||||
],
|
||||
),
|
||||
if (rat != null)
|
||||
StarRating(
|
||||
totalAverage: rat, forceStars: true),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
if (onEmailTap != null)
|
||||
InkWell(
|
||||
onTap: onEmailTap,
|
||||
child: Icon(
|
||||
Icons.email,
|
||||
color: Theme.of(context).primaryColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (date != null)
|
||||
Divider(
|
||||
height: 8,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
if (date != null)
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Icon(
|
||||
Icons.calendar_today_outlined,
|
||||
size: 30,
|
||||
color: Colors.red,
|
||||
),
|
||||
Expanded(
|
||||
child: Texts(
|
||||
date,
|
||||
variant: 'bodyText',
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue