fix lab result issues

merge-update-with-lab-changes
Mohammad Aljammal 5 years ago
parent 02ce04a397
commit fe66ee5993

@ -6,7 +6,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.android.tools.build:gradle:4.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.2'
}

@ -1,6 +1,6 @@
#Fri Jun 23 08:50:38 CEST 2017
#Thu Sep 03 16:26:30 EEST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

@ -28,8 +28,8 @@ const GET_PRESCRIPTION_REPORT_ENH =
///Lab Order
const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders';
const GET_Patient_LAB_SPECIAL_RESULT =
'Services/Patients.svc/REST/GetPatientLabSpecialResults';
const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults';
const GET_Patient_LAB_RESULT = '/Services/Patients.svc/REST/GetPatientLabResults';
///
const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';

@ -448,4 +448,5 @@ const Map<String, Map<String, String>> localizedValues = {
"OrderNo": {"en": "Order No", "ar": "رقم الطلب"},
"OrderDetails": {"en": "Order Details", "ar": "تفاصيل الطلب"},
"VitalSign": {"en": "Vital Sign", "ar": "العلامة حيوية"},
"MonthlyReports": {"en": "Monthly Reports", "ar": "تقارير شهرية"},
};

@ -0,0 +1,88 @@
class LabResult {
String description;
Null femaleInterpretativeData;
int gender;
int lineItemNo;
Null maleInterpretativeData;
String notes;
String packageID;
int patientID;
String projectID;
String referanceRange;
String resultValue;
String sampleCollectedOn;
String sampleReceivedOn;
String setupID;
Null superVerifiedOn;
String testCode;
String uOM;
String verifiedOn;
Null 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;
}
}

@ -31,7 +31,7 @@ class BaseAppClient {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN);
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'en');
var user = await sharedPref.getObject(USER_PROFILE);
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] : SETUP_ID

@ -1,8 +1,13 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
class InsuranceCardService extends BaseService {
List<InsuranceCardModel> _cardList = List();
@ -15,6 +20,9 @@ class InsuranceCardService extends BaseService {
List<InsuranceApprovalModel> get insuranceApproval => _insuranceApproval;
GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse =
GetAllSharedRecordsByStatusResponse();
clearInsuranceCard() {
_cardList.clear();
}
@ -101,7 +109,7 @@ class InsuranceCardService extends BaseService {
Future getInsuranceApproval({int appointmentNo}) async {
hasError = false;
// _cardList.clear();
if(appointmentNo != null) {
if (appointmentNo != null) {
_insuranceApprovalModel.appointmentNo = appointmentNo;
_insuranceApprovalModel.eXuldAPPNO = null;
_insuranceApprovalModel.projectID = null;
@ -124,4 +132,35 @@ class InsuranceCardService extends BaseService {
super.error = error;
}, body: _insuranceApprovalModel.toJson());
}
Future getFamilyFiles() async {
var myFamily = await sharedPref.getObject(FAMILY_FILE);
if (myFamily != null) {
getAllSharedRecordsByStatusResponse =
GetAllSharedRecordsByStatusResponse.fromJson(myFamily);
} else {
getSharedRecordByStatus();
}
}
Future getSharedRecordByStatus() async {
try {
dynamic localRes;
var request = GetAllSharedRecordsByStatusReq();
request.status = 0;
await baseAppClient.post(GET_SHARED_RECORD_BY_STATUS,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
AppToast.showErrorToast(message: error);
throw error;
}, body: request.toJson());
sharedPref.setObject(FAMILY_FILE, localRes);
getAllSharedRecordsByStatusResponse =
GetAllSharedRecordsByStatusResponse.fromJson(localRes);
} catch (error) {
print(error);
throw error;
}
}
}

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart';
import 'package:diplomaticquarterapp/core/model/labs/request_patient_lab_orders.dart';
@ -28,6 +29,7 @@ class LabsService extends BaseService {
RequestPatientLabSpecialResult();
List<PatientLabSpecialResult> patientLabSpecialResult = List();
List<LabResult> labResultList = List();
Future getLaboratoryResult(
{String projectID,
@ -52,6 +54,27 @@ class LabsService extends BaseService {
}, body: _requestPatientLabSpecialResult.toJson());
}
Future getPatientLabResult({PatientLabOrders patientLabOrder}) async {
hasError = false;
Map<String, dynamic> body = Map();
body['InvoiceNo'] = patientLabOrder.invoiceNo;
body['OrderNo'] = patientLabOrder.orderNo;
body['Procedure'] = "U/A";
body['ProjectID'] = patientLabOrder.projectID;
body['ClinicID'] = patientLabOrder.clinicID;
//TODO Check the res
await baseAppClient.post(GET_Patient_LAB_RESULT,
onSuccess: (dynamic response, int statusCode) {
patientLabSpecialResult.clear();
response['ListPLR'].forEach((lab) {
labResultList.add(LabResult.fromJson(lab));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
RequestSendLabReportEmail _requestSendLabReportEmail =
RequestSendLabReportEmail();

@ -0,0 +1,83 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/reports/Reports.dart';
import 'package:diplomaticquarterapp/core/model/reports/request_reports.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart';
class ReportsMonthlyService extends BaseService {
List<Reports> reportsList = List();
List<AppointmentHistory> appointHistoryList = List();
RequestReports _requestReports = RequestReports(
isReport: true,
encounterType: 1,
requestType: 1,
versionID: 5.5,
channel: 3,
languageID: 2,
iPAdress: "10.20.10.20",
generalid: 'Cs2020@2016\$2958',
patientOutSA: 0,
sessionID: 'KIbLoqkytuKJEWECHQ',
isDentalAllowedBackend: false,
deviceTypeID: 2,
patientID: 1231755,
tokenID: '@dm!n',
patientTypeID: 1,
patientType: 1);
Future getReports() async {
hasError = false;
await baseAppClient.post(REPORTS,
onSuccess: (dynamic response, int statusCode) {
reportsList.clear();
response['GetPatientMedicalStatus'].forEach((reports) {
reportsList.add(Reports.fromJson(reports));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestReports.toJson());
}
Future getPatentAppointmentHistory() async {
hasError = false;
Map<String, dynamic> body = new Map<String, dynamic>();
body['IsForMedicalReport'] = true;
await baseAppClient.post(GET_PATIENT_AppointmentHistory,
onSuccess: (dynamic response, int statusCode) {
appointHistoryList = [];
response['AppoimentAllHistoryResultList'].forEach((appoint) {
appointHistoryList.add(AppointmentHistory.fromJson(appoint));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future insertRequestForMedicalReport(
AppointmentHistory appointmentHistory) async {
Map<String, dynamic> body = new Map<String, dynamic>();
body['ClinicID'] = appointmentHistory.clinicID;
body['DoctorID'] = appointmentHistory.doctorID;
body['SetupID'] = appointmentHistory.setupID;
body['EncounterNo'] = appointmentHistory.appointmentNo;
body['EncounterType'] = 1;// appointmentHistory.appointmentType;
body['IsActive'] = appointmentHistory.isActiveDoctor;
body['ProjectID'] = appointmentHistory.projectID;
body['Remarks'] = "";
body['ProcedureId'] = "";
body['RequestType'] = 1;
body['Source'] = 2;
body['Status'] = 1;
body['CreatedBy'] = 102;
hasError = false;
await baseAppClient.post(INSERT_REQUEST_FOR_MEDICAL_REPORT,
onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dar
import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update.dart';
import 'package:diplomaticquarterapp/core/service/insurance_service.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import '../../locator.dart';
import 'base_view_model.dart';
@ -20,6 +21,9 @@ class InsuranceViewModel extends BaseViewModel {
List<InsuranceApprovalModel> get insuranceApproval =>
_insuranceCardService.insuranceApproval;
GetAllSharedRecordsByStatusResponse get getAllSharedRecordsByStatusResponse =>
_insuranceCardService.getAllSharedRecordsByStatusResponse;
Future getInsurance() async {
hasError = false;
_insuranceCardService.clearInsuranceCard();
@ -41,7 +45,7 @@ class InsuranceViewModel extends BaseViewModel {
error = _insuranceCardService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
getFamilyFiles();
}
Future getInsuranceApproval({int appointmentNo}) async {
@ -59,4 +63,13 @@ class InsuranceViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
}
Future getFamilyFiles() async {
await _insuranceCardService.getFamilyFiles();
if (_insuranceCardService.hasError) {
error = _insuranceCardService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
}

@ -1,6 +1,6 @@
import 'package:diplomaticquarterapp/core/enum/filter_type.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart';
import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart';
@ -78,13 +78,32 @@ class LabsViewModel extends BaseViewModel {
List<PatientLabSpecialResult> get patientLabSpecialResult =>
_labsService.patientLabSpecialResult;
List<LabResult> get labResultList => _labsService.labResultList;
getLaboratoryResult(
{String projectID,
int clinicID,
String invoiceNo,
String orderNo}) async {
setState(ViewState.Busy);
await _labsService.getLaboratoryResult(invoiceNo: invoiceNo,orderNo: orderNo,projectID: projectID,clinicID: clinicID);
await _labsService.getLaboratoryResult(
invoiceNo: invoiceNo,
orderNo: orderNo,
projectID: projectID,
clinicID: clinicID);
if (_labsService.hasError) {
error = _labsService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
getPatientLabResult({PatientLabOrders patientLabOrder}) async {
setState(ViewState.Busy);
await _labsService.getPatientLabResult(
patientLabOrder: patientLabOrder
);
if (_labsService.hasError) {
error = _labsService.error;
setState(ViewState.Error);

@ -0,0 +1,84 @@
import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import '../../../core/enum/reportfilter_type.dart';
import '../../../core/enum/viewstate.dart';
import '../../../core/model/reports/Reports.dart';
import '../../../core/service/medical/reports_service.dart';
import '../../../locator.dart';
import '../base_view_model.dart';
class ReportsMonthlyViewModel extends BaseViewModel {
ReportFilterType filterType = ReportFilterType.Requested;
ReportsService _reportsService = locator<ReportsService>();
List<Reports> reportsOrderRequestList = List();
List<Reports> reportsOrderReadyList = List();
List<Reports> reportsOrderCompletedList = List();
List<Reports> reportsOrderCanceledList = List();
List<AppointmentHistory> get appointHistoryList =>
_reportsService.appointHistoryList;
getReports() async {
setState(ViewState.Busy);
reportsOrderRequestList.clear();
reportsOrderReadyList.clear();
reportsOrderCompletedList.clear();
reportsOrderCanceledList.clear();
await _reportsService.getReports();
if (_reportsService.hasError) {
error = _reportsService.error;
setState(ViewState.Error);
} else {
_filterList();
setState(ViewState.Idle);
}
}
getPatentAppointmentHistory() async {
setState(ViewState.Busy);
await _reportsService.getPatentAppointmentHistory();
if (_reportsService.hasError) {
error = _reportsService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
void _filterList() {
_reportsService.reportsList.forEach((report) {
switch (report.status) {
case 1:
reportsOrderRequestList.add(report);
break;
case 2:
reportsOrderReadyList.add(report);
break;
case 3:
reportsOrderCompletedList.add(report);
break;
case 4:
reportsOrderCanceledList.add(report);
break;
default:
}
});
}
insertRequestForMedicalReport(AppointmentHistory appointmentHistory)async{
setState(ViewState.Busy);
await _reportsService.insertRequestForMedicalReport(appointmentHistory);
if (_reportsService.hasError) {
error = _reportsService.error;
AppToast.showErrorToast(message: error);
setState(ViewState.ErrorLocal);
} else {
AppToast.showSuccessToast(message: 'The order was send ');
setState(ViewState.Idle);
}
}
}

@ -12,6 +12,7 @@ import 'core/service/medical/medical_service.dart';
import 'core/service/medical/my_doctor_service.dart';
import 'core/service/medical/prescriptions_service.dart';
import 'core/service/medical/radiology_service.dart';
import 'core/service/medical/reports_monthly_service.dart';
import 'core/service/medical/vital_sign_service.dart';
import 'core/viewModels/appointment_rate_view_model.dart';
import 'core/viewModels/feedback/feedback_view_model.dart';
@ -22,6 +23,7 @@ import 'core/viewModels/medical/medical_view_model.dart';
import 'core/viewModels/medical/my_doctor_view_model.dart';
import 'core/viewModels/medical/prescriptions_view_model.dart';
import 'core/viewModels/medical/radiology_view_model.dart';
import 'core/viewModels/medical/reports_monthly_view_model.dart';
import 'core/viewModels/medical/vital_sign_view_model.dart';
import 'core/viewModels/medical/reports_view_model.dart';
import 'core/viewModels/pharmacies_view_model.dart';
@ -53,6 +55,7 @@ void setupLocator() {
locator.registerLazySingleton(() => AppointmentRateService());
locator.registerLazySingleton(() => QrService());
locator.registerFactory(() => VaccineService());
locator.registerLazySingleton(() => ReportsMonthlyService());
/// View Model
locator.registerFactory(() => HospitalViewModel());
@ -70,5 +73,6 @@ void setupLocator() {
locator.registerFactory(() => DashboardViewModel());
locator.registerFactory(() => AppointmentRateViewModel());
locator.registerFactory(() => QrViewModel());
locator.registerFactory(() => ReportsMonthlyViewModel());
}

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:flutter/cupertino.dart';
@ -97,9 +98,12 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
children: <Widget>[
Container(
child: ListView.builder(
itemCount: model.insuranceUpdate == null
itemCount: model.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList ==
null
? 0
: model.insuranceUpdate.length,
: model.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList.length,
itemBuilder: (BuildContext context, int index) {
return Container(
margin: EdgeInsets.all(10.0),
@ -112,81 +116,63 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
child: Container(
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.0),
child: Column(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 3,
child: Container(
margin: EdgeInsets.only(
top: 2.0,
left: 10.0,
right: 20.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Text("TAMER FANASHEH ",
style: TextStyle(
fontSize: 14.0,
color: Colors.black,
fontWeight:
FontWeight.w500,
letterSpacing: 1.0)),
Text(
'File No.' +
model
.insuranceUpdate[
index]
.patientID
.toString(),
style: TextStyle(
fontSize: 14.0,
color: Colors.black,
fontWeight:
FontWeight.w500,
letterSpacing: 1.0)),
Text(
model.insuranceUpdate[index]
.createdOn,
style: TextStyle(
fontSize: 14.0,
color: Colors.black,
fontWeight:
FontWeight.w500,
letterSpacing: 1.0)),
],
),
),
Expanded(
flex: 3,
child: Container(
margin: EdgeInsets.only(
top: 2.0, left: 10.0, right: 20.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Text(
model.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index].patientName,
style: TextStyle(
fontSize: 14.0,
color: Colors.black,
fontWeight: FontWeight.w500,
letterSpacing: 1.0)),
Text(
'File No.' +
model.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index].patientID.toString(),
style: TextStyle(
fontSize: 14.0,
color: Colors.black,
fontWeight: FontWeight.w500,
letterSpacing: 1.0)),
],
),
Expanded(
flex: 1,
child: Container(
// height: MediaQuery.of(context).size.height * 0.12,
margin: EdgeInsets.only(top: 20.0),
child: Column(
children: <Widget>[
Container(
child: Button(
label: 'Fetch',
),
height: SizeConfig
.heightMultiplier *
3.8,
width:
SizeConfig.screenWidth *
4.2,
),
],
),
),
)
],
),
),
Expanded(
flex: 2,
child: Container(
// height: MediaQuery.of(context).size.height * 0.12,
margin: EdgeInsets.only(top: 2.0),
child: Column(
children: <Widget>[
Container(
child: SecondaryButton(
label: 'Update',
small: true,
textColor: Colors.white,
// color: Colors.grey,
),
//height: 45,
// width:90
),
],
),
),
)
],
),
),

@ -235,16 +235,21 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
physics: NeverScrollableScrollPhysics(),
controller: pageController,
children: [
HomePage(goToMyProfile: (){
_changeCurrentTab(1);
},),
HomePage(
goToMyProfile: () {
_changeCurrentTab(1);
},
),
MedicalProfilePage(),
MyAdmissionsPage(),
ToDo(),
BookingOptions()
], // Please do not remove the BookingOptions from this array
),
bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab,index: currentTab,),
bottomNavigationBar: BottomNavBar(
changeIndex: _changeCurrentTab,
index: currentTab,
),
);
}
@ -307,6 +312,4 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
_changeCurrentTab(2);
}
}
}

@ -27,8 +27,10 @@ class LaboratoryResultPage extends StatelessWidget {
body: ListView.builder(
itemBuilder: (context, index) => LaboratoryResultWidget(
onTap: () => model.sendLabReportEmail(patientLabOrder: patientLabOrders),
billNo: model.patientLabSpecialResult[index].invoiceNo,
billNo: patientLabOrders.invoiceNo,
details: model.patientLabSpecialResult[index].resultDataHTML,
orderNo: patientLabOrders.orderNo,
patientLabOrder: patientLabOrders,
),
itemCount: model.patientLabSpecialResult.length,
),

@ -73,7 +73,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
itemCount:
model.appoitmentAllHistoryResultList.length,
scrollDirection: Axis.horizontal,
reverse: true,
reverse: !projectViewModel.isArabic,
),
],
),

@ -0,0 +1,18 @@
import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
class MonthlyReportsPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BaseView<ReportsMonthlyViewModel>(
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).monthlyReports,
body: Container(),
),
);
}
}

@ -508,6 +508,7 @@ class TranslationBase {
String get orderNo => localizedValues['OrderNo'][locale.languageCode];
String get orderDetails => localizedValues['OrderDetails'][locale.languageCode];
String get vitalSign => localizedValues['VitalSign'][locale.languageCode];
String get monthlyReports => localizedValues['MonthlyReports'][locale.languageCode];
}

@ -1,5 +1,13 @@
import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import '../text.dart';
@ -7,8 +15,16 @@ class LaboratoryResultWidget extends StatefulWidget {
final GestureTapCallback onTap;
final String billNo;
final String details;
final String orderNo;
final PatientLabOrders patientLabOrder;
const LaboratoryResultWidget({Key key, this.onTap, this.billNo, this.details})
const LaboratoryResultWidget(
{Key key,
this.onTap,
this.billNo,
this.details,
this.orderNo,
this.patientLabOrder})
: super(key: key);
@override
@ -17,9 +33,12 @@ class LaboratoryResultWidget extends StatefulWidget {
class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
bool _isShowMore = false;
bool _isShowMoreGeneral = false;
ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return Container(
margin: EdgeInsets.all(15),
child: Column(
@ -45,7 +64,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts('Bill No'),
Texts('Invoice No'),
Texts(widget.billNo),
],
),
@ -102,7 +121,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
)),
child: Row(
children: <Widget>[
Expanded(child: Texts('Result')),
Expanded(child: Texts('Special Result')),
Container(
width: 25,
height: 25,
@ -132,12 +151,211 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
bottomRight: Radius.circular(5.0),
)),
duration: Duration(milliseconds: 7000),
child: Text(widget.details?? 'No Data'),
)
child: Container(
width: double.infinity,
child: Text(widget.details ?? 'No Data')),
),
SizedBox(height: 12,),
BaseView<LabsViewModel>(
onModelReady: (model) => model.getPatientLabResult(
patientLabOrder: widget.patientLabOrder),
builder: (_, model, w) => NetworkBaseView(
baseViewModel: model,
child: 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('General Result')),
Container(
width: 25,
height: 25,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.red[900]),
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>[
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Texts('U/A'),
InkWell(
onTap: () {
model.getPatientLabResult(
patientLabOrder:
widget.patientLabOrder);
},
child: Texts(
'Flow Chart',
decoration: TextDecoration.underline,
color: Colors.blue,
),
),
],
),
Table(
border: TableBorder.symmetric(
inside: BorderSide(
width: 2.0, color: Colors.grey[300]),
),
children: fullData(model.labResultList),
),
],
),
),
),
],
),
),
),
)
],
),
],
),
);
}
List<TableRow> fullData(List<LabResult> labResultList) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
children: [
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
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(
'Description',
color: Colors.white,
),
),
height: 60,
),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
),
child: Center(
child: Texts('Value', color: Colors.white),
),
height: 60),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
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('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,
textAlign: TextAlign.center,
),
),
),
),
Container(
child: Container(
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
lab.referanceRange,
textAlign: TextAlign.center,
),
),
),
),
],
),
);
});
return tableRow;
}
}

@ -74,7 +74,7 @@ class AppScaffold extends StatelessWidget {
)
: buildBodyWidget(),
bottomSheet: bottomSheet,
bottomNavigationBar: BottomBarSearch()
// bottomNavigationBar: BottomBarSearch()
//floatingActionButton: FloatingSearchButton(),
);
}

@ -38,7 +38,7 @@ dependencies:
url_launcher: ^5.5.0
shared_preferences: ^0.5.8
flutter_flexible_toast: ^0.1.4
firebase_messaging: 6.0.12
firebase_messaging: ^7.0.0
# Progress bar
progress_hud_v2: ^2.0.0

Loading…
Cancel
Save