labs result done add some file to git ignore for ios

merge-requests/13/merge
Mohammad Aljammal 5 years ago
parent 1bbbd18373
commit a12197fe70

2
ios/.gitignore vendored

@ -30,3 +30,5 @@ Runner/GeneratedPluginRegistrant.*
!default.mode2v3
!default.pbxuser
!default.perspectivev3
/Runner.xcworkspace/contents.xcworkspacedata
/Runner.xcodeproj/project.pbxproj

@ -25,6 +25,12 @@ const SEND_PRESCRIPTION_EMAIL = '/Notifications.svc/REST/SendPrescriptionEmail'
const GET_Patient_LAB_ORDERS = '/Patients.svc/REST/GetPatientLabOrders';
const GET_Patient_LAB_SPECIAL_RESULT = '/Patients.svc/REST/GetPatientLabSpecialResults';
///
const GET_PATIENT_ORDERS = '/Patients.svc/REST/GetPatientRadOrders';
const GET_PATIENT_ORDERS_DETAILS = '/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead';
const GET_RAD_IMAGE_URL = '/Patients.svc/Rest/GetRadImageURL';
const SEND_RAD_REPORT_EMAIL = '/Notifications.svc/REST/SendRadReportEmail';
//const BASE_URL = 'https://hmgwebservices.com/'; // Production Environment
//const BASE_URL = 'https://uat.hmgwebservices.com/Services'; // UAT Environment

@ -0,0 +1,187 @@
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class FinalRadiology {
String setupID;
int projectID;
Null patientID;
int invoiceLineItemNo;
int invoiceNo;
int doctorID;
int clinicID;
DateTime orderDate;
String reportData;
String imageURL;
String procedureID;
int appointmentNo;
Null dIAPacsURL;
bool isRead;
String readOn;
var admissionNo;
bool isInOutPatient;
int actualDoctorRate;
String clinicDescription;
String dIAPACSURL;
String doctorImageURL;
String doctorName;
int doctorRate;
String doctorTitle;
int gender;
String genderDescription;
bool isActiveDoctorProfile;
bool isExecludeDoctor;
String isInOutPatientDescription;
String isInOutPatientDescriptionN;
String nationalityFlagURL;
int noOfPatientsRate;
int orderNo;
String projectName;
String qR;
String reportDataHTML;
String reportDataTextString;
List<String> speciality;
bool isCVI;
bool isRadMedicalReport;
FinalRadiology(
{this.setupID,
this.projectID,
this.patientID,
this.invoiceLineItemNo,
this.invoiceNo,
this.doctorID,
this.clinicID,
this.orderDate,
this.reportData,
this.imageURL,
this.procedureID,
this.appointmentNo,
this.dIAPacsURL,
this.isRead,
this.readOn,
this.admissionNo,
this.isInOutPatient,
this.actualDoctorRate,
this.clinicDescription,
this.dIAPACSURL,
this.doctorImageURL,
this.doctorName,
this.doctorRate,
this.doctorTitle,
this.gender,
this.genderDescription,
this.isActiveDoctorProfile,
this.isExecludeDoctor,
this.isInOutPatientDescription,
this.isInOutPatientDescriptionN,
this.nationalityFlagURL,
this.noOfPatientsRate,
this.orderNo,
this.projectName,
this.qR,
this.reportDataHTML,
this.reportDataTextString,
this.speciality,
this.isCVI,
this.isRadMedicalReport});
FinalRadiology.fromJson(Map<String, dynamic> json) {
try {
setupID = json['SetupID'];
projectID = json['ProjectID'];
patientID = json['PatientID'];
invoiceLineItemNo = json['InvoiceLineItemNo'];
invoiceNo = json['InvoiceNo'];
doctorID = json['DoctorID'];
clinicID = json['ClinicID'];
orderDate = DateUtil.convertStringToDate(json['OrderDate']);
reportData = json['ReportData'];
imageURL = json['ImageURL'];
procedureID = json['ProcedureID'];
appointmentNo = json['AppointmentNo'];
dIAPacsURL = json['DIAPacsURL'];
isRead = json['IsRead'];
readOn = json['ReadOn'];
admissionNo = json['AdmissionNo'];
isInOutPatient = json['IsInOutPatient'];
actualDoctorRate = json['ActualDoctorRate'];
clinicDescription = json['ClinicDescription'];
dIAPACSURL = json['DIA_PACS_URL'];
doctorImageURL = json['DoctorImageURL'];
doctorName = json['DoctorName'];
doctorRate = json['DoctorRate'];
doctorTitle = json['DoctorTitle'];
gender = json['Gender'];
genderDescription = json['GenderDescription'];
isActiveDoctorProfile = json['IsActiveDoctorProfile'];
isExecludeDoctor = json['IsExecludeDoctor'];
isInOutPatientDescription = json['IsInOutPatientDescription'];
isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN'];
nationalityFlagURL = json['NationalityFlagURL'];
noOfPatientsRate = json['NoOfPatientsRate'];
orderNo = json['OrderNo'];
projectName = json['ProjectName'];
qR = json['QR'];
reportDataHTML = json['ReportDataHTML'];
reportDataTextString = json['ReportDataTextString'];
// speciality = json['Speciality'].cast<String>();
isCVI = json['isCVI'];
isRadMedicalReport = json['isRadMedicalReport'];
} catch (e) {
print(e);
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['PatientID'] = this.patientID;
data['InvoiceLineItemNo'] = this.invoiceLineItemNo;
data['InvoiceNo'] = this.invoiceNo;
data['DoctorID'] = this.doctorID;
data['ClinicID'] = this.clinicID;
data['OrderDate'] = this.orderDate;
data['ReportData'] = this.reportData;
data['ImageURL'] = this.imageURL;
data['ProcedureID'] = this.procedureID;
data['AppointmentNo'] = this.appointmentNo;
data['DIAPacsURL'] = this.dIAPacsURL;
data['IsRead'] = this.isRead;
data['ReadOn'] = this.readOn;
data['AdmissionNo'] = this.admissionNo;
data['IsInOutPatient'] = this.isInOutPatient;
data['ActualDoctorRate'] = this.actualDoctorRate;
data['ClinicDescription'] = this.clinicDescription;
data['DIA_PACS_URL'] = this.dIAPACSURL;
data['DoctorImageURL'] = this.doctorImageURL;
data['DoctorName'] = this.doctorName;
data['DoctorRate'] = this.doctorRate;
data['DoctorTitle'] = this.doctorTitle;
data['Gender'] = this.gender;
data['GenderDescription'] = this.genderDescription;
data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile;
data['IsExecludeDoctor'] = this.isExecludeDoctor;
data['IsInOutPatientDescription'] = this.isInOutPatientDescription;
data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN;
data['NationalityFlagURL'] = this.nationalityFlagURL;
data['NoOfPatientsRate'] = this.noOfPatientsRate;
data['OrderNo'] = this.orderNo;
data['ProjectName'] = this.projectName;
data['QR'] = this.qR;
data['ReportDataHTML'] = this.reportDataHTML;
data['ReportDataTextString'] = this.reportDataTextString;
data['Speciality'] = this.speciality;
data['isCVI'] = this.isCVI;
data['isRadMedicalReport'] = this.isRadMedicalReport;
return data;
}
}
class FinalRadiologyList {
String filterName = "";
List<FinalRadiology> finalRadiologyList = List();
FinalRadiologyList({this.filterName, FinalRadiology finalRadiology}) {
finalRadiologyList.add(finalRadiology);
}
}

@ -0,0 +1,92 @@
class RequestPatientRadOrdersDetails {
int projectID;
int orderNo;
int invoiceNo;
String setupID;
String procedureID;
bool isMedicalReport;
bool isCVI;
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;
RequestPatientRadOrdersDetails(
{this.projectID,
this.orderNo,
this.invoiceNo,
this.setupID,
this.procedureID,
this.isMedicalReport,
this.isCVI,
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});
RequestPatientRadOrdersDetails.fromJson(Map<String, dynamic> json) {
projectID = json['ProjectID'];
orderNo = json['OrderNo'];
invoiceNo = json['InvoiceNo'];
setupID = json['SetupID'];
procedureID = json['ProcedureID'];
isMedicalReport = json['IsMedicalReport'];
isCVI = json['isCVI'];
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['ProjectID'] = this.projectID;
data['OrderNo'] = this.orderNo;
data['InvoiceNo'] = this.invoiceNo;
data['SetupID'] = this.setupID;
data['ProcedureID'] = this.procedureID;
data['IsMedicalReport'] = this.isMedicalReport;
data['isCVI'] = this.isCVI;
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,116 @@
class RequestSendRadReportEmail {
int channel;
String clinicName;
String dateofBirth;
int deviceTypeID;
String doctorName;
String generalid;
int invoiceNo;
String iPAdress;
bool isDentalAllowedBackend;
int languageID;
String orderDate;
int patientID;
String patientIditificationNum;
String patientMobileNumber;
String patientName;
int patientOutSA;
int patientType;
int patientTypeID;
int projectID;
String projectName;
String radResult;
String sessionID;
String setupID;
String to;
String tokenID;
double versionID;
RequestSendRadReportEmail(
{this.channel,
this.clinicName,
this.dateofBirth,
this.deviceTypeID,
this.doctorName,
this.generalid,
this.invoiceNo,
this.iPAdress,
this.isDentalAllowedBackend,
this.languageID,
this.orderDate,
this.patientID,
this.patientIditificationNum,
this.patientMobileNumber,
this.patientName,
this.patientOutSA,
this.patientType,
this.patientTypeID,
this.projectID,
this.projectName,
this.radResult,
this.sessionID,
this.setupID,
this.to,
this.tokenID,
this.versionID});
RequestSendRadReportEmail.fromJson(Map<String, dynamic> json) {
channel = json['Channel'];
clinicName = json['ClinicName'];
dateofBirth = json['DateofBirth'];
deviceTypeID = json['DeviceTypeID'];
doctorName = json['DoctorName'];
generalid = json['generalid'];
invoiceNo = json['InvoiceNo'];
iPAdress = json['IPAdress'];
isDentalAllowedBackend = json['isDentalAllowedBackend'];
languageID = json['LanguageID'];
orderDate = json['OrderDate'];
patientID = json['PatientID'];
patientIditificationNum = json['PatientIditificationNum'];
patientMobileNumber = json['PatientMobileNumber'];
patientName = json['PatientName'];
patientOutSA = json['PatientOutSA'];
patientType = json['PatientType'];
patientTypeID = json['PatientTypeID'];
projectID = json['ProjectID'];
projectName = json['ProjectName'];
radResult = json['RadResult'];
sessionID = json['SessionID'];
setupID = json['SetupID'];
to = json['To'];
tokenID = json['TokenID'];
versionID = json['VersionID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Channel'] = this.channel;
data['ClinicName'] = this.clinicName;
data['DateofBirth'] = this.dateofBirth;
data['DeviceTypeID'] = this.deviceTypeID;
data['DoctorName'] = this.doctorName;
data['generalid'] = this.generalid;
data['InvoiceNo'] = this.invoiceNo;
data['IPAdress'] = this.iPAdress;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['LanguageID'] = this.languageID;
data['OrderDate'] = this.orderDate;
data['PatientID'] = this.patientID;
data['PatientIditificationNum'] = this.patientIditificationNum;
data['PatientMobileNumber'] = this.patientMobileNumber;
data['PatientName'] = this.patientName;
data['PatientOutSA'] = this.patientOutSA;
data['PatientType'] = this.patientType;
data['PatientTypeID'] = this.patientTypeID;
data['ProjectID'] = this.projectID;
data['ProjectName'] = this.projectName;
data['RadResult'] = this.radResult;
data['SessionID'] = this.sessionID;
data['SetupID'] = this.setupID;
data['To'] = this.to;
data['TokenID'] = this.tokenID;
data['VersionID'] = this.versionID;
return data;
}
}

@ -14,12 +14,11 @@ AppSharedPreferences sharedPref = new AppSharedPreferences();
/// body: null);
class BaseAppClient {
post(
String endPoint, {
Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
}) async {
post(String endPoint,
{Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
bool isAllowAny = false}) async {
String url = BASE_URL + endPoint;
try {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
@ -55,13 +54,16 @@ class BaseAppClient {
onFailure('Error While Fetching data', statusCode);
} else {
var parsed = json.decode(response.body.toString());
if (!parsed['IsAuthenticated']) {
if (isAllowAny) {
onSuccess(parsed, statusCode);
} else if (!parsed['IsAuthenticated']) {
if (parsed['isSMSSent'] == true) {
onSuccess(parsed, statusCode);
}
// await helpers.logout();
//helpers.showErrorToast('Your session expired Please login agian');
var asd ="";
print(parsed['IsAuthenticated']);
var asd = "";
// TODO create logout fun
} else if (parsed['MessageStatus'] == 1 ||
parsed['SMSLoginRequired'] == true) {

@ -16,22 +16,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
class LabsService extends BaseService {
RequestPatientLabOrders _requestPatientLabOrders = RequestPatientLabOrders(
versionID: 5.5,
channel: 3,
languageID: 2,
iPAdress: '10.20.10.20',
generalid: 'Cs2020@2016\$2958',
patientOutSA: 0,
sessionID: 'TMRhVmkGhOsvamErw',
isDentalAllowedBackend: false,
deviceTypeID: 1,
patientID: 1231755,
tokenID: '@dm!n',
patientType: 1,
patientTypeID: 1
);
RequestPatientLabOrders _requestPatientLabOrders = RequestPatientLabOrders();
List<PatientLabOrders> patientLabOrdersList = List();

@ -0,0 +1,98 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/doctor/doctor_profile.dart';
import 'package:diplomaticquarterapp/core/model/doctor/doctor_rating.dart';
import 'package:diplomaticquarterapp/core/model/doctor/patient_doctor_appointment.dart';
import 'package:diplomaticquarterapp/core/model/doctor/reques_patient_doctor_appointmentt.dart';
import 'package:diplomaticquarterapp/core/model/doctor/request_doctor_profile.dart';
import 'package:diplomaticquarterapp/core/model/doctor/request_doctor_rating.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';
import 'package:diplomaticquarterapp/core/model/labs/request_patient_lab_special_result.dart';
import 'package:diplomaticquarterapp/core/model/labs/request_send_lab_report_email.dart';
import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart';
import 'package:diplomaticquarterapp/core/model/radiology/request_send_rad_report_email.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
class RadiologyService extends BaseService {
List<FinalRadiology> finalRadiologyList = List();
String url = '';
Future getRadImageURL({int invoiceNo, int lineItem,int projectId}) async {
hasError = false;
final Map<String, dynamic> body = new Map<String, dynamic>();
body['InvoiceNo'] = invoiceNo;
body['LineItemNo'] = lineItem;
body['ProjectID'] = projectId;
await baseAppClient.post(GET_RAD_IMAGE_URL,
isAllowAny: true,
onSuccess: (dynamic response, int statusCode) {
url = response['Data'];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getPatientRadOrders () async {
hasError = false;
await baseAppClient.post(GET_PATIENT_ORDERS,
onSuccess: (dynamic response, int statusCode) {
finalRadiologyList.clear();
response['FinalRadiologyList'].forEach((radiology) {
finalRadiologyList.add(FinalRadiology.fromJson(radiology));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: Map());
}
Future getPatientRadOrdersDetails() async {
hasError = false;
await baseAppClient.post(GET_PATIENT_ORDERS,
onSuccess: (dynamic response, int statusCode) {
finalRadiologyList.clear();
response['FinalRadiologyList'].forEach((radiology) {
finalRadiologyList.add(FinalRadiology.fromJson(radiology));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: Map());
}
RequestSendRadReportEmail _requestSendRadReportEmail =
RequestSendRadReportEmail();
Future sendRadReportEmail(
{FinalRadiology finalRadiology}) async {
_requestSendRadReportEmail.projectID = finalRadiology.projectID;
_requestSendRadReportEmail.clinicName = finalRadiology.clinicDescription;
_requestSendRadReportEmail.invoiceNo = finalRadiology.invoiceNo;
_requestSendRadReportEmail.setupID = finalRadiology.setupID;
_requestSendRadReportEmail.doctorName = finalRadiology.doctorName;
_requestSendRadReportEmail.orderDate = '${finalRadiology.orderDate.year}-${finalRadiology.orderDate.month}-${finalRadiology.orderDate.day}';
_requestSendRadReportEmail.patientIditificationNum = '2344670985';//TODO change it
_requestSendRadReportEmail.patientMobileNumber = '537503378';//TODO change it
_requestSendRadReportEmail.patientName = 'TAMER FANASHE';//TODO change it
_requestSendRadReportEmail.patientIditificationNum = '2344670985';//TODO change it
_requestSendRadReportEmail.projectName = finalRadiology.projectName;
_requestSendRadReportEmail.radResult = 'asd';//finalRadiology.reportData;
_requestSendRadReportEmail.to = 'Tamer.fanasheh@gmail.com';
_requestSendRadReportEmail.dateofBirth = '/Date(536743800000+0300)/';
hasError = false;
await baseAppClient.post(SEND_RAD_REPORT_EMAIL,
isAllowAny: true,
onSuccess: (dynamic response, int statusCode) {
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestSendRadReportEmail.toJson());
}
}

@ -0,0 +1,108 @@
import 'package:diplomaticquarterapp/core/enum/filter_type.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/doctor/doctor_profile.dart';
import 'package:diplomaticquarterapp/core/model/doctor/doctor_rating.dart';
import 'package:diplomaticquarterapp/core/model/doctor/patient_doctor_appointment.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/radiology/final_radiology.dart';
import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart';
import 'package:diplomaticquarterapp/core/service/medical/my_doctor_service.dart';
import 'package:diplomaticquarterapp/core/service/medical/radiology_service.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import '../../../locator.dart';
import '../base_view_model.dart';
class RadiologyViewModel extends BaseViewModel {
FilterType filterType = FilterType.Clinic;
RadiologyService _radiologyService = locator<RadiologyService>();
List<FinalRadiologyList> _finalRadiologyListClinic = List();
List<FinalRadiologyList> _finalRadiologyListHospital = List();
List<FinalRadiologyList> get finalRadiologyList =>
filterType == FilterType.Clinic
? _finalRadiologyListClinic
: _finalRadiologyListHospital;
void getPatientRadOrders() async {
setState(ViewState.Busy);
await _radiologyService.getPatientRadOrders();
if (_radiologyService.hasError) {
error = _radiologyService.error;
setState(ViewState.Error);
} else {
_radiologyService.finalRadiologyList.forEach((element) {
List<FinalRadiologyList> finalRadiologyListClinic =
_finalRadiologyListClinic
.where((elementClinic) =>
elementClinic.filterName == element.clinicDescription)
.toList();
if (finalRadiologyListClinic.length != 0) {
_finalRadiologyListClinic[
finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])]
.finalRadiologyList
.add(element);
} else {
_finalRadiologyListClinic.add(FinalRadiologyList(
filterName: element.clinicDescription, finalRadiology: element));
}
// FinalRadiologyList list sort via project
List<FinalRadiologyList> finalRadiologyListHospital =
_finalRadiologyListHospital
.where(
(elementClinic) =>
elementClinic.filterName == element.projectName,
)
.toList();
if (finalRadiologyListHospital.length != 0) {
_finalRadiologyListHospital[finalRadiologyListHospital
.indexOf(finalRadiologyListHospital[0])]
.finalRadiologyList
.add(element);
} else {
_finalRadiologyListHospital.add(FinalRadiologyList(
filterName: element.projectName, finalRadiology: element));
}
});
setState(ViewState.Idle);
}
}
String get radImageURL => _radiologyService.url;
getRadImageURL({int invoiceNo, int lineItem,int projectId}) async {
setState(ViewState.Busy);
await _radiologyService.getRadImageURL(invoiceNo: invoiceNo,lineItem: lineItem,projectId: projectId);
if (_radiologyService.hasError) {
error = _radiologyService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
sendRadReportEmail(
{FinalRadiology finalRadiology}) async {
setState(ViewState.BusyLocal);
await _radiologyService.sendRadReportEmail(
finalRadiology: finalRadiology
);
if (_radiologyService.hasError) {
error = _radiologyService.error;
AppToast.showErrorToast(message: error);
} else {
AppToast.showSuccessToast(message: 'A copy has been sent to the email');
}
setState(ViewState.Idle);
}
setFilterType(FilterType filterType) {
this.filterType = filterType;
notifyListeners();
}
}

@ -4,10 +4,12 @@ import 'core/service/hospital_service.dart';
import 'core/service/medical/labs_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/viewModels/hospital_view_model.dart';
import 'core/viewModels/medical/labs_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/pharmacies_view_model.dart';
import 'core/service/pharmacies_service.dart';
@ -21,6 +23,7 @@ void setupLocator() {
locator.registerLazySingleton(() => MyDoctorService());
locator.registerLazySingleton(() => PrescriptionsService());
locator.registerLazySingleton(() => LabsService());
locator.registerLazySingleton(() => RadiologyService());
/// View Model
locator.registerFactory(() => HospitalViewModel());
@ -28,5 +31,6 @@ void setupLocator() {
locator.registerFactory(() => MyDoctorViewModel());
locator.registerFactory(() => PrescriptionsViewModel());
locator.registerFactory(() => LabsViewModel());
locator.registerFactory(() => RadiologyViewModel());
}

@ -35,4 +35,10 @@ class _BaseViewState<T extends BaseViewModel> extends State<BaseView<T>> {
child: Consumer<T>(builder: widget.builder),
);
}
@override
void dispose() {
if (model != null) model = null;
super.dispose();
}
}

@ -1,6 +1,7 @@
import 'dart:math';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/sliver_app_bar_delegate.dart';
@ -75,10 +76,13 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
children: <Widget>[
Expanded(
flex: 1,
child: MedicalProfileItem(
title: 'Radiology',
imagePath: 'radiology_icon.png',
subTitle: 'Service',
child: InkWell(
onTap: () => Navigator.push(context, FadePage(page: RadiologyHomePage())),
child: MedicalProfileItem(
title: 'Radiology',
imagePath: 'radiology_icon.png',
subTitle: 'Service',
),
),
),
Expanded(
@ -129,7 +133,11 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
),
Expanded(
flex: 1,
child: Container(),
child: MedicalProfileItem(
title: 'Vital Signs',
imagePath: 'medical_history_icon.png',
subTitle: 'Reports',
),
)
],
),

@ -0,0 +1,67 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
class RadiologyDetailsPage extends StatelessWidget {
final FinalRadiology finalRadiology;
RadiologyDetailsPage({Key key, this.finalRadiology});
@override
Widget build(BuildContext context) {
return BaseView<RadiologyViewModel>(
onModelReady: (model) => model.getRadImageURL(
projectId: finalRadiology.projectID,
lineItem: finalRadiology.invoiceLineItemNo,
invoiceNo: finalRadiology.invoiceNo),
builder: (_, model, widget) => AppScaffold(
appBarTitle: 'Radiology Report',
isShowAppBar: true,
baseViewModel: model,
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Text('${finalRadiology.reportData}',textAlign: TextAlign.center,),
],
),
),
bottomSheet: Container(
width: double.infinity,
height: MediaQuery.of(context).size.height * 0.2,
color: Colors.grey[100],
child: Column(
children: <Widget>[
Divider(),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
onTap: () {
launch(model.radImageURL);
},
label: 'Open Radio Image',
backgroundColor: Colors.grey[800],
),
),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
onTap: () => model.sendRadReportEmail(
finalRadiology: finalRadiology),
label: 'Send Copy',
loading: model.state == ViewState.BusyLocal,
backgroundColor: Colors.red[800],
),
)
],
),
)),
);
}
}

@ -0,0 +1,102 @@
import 'package:diplomaticquarterapp/core/enum/filter_type.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class RadiologyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BaseView<RadiologyViewModel>(
onModelReady: (model) => model.getPatientRadOrders(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
appBarTitle: 'Radiology',
baseViewModel: model,
body: FractionallySizedBox(
widthFactor: 1.0,
child: ListView(
physics: BouncingScrollPhysics(),
children: <Widget>[
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () =>
model.setFilterType(FilterType.Clinic),
child: ListTile(
title: const Text('Clinic'),
leading: Radio(
value: FilterType.Clinic,
groupValue: model.filterType,
activeColor: Colors.red[800],
onChanged: (FilterType value) {
model.setFilterType(value);
},
),
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () => model
.setFilterType(FilterType.Hospital),
child: ListTile(
title: const Text('Hospital'),
leading: Radio(
value: FilterType.Hospital,
groupValue: model.filterType,
activeColor: Colors.red[800],
onChanged: (FilterType value) {
model.setFilterType(value);
},
),
),
),
)
],
),
...List.generate(
model.finalRadiologyList.length,
(index) => AppExpandableNotifier(
title: model
.finalRadiologyList[index].filterName,
bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: model
.finalRadiologyList[index].finalRadiologyList
.map((radiology) {
return InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: RadiologyDetailsPage(finalRadiology: radiology,),
),
),
child: DoctorCard(
name: radiology.doctorName,
profileUrl: radiology.doctorImageURL,
subName: '${radiology.projectName} \nBill No ${radiology.invoiceNo}',
date: DateUtil.getMonthDayYearDateFormatted(
radiology.orderDate),
),
);
}).toList(),
)),
)
],
),
),
),
);
}
}

@ -46,7 +46,7 @@ class DoctorCard extends StatelessWidget {
children: <Widget>[
Container(
width: 20,
height: date ==null ?100 : 130,
height: date == null ? 100 : 130,
decoration: BoxDecoration(
color: Colors.red[900],
borderRadius: BorderRadius.only(
@ -91,22 +91,22 @@ class DoctorCard extends StatelessWidget {
subName,
variant: 'caption3',
),
billNo != null
? Row(
children: <Widget>[
Texts(
'Bill No: ',
variant: 'caption3',
),
Texts(
billNo,
variant: 'caption3',
)
],
if (billNo != null)
Row(
children: <Widget>[
Texts(
'Bill No: ',
variant: 'caption3',
),
Texts(
billNo,
variant: 'caption3',
)
: StarRating(
totalAverage: rat,
forceStars: true),
],
),
if (rat != null)
StarRating(
totalAverage: rat, forceStars: true),
],
),
),

@ -38,7 +38,7 @@ class AppExpandableNotifier extends StatelessWidget {
header: Padding(
padding: EdgeInsets.all(10),
child: Text(
title,
title?? '',
style: TextStyle(fontWeight: FontWeight.bold,fontSize: 22,),
),
),

Loading…
Cancel
Save