fix lab result issues
parent
02ce04a397
commit
fe66ee5993
@ -1,6 +1,6 @@
|
|||||||
#Fri Jun 23 08:50:38 CEST 2017
|
#Thu Sep 03 16:26:30 EEST 2020
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
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 |
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue