diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index d7619066..3901554f 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -100,7 +100,17 @@ class BaseAppClient { else body['PatientOutSA'] = false; + // if (!body.containsKey('ProjectID')) { + // if (projectID != null) { + // body['ProjectID'] = projectID; + // } else { + // body['ProjectID'] = 0; + // } + // } + body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; + // print("ProjectID :"); + // print(body['ProjectID']); print("URL : $url"); print("Body : ${json.encode(body)}"); var asd = json.encode(body); @@ -223,6 +233,17 @@ class BaseAppClient { else body['PatientOutSA'] = false; + // if(!body.containsKey('ProjectID')) { + // if (projectID != null) { + // body['ProjectID'] = 313; + // } else { + // body['ProjectID'] = 0; + // } + // } + + // body['DoctorID'] = 24; //3844083 + // body['TokenID'] = "@dm!n"; + print("URL : $url"); print("Body : ${json.encode(body)}"); var asd = json.encode(body); diff --git a/lib/config/config.dart b/lib/config/config.dart index c8d7ceaf..439bcc4b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -6,12 +6,14 @@ const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; //Vida Plus URL +const BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; //Vida Plus URL + const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index 07c4f984..90eb7d18 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -6,6 +6,7 @@ class FinalRadiology { dynamic patientID; dynamic invoiceLineItemNo; dynamic invoiceNo; + dynamic invoiceNo_VP; dynamic doctorID; dynamic clinicID; DateTime orderDate; @@ -43,6 +44,7 @@ class FinalRadiology { bool isCVI; bool isRadMedicalReport; bool isLiveCareAppodynamicment; + bool isRecordFromVidaPlus; FinalRadiology( {this.setupID, @@ -50,6 +52,7 @@ class FinalRadiology { this.patientID, this.invoiceLineItemNo, this.invoiceNo, + this.invoiceNo_VP, this.doctorID, this.clinicID, this.orderDate, @@ -86,7 +89,7 @@ class FinalRadiology { this.speciality, this.isCVI, this.isRadMedicalReport, - this.isLiveCareAppodynamicment}); + this.isLiveCareAppodynamicment, this.isRecordFromVidaPlus}); FinalRadiology.fromJson(Map json) { try { @@ -95,6 +98,7 @@ class FinalRadiology { patientID = json['PatientID']; invoiceLineItemNo = json['InvoiceLineItemNo']; invoiceNo = json['InvoiceNo']; + invoiceNo_VP = json['InvoiceNo_VP']; doctorID = json['DoctorID']; clinicID = json['ClinicID']; orderDate = AppDateUtils.convertStringToDate(json['OrderDate']); @@ -132,6 +136,7 @@ class FinalRadiology { // speciality = json['Speciality'].cast(); isCVI = json['isCVI']; isRadMedicalReport = json['isRadMedicalReport']; + isRecordFromVidaPlus = json['IsRecordFromVidaPlus']; } catch (e) { print(e); } @@ -144,6 +149,7 @@ class FinalRadiology { data['PatientID'] = this.patientID; data['InvoiceLineItemNo'] = this.invoiceLineItemNo; data['InvoiceNo'] = this.invoiceNo; + data['InvoiceNo_VP'] = this.invoiceNo_VP; data['DoctorID'] = this.doctorID; data['ClinicID'] = this.clinicID; data['OrderDate'] = this.orderDate; @@ -179,6 +185,7 @@ class FinalRadiology { data['Speciality'] = this.speciality; data['isCVI'] = this.isCVI; data['isRadMedicalReport'] = this.isRadMedicalReport; + data['IsRecordFromVidaPlus'] = this.isRecordFromVidaPlus; return data; } } diff --git a/lib/core/service/patient_medical_file/radiology/radiology_service.dart b/lib/core/service/patient_medical_file/radiology/radiology_service.dart index 965fa03b..10eb9a49 100644 --- a/lib/core/service/patient_medical_file/radiology/radiology_service.dart +++ b/lib/core/service/patient_medical_file/radiology/radiology_service.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; import 'package:flutter/cupertino.dart'; import '../../base/base_service.dart'; @@ -8,20 +8,17 @@ import '../../base/base_service.dart'; class RadiologyService extends BaseService { List finalRadiologyList = List(); String url = ''; + bool isRadiologyVIDAPlus = false; - Future getRadImageURL( - {int invoiceNo, - int lineItem, - int projectId, - @required PatiantInformtion patient}) async { + Future getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async { hasError = false; final Map body = new Map(); body['InvoiceNo'] = invoiceNo; + body['InvoiceNo_VP'] = invoiceNo; body['LineItemNo'] = lineItem; body['ProjectID'] = projectId; - await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, onSuccess: (dynamic response, int statusCode) { url = response['Data']; }, onFailure: (String error, int statusCode) { hasError = true; @@ -29,8 +26,7 @@ class RadiologyService extends BaseService { }, body: body); } - Future getPatientRadOrders(PatiantInformtion patient, - {isInPatient = false}) async { + Future getPatientRadOrders(PatiantInformtion patient, {isInPatient = false}) async { String url = GET_PATIENT_ORDERS; final Map body = new Map(); if (isInPatient) { @@ -39,19 +35,29 @@ class RadiologyService extends BaseService { } finalRadiologyList.clear(); hasError = false; - await baseAppClient.postPatient(url, patient: patient, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { finalRadiologyList = []; String label = "ListRAD"; if (isInPatient) { label = "List_GetRadOreders"; } - if (response[label] == null || response[label].length == 0) { - label = "FinalRadiologyList"; + if (response['FinalRadiologyList'] != null && response['FinalRadiologyList'].length != 0) { + isRadiologyVIDAPlus = false; + response['FinalRadiologyList'].forEach((radiology) { + finalRadiologyList.add(FinalRadiology.fromJson(radiology)); + }); + } else { + isRadiologyVIDAPlus = true; + response['FinalRadiologyListAPI'].forEach((radiology) { + finalRadiologyList.add(FinalRadiology.fromJson(radiology)); + }); } - response[label].forEach((radiology) { - finalRadiologyList.add(FinalRadiology.fromJson(radiology)); - }); + // if (response[label] == null || response[label].length == 0) { + // label = "FinalRadiologyList"; + // } + // response[label].forEach((radiology) { + // finalRadiologyList.add(FinalRadiology.fromJson(radiology)); + // }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart index 333ffeea..b7a52d9f 100644 --- a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart +++ b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart @@ -100,6 +100,7 @@ class SickLeaveService extends BaseService { onSuccess: (dynamic response, int statusCode) { // Future.value(response); getAllSickLeavePatient = []; + getAllSickLeavePatient.clear(); response['List_SickLeave'].forEach((v) { getAllSickLeavePatient.add(SickLeavePatientModel.fromJson(v)); }); diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 9c900eac..52cdb1f7 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -238,7 +238,7 @@ class AuthenticationViewModel extends BaseViewModel { /// add token to shared preferences in case of send activation code is success setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) async { // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); - await sharedPref.setString(DOCTOR_SETUP_ID, sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID); + await sharedPref.setString(DOCTOR_SETUP_ID, sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID != null ? sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID : ""); await sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID); diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 76571092..eba91698 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -72,6 +72,10 @@ class ProcedureViewModel extends BaseViewModel { List get procedureTemplateDetails => _procedureService.templateDetailsList; + bool _isRadiologyVIDAPlus = false; + + bool get isRadiologyVIDAPlus => _isRadiologyVIDAPlus; + Future getProcedure( {int mrn, String patientType, @@ -240,6 +244,7 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Busy); await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient); + _isRadiologyVIDAPlus = _radiologyService.isRadiologyVIDAPlus; if (_radiologyService.hasError) { error = _radiologyService.error; if (patientType == "7") diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index ae2fb0f0..1f2666ff 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -1,6 +1,6 @@ +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; @@ -30,18 +30,7 @@ class MedicalFileDetails extends StatefulWidget { String doctorImage; MedicalFileDetails( - {this.age, - this.firstName, - this.lastName, - this.gender, - this.encounterNumber, - this.pp, - this.patient, - this.doctorName, - this.vistDate, - this.clinicName, - this.episode, - this.doctorImage}); + {this.age, this.firstName, this.lastName, this.gender, this.encounterNumber, this.pp, this.patient, this.doctorName, this.vistDate, this.clinicName, this.episode, this.doctorImage}); @override _MedicalFileDetailsState createState() => _MedicalFileDetailsState( @@ -75,18 +64,7 @@ class _MedicalFileDetailsState extends State { String doctorImage; _MedicalFileDetailsState( - {this.age, - this.firstName, - this.lastName, - this.gender, - this.encounterNumber, - this.pp, - this.patient, - this.doctorName, - this.vistDate, - this.clinicName, - this.episode, - this.doctorImage}); + {this.age, this.firstName, this.lastName, this.gender, this.encounterNumber, this.pp, this.patient, this.doctorName, this.vistDate, this.clinicName, this.episode, this.doctorImage}); bool isPhysicalExam = true; bool isProcedureExpand = true; @@ -102,9 +80,7 @@ class _MedicalFileDetailsState extends State { model.getMedicalFile(mrn: pp); } }, - builder: - (BuildContext context, MedicalFileViewModel model, Widget child) => - AppScaffold( + builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( appBar: PatientProfileAppBar( patient, doctorName: doctorName, @@ -113,10 +89,9 @@ class _MedicalFileDetailsState extends State { isPrescriptions: true, isMedicalFile: true, episode: episode, - visitDate: - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( - vistDate, - ), isArabic: projectViewModel.isArabic)}', + visitDate: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( + vistDate, + ), isArabic: projectViewModel.isArabic)}', isAppointmentHeader: true, ), isShowAppBar: true, @@ -128,125 +103,67 @@ class _MedicalFileDetailsState extends State { child: Container( child: Column( children: [ - model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0 + model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0 ? Padding( padding: EdgeInsets.all(10.0), child: Container( child: Column( children: [ SizedBox(height: 25.0), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) + if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0) Container( width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), + margin: EdgeInsets.only(top: 10, left: 10, right: 10), padding: EdgeInsets.all(8.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), + border: Border.all(color: Colors.grey[200], width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), child: HeaderBodyExpandableNotifier( headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ - AppText( - TranslationBase.of( - context) - .historyOfPresentIllness - .toUpperCase(), - variant: isHistoryExpand - ? "bodyText" - : '', - bold: isHistoryExpand - ? true - : true, - color: Colors.black), + AppText(TranslationBase.of(context).historyOfPresentIllness.toUpperCase(), + variant: isHistoryExpand ? "bodyText" : '', bold: isHistoryExpand ? true : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isHistoryExpand = - !isHistoryExpand; + isHistoryExpand = !isHistoryExpand; }); }, - child: Icon(isHistoryExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) + child: Icon(isHistoryExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), + physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstCheifComplaint - .length, - itemBuilder: (BuildContext ctxt, - int index) { + itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstCheifComplaint.length, + itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, + mainAxisAlignment: MainAxisAlignment.center, children: [ Row( children: [ Expanded( child: AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstCheifComplaint[ - index] - .hOPI + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstCheifComplaint[index].hOPI .trim(), ), ), - SizedBox( - width: 35.0), + SizedBox(width: 35.0), ], ), ], @@ -265,87 +182,50 @@ class _MedicalFileDetailsState extends State { SizedBox( height: 30, ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) + if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0) Container( width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), + margin: EdgeInsets.only(top: 10, left: 10, right: 10), padding: EdgeInsets.all(8.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), + border: Border.all(color: Colors.grey[200], width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), child: HeaderBodyExpandableNotifier( headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ - AppText( - TranslationBase.of( - context) - .assessment - .toUpperCase(), - variant: - isAssessmentExpand - ? "bodyText" - : '', - bold: isAssessmentExpand - ? true - : true, - color: Colors.black), + AppText(TranslationBase.of(context).assessment.toUpperCase(), + variant: isAssessmentExpand ? "bodyText" : '', bold: isAssessmentExpand ? true : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isAssessmentExpand = - !isAssessmentExpand; + isAssessmentExpand = !isAssessmentExpand; }); }, - child: Icon(isAssessmentExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) + child: Icon(isAssessmentExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), + physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments - .length, - itemBuilder: (BuildContext ctxt, - int index) { + itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments.length, + itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, + mainAxisAlignment: MainAxisAlignment.center, children: [ Row( children: [ @@ -354,59 +234,25 @@ class _MedicalFileDetailsState extends State { fontSize: 13.0, ), AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] - .iCD10 - .trim(), + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].iCD10.trim(), fontSize: 13.5, - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ), - SizedBox( - width: 15.0), + SizedBox(width: 15.0), ], ), Row( children: [ AppText( - TranslationBase.of( - context) - .condition + - ": ", + TranslationBase.of(context).condition + ": ", fontSize: 12.5, ), Expanded( child: AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] - .condition + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].condition .trim(), fontSize: 13.0, - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ), ), ], @@ -415,23 +261,8 @@ class _MedicalFileDetailsState extends State { children: [ Expanded( child: AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] - .description, - fontWeight: - FontWeight - .w700, + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].description, + fontWeight: FontWeight.w700, fontSize: 15.0, ), ) @@ -440,32 +271,14 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - TranslationBase.of( - context) - .type + - ": ", + TranslationBase.of(context).type + ": ", fontSize: 15.5, ), Expanded( child: AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] - .type, + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].type, fontSize: 16.0, - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ), ), ], @@ -474,18 +287,7 @@ class _MedicalFileDetailsState extends State { height: 15.0, ), AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[ - index] - .remarks - .trim(), + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].remarks.trim(), ), Divider( height: 1, @@ -508,86 +310,50 @@ class _MedicalFileDetailsState extends State { SizedBox( height: 30, ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) + if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0) Container( width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), + margin: EdgeInsets.only(top: 10, left: 10, right: 10), padding: EdgeInsets.all(8.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), + border: Border.all(color: Colors.grey[200], width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), child: HeaderBodyExpandableNotifier( headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ - AppText( - TranslationBase.of( - context) - .test - .toUpperCase(), - variant: isProcedureExpand - ? "bodyText" - : '', - bold: isProcedureExpand - ? true - : true, - color: Colors.black), + AppText(TranslationBase.of(context).test.toUpperCase(), + variant: isProcedureExpand ? "bodyText" : '', bold: isProcedureExpand ? true : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isProcedureExpand = - !isProcedureExpand; + isProcedureExpand = !isProcedureExpand; }); }, - child: Icon(isProcedureExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) + child: Icon(isProcedureExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), + physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstProcedure - .length, - itemBuilder: (BuildContext ctxt, - int index) { + itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure.length, + itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, + mainAxisAlignment: MainAxisAlignment.center, children: [ Row( children: [ @@ -597,65 +363,26 @@ class _MedicalFileDetailsState extends State { 'Procedure ID: ', ), AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] - .procedureId + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].procedureId .trim(), - fontSize: - 13.5, - fontWeight: - FontWeight - .w700, + fontSize: 13.5, + fontWeight: FontWeight.w700, ), ], ), - SizedBox( - width: 35.0), + SizedBox(width: 35.0), Column( children: [ AppText( - TranslationBase.of( - context) - .orderDate + - ": ", + TranslationBase.of(context).orderDate + ": ", ), AppText( - AppDateUtils - .getDateFormatted( - DateTime - .parse( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] - .orderDate + AppDateUtils.getDateFormatted(DateTime.parse( + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].orderDate .trim(), )), - fontSize: - 13.5, - fontWeight: - FontWeight - .w700, + fontSize: 13.5, + fontWeight: FontWeight.w700, ), ], ), @@ -668,23 +395,8 @@ class _MedicalFileDetailsState extends State { children: [ Expanded( child: AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] - .procName, - fontWeight: - FontWeight - .w700, + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].procName, + fontWeight: FontWeight.w700, ), ) ], @@ -695,23 +407,9 @@ class _MedicalFileDetailsState extends State { 'CPT Code : ', ), AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] - .patientID + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].patientID .toString(), - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ), ], ), @@ -739,79 +437,45 @@ class _MedicalFileDetailsState extends State { SizedBox( height: 30, ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) + if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0) Container( width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), + margin: EdgeInsets.only(top: 10, left: 10, right: 10), padding: EdgeInsets.all(8.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), + border: Border.all(color: Colors.grey[200], width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), child: HeaderBodyExpandableNotifier( headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ - AppText( - TranslationBase.of( - context) - .physicalSystemExamination - .toUpperCase(), - variant: isPhysicalExam - ? "bodyText" - : '', - bold: isPhysicalExam - ? true - : true, - color: Colors.black), + AppText(TranslationBase.of(context).physicalSystemExamination.toUpperCase(), + variant: isPhysicalExam ? "bodyText" : '', bold: isPhysicalExam ? true : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isPhysicalExam = - !isPhysicalExam; + isPhysicalExam = !isPhysicalExam; }); }, - child: Icon(isPhysicalExam - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) + child: Icon(isPhysicalExam ? EvaIcons.arrowUp : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), + physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam - .length, - itemBuilder: (BuildContext ctxt, - int index) { + itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam.length, + itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( @@ -819,75 +483,27 @@ class _MedicalFileDetailsState extends State { children: [ Row( children: [ - AppText(TranslationBase.of( - context) - .examType + - ": "), + AppText(TranslationBase.of(context).examType + ": "), AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstPhysicalExam[ - index] - .examDesc, - fontWeight: - FontWeight - .w700, + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].examDesc, + fontWeight: FontWeight.w700, ), ], ), Row( children: [ AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstPhysicalExam[ - index] - .examDesc, - fontWeight: - FontWeight - .w700, + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].examDesc, + fontWeight: FontWeight.w700, ) ], ), Row( children: [ - AppText(TranslationBase.of( - context) - .abnormal + - ": "), + AppText(TranslationBase.of(context).abnormal + ": "), AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstPhysicalExam[ - index] - .abnormal, - fontWeight: - FontWeight - .w700, + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].abnormal, + fontWeight: FontWeight.w700, ), ], ), @@ -895,17 +511,7 @@ class _MedicalFileDetailsState extends State { height: 15.0, ), AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam[ - index] - .remarks, + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].remarks, ), Divider( height: 1, diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index d12ec115..64f28ba9 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -1,22 +1,23 @@ import 'dart:async'; + import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/in_patient/post_episode_for_Inpatient_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_episode_req_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/VideoCallService.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/post_episode_req_model.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/in_patient/post_episode_for_Inpatient_request_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_other.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_search.dart'; import 'package:doctor_app_flutter/utils/notification_permission_utils.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; @@ -34,8 +35,7 @@ class PatientProfileScreen extends StatefulWidget { _PatientProfileScreenState createState() => _PatientProfileScreenState(); } -class _PatientProfileScreenState extends State - with SingleTickerProviderStateMixin { +class _PatientProfileScreenState extends State with SingleTickerProviderStateMixin { PatiantInformtion patient; LiveCarePatientViewModel _liveCareViewModel = LiveCarePatientViewModel(); @@ -115,15 +115,14 @@ class _PatientProfileScreenState extends State StreamSubscription callTimer; callConnected() { - callTimer = - CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null) - ..onDone(() { - callTimer.cancel(); - }) - ..onData((data) { - var t = Utils.timeFrom(duration: data.elapsed); - videoCallDurationStreamController.sink.add(t); - }); + callTimer = CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null) + ..onDone(() { + callTimer.cancel(); + }) + ..onData((data) { + var t = Utils.timeFrom(duration: data.elapsed); + videoCallDurationStreamController.sink.add(t); + }); } callDisconnected() { @@ -140,8 +139,7 @@ class _PatientProfileScreenState extends State final screenSize = MediaQuery.of(context).size; return BaseView( onModelReady: (model) async { - if (isFromLiveCare && patient.patientStatus == 1) - await model.addPatientToDoctorList(patient.vcId); + if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient.vcId); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, @@ -154,13 +152,11 @@ class _PatientProfileScreenState extends State children: [ Column( children: [ - PatientProfileHeaderNewDesignAppBar( - patient, arrivalType ?? '0', patientType, + PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType, videoCallDurationStream: videoCallDurationStream, isInpatient: isInpatient, isFromLiveCare: isFromLiveCare, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) + height: (patient.patientStatusType != null && patient.patientStatusType == 43) ? 210 : isDischargedPatient ? 240 @@ -192,8 +188,7 @@ class _PatientProfileScreenState extends State isInpatient: isInpatient, from: from, to: to, - isDischargedPatient: - isDischargedPatient, + isDischargedPatient: isDischargedPatient, isFromSearch: isFromSearch, ) : ProfileGridForOther( @@ -218,8 +213,7 @@ class _PatientProfileScreenState extends State ? true : isFromLiveCare ? patient.episodeNo != null - : patient.patientStatusType != null && - patient.patientStatusType == 43) + : patient.patientStatusType != null && patient.patientStatusType == 43) BaseView( onModelReady: (model) async { model.getDoctorProfile(); @@ -237,10 +231,8 @@ class _PatientProfileScreenState extends State if (patient.episodeNo == 0) AppButton( loading: model.state == ViewState.BusyLocal, - disabled: - model.state == ViewState.BusyLocal, - title: - "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", + disabled: model.state == ViewState.BusyLocal, + title: "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", color: isFromLiveCare || isInpatient ? AppGlobal.appRedColor : patient.patientStatusType == 43 @@ -248,8 +240,7 @@ class _PatientProfileScreenState extends State : AppGlobal.appRedColor, fontColor: Colors.white, // vPadding: 8, - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 9 : 6), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 9 : 6), radius: 30, hPadding: 25, fontWeight: FontWeight.normal, @@ -260,34 +251,24 @@ class _PatientProfileScreenState extends State height: 30, ), onPressed: () async { - if ((isFromLiveCare && - patient.appointmentNo != null) || - patient.patientStatusType == 43 || - isInpatient) { - createEpisode( - patient: patient, model: model); + if ((isFromLiveCare && patient.appointmentNo != null) || patient.patientStatusType == 43 || isInpatient) { + createEpisode(patient: patient, model: model); } }, ), if (patient.episodeNo != 0) AppButton( - loading: - model.state == ViewState.BusyLocal, - disabled: - model.state == ViewState.BusyLocal, - title: - "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - color: ((isInpatient) || - isFromLiveCare) && - model.state != ViewState.BusyLocal + loading: model.state == ViewState.BusyLocal, + disabled: model.state == ViewState.BusyLocal, + title: "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", + color: ((isInpatient) || isFromLiveCare) && model.state != ViewState.BusyLocal ? AppGlobal.appRedColor : patient.patientStatusType == 43 - ?AppGlobal.appRedColor + ? AppGlobal.appRedColor : AppGlobal.appRedColor, fontColor: Colors.white, // vPadding: 8, - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 9 : 6), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 9 : 6), radius: 30, hPadding: 25, fontWeight: FontWeight.normal, @@ -298,19 +279,12 @@ class _PatientProfileScreenState extends State height: 30, ), onPressed: () async { - await locator() - .logEvent( + await locator().logEvent( eventCategory: "Patient Profile ", eventAction: "Update Episode", ); - if ((isFromLiveCare && - patient.appointmentNo != null && - patient.appointmentNo != 0) || - patient.patientStatusType == 43 || - isInpatient) { - Navigator.of(context).pushNamed( - UPDATE_EPISODE, - arguments: {'patient': patient}); + if ((isFromLiveCare && patient.appointmentNo != null && patient.appointmentNo != 0) || patient.patientStatusType == 43 || isInpatient) { + Navigator.of(context).pushNamed(UPDATE_EPISODE, arguments: {'patient': patient}); } }), ], @@ -342,14 +316,9 @@ class _PatientProfileScreenState extends State child: Center( child: AppButton( fontWeight: FontWeight.w700, - color: isCallFinished - ? Colors.red[600] - : AppGlobal.appGreenColor, - title: isCallFinished - ? TranslationBase.of(context).endCall - : TranslationBase.of(context).initiateCall, - disabled: isCallStarted || - model.state == ViewState.BusyLocal, + color: isCallFinished ? Colors.red[600] : AppGlobal.appGreenColor, + title: isCallFinished ? TranslationBase.of(context).endCall : TranslationBase.of(context).initiateCall, + disabled: isCallStarted || model.state == ViewState.BusyLocal, onPressed: () async { // TODO MOSA TEST // AppPermissionsUtils @@ -367,50 +336,32 @@ class _PatientProfileScreenState extends State Navigator.push( context, MaterialPageRoute( - builder: (BuildContext context) => - EndCallScreen(patient: patient), - settings: - RouteSettings(name: 'EndCallScreen'), + builder: (BuildContext context) => EndCallScreen(patient: patient), + settings: RouteSettings(name: 'EndCallScreen'), ), ); } else { GifLoaderDialogUtils.showMyDialog(context); - await model.startCall( - isReCall: false, vCID: patient.vcId); + await model.startCall(isReCall: false, vCID: patient.vcId); if (model.state == ViewState.ErrorLocal) { GifLoaderDialogUtils.hideDialog(context); Utils.showErrorToast(model.error); } else { await model.getDoctorProfile(); - patient.appointmentNo = int.parse(model - .startCallRes.appointmentNo - .toString()); + patient.appointmentNo = int.parse(model.startCallRes.appointmentNo.toString()); patient.episodeNo = 0; - model.updateInCallPatient( - patient: patient, - appointmentNo: int.parse(model - .startCallRes.appointmentNo - .toString())); + model.updateInCallPatient(patient: patient, appointmentNo: int.parse(model.startCallRes.appointmentNo.toString())); setState(() { isCallStarted = true; }); GifLoaderDialogUtils.hideDialog(context); - AppPermissionsUtils - .requestVideoCallPermission( - context: context, - onTapGrant: () { - locator() - .openVideo( - model.startCallRes, - patient, - model.startCallRes != null - ? model.startCallRes - .isRecording - : true, - callConnected, - callDisconnected); - }); + AppPermissionsUtils.requestVideoCallPermission( + context: context, + onTapGrant: () { + locator() + .openVideo(model.startCallRes, patient, model.startCallRes != null ? model.startCallRes.isRecording : true, callConnected, callDisconnected); + }); } } }, @@ -436,15 +387,10 @@ class _PatientProfileScreenState extends State ); GifLoaderDialogUtils.showMyDialog(context); if (patient.admissionNo != null && patient.admissionNo.isNotEmpty) { - PostEpisodeForInpatientRequestModel postEpisodeReqModel = - PostEpisodeForInpatientRequestModel( - admissionNo: int.parse(patient.admissionNo), - patientID: patient.patientId); + PostEpisodeForInpatientRequestModel postEpisodeReqModel = PostEpisodeForInpatientRequestModel(admissionNo: int.parse(patient.admissionNo), patientID: patient.patientId); await model.postEpisodeForInPatient(postEpisodeReqModel); } else { - PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( - appointmentNo: int.parse(patient.appointmentNo.toString()), - patientMRN: patient.patientMRN); + PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(appointmentNo: int.parse(patient.appointmentNo.toString()), patientMRN: patient.patientMRN); await model.postEpisode(postEpisodeReqModel); } @@ -454,8 +400,7 @@ class _PatientProfileScreenState extends State Utils.showErrorToast(model.error); } else { patient.episodeNo = model.episodeID; - Navigator.of(context) - .pushNamed(CREATE_EPISODE, arguments: {'patient': patient}); + Navigator.of(context).pushNamed(CREATE_EPISODE, arguments: {'patient': patient}); } } } @@ -469,12 +414,7 @@ class AvatarWidget extends StatelessWidget { Widget build(BuildContext context) { return Container( decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.08), - offset: Offset(0.0, 5.0), - blurRadius: 16.0) - ], + boxShadow: [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.08), offset: Offset(0.0, 5.0), blurRadius: 16.0)], borderRadius: BorderRadius.all(Radius.circular(35.0)), color: Color(0xffCCCCCC), ), diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index 27d6e077..ccd2fc11 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -1,7 +1,7 @@ +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; @@ -20,23 +20,15 @@ class RadiologyDetailsPage extends StatelessWidget { final String patientType; final String arrivalType; final bool isInpatient; + final bool isVidaPlus; - RadiologyDetailsPage( - {Key key, - this.finalRadiology, - this.patient, - this.patientType, - this.arrivalType, - this.isInpatient = false}); + RadiologyDetailsPage({Key key, this.finalRadiology, this.patient, this.patientType, this.arrivalType, this.isInpatient = false, this.isVidaPlus = false}); @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getRadImageURL( - patient: patient, - projectId: finalRadiology.projectID, - lineItem: finalRadiology.invoiceLineItemNo, - invoiceNo: finalRadiology.invoiceNo), + patient: patient, projectId: finalRadiology.projectID, lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: isVidaPlus ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo), builder: (_, model, widget) => AppScaffold( appBar: PatientProfileAppBar( patient, @@ -50,7 +42,7 @@ class RadiologyDetailsPage extends StatelessWidget { ), isShowAppBar: true, baseViewModel: model, - body: SingleChildScrollView( + body: SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, @@ -99,8 +91,7 @@ class RadiologyDetailsPage extends StatelessWidget { height: 80, width: double.maxFinite, child: Container( - margin: - EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12), + margin: EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12), child: AppButton( color: Color(0xffD02127), disabled: finalRadiology.dIAPACSURL == "", diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 12b54a3c..0f64185c 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -1,6 +1,6 @@ +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.dart'; import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; @@ -17,6 +17,7 @@ import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; + import '../../../../widgets/shared/errors/error_message.dart'; class RadiologyHomePage extends StatefulWidget { @@ -47,8 +48,7 @@ class _RadiologyHomePageState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getPatientRadOrders(patient, - patientType: patientType, isInPatient: false), + onModelReady: (model) => model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], @@ -66,21 +66,17 @@ class _RadiologyHomePageState extends State { SizedBox( height: 12, ), - if (model.radiologyList.isNotEmpty && - patient.patientStatusType != 43) + if (model.radiologyList.isNotEmpty && patient.patientStatusType != 43) ServiceTitle( title: TranslationBase.of(context).radiology, subTitle: TranslationBase.of(context).result, ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) + if (patient.patientStatusType != null && patient.patientStatusType == 43) ServiceTitle( title: TranslationBase.of(context).radiology, subTitle: TranslationBase.of(context).result, ), - if ((patient.patientStatusType != null && - patient.patientStatusType == 43) || - (isFromLiveCare && patient.appointmentNo != null)) + if ((patient.patientStatusType != null && patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null)) AddNewOrder( onTap: () { Navigator.push( @@ -96,6 +92,7 @@ class _RadiologyHomePageState extends State { }, label: TranslationBase.of(context).applyForRadiologyOrder, ), + ///TODO Elham * fix this to be list view builder ...List.generate( model.radiologyList.length, @@ -117,43 +114,26 @@ class _RadiologyHomePageState extends State { height: 160, decoration: BoxDecoration( //Colors.red[900] Color(0xff404545) - color: model.radiologyList[index] - .isLiveCareAppodynamicment + color: model.radiologyList[index].isLiveCareAppodynamicment ? Colors.red[900] : !model.radiologyList[index].isInOutPatient ? Colors.black : Color(0xffa9a089), 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)), + 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( - model.radiologyList[index] - .isLiveCareAppodynamicment - ? TranslationBase.of(context) - .liveCare - .toUpperCase() - : !model.radiologyList[index] - .isInOutPatient - ? TranslationBase.of(context) - .inPatientLabel - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), + model.radiologyList[index].isLiveCareAppodynamicment + ? TranslationBase.of(context).liveCare.toUpperCase() + : !model.radiologyList[index].isInOutPatient + ? TranslationBase.of(context).inPatientLabel.toUpperCase() + : TranslationBase.of(context).outpatient.toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -161,28 +141,18 @@ class _RadiologyHomePageState extends State { Expanded( child: DoctorCard( isNoMargin: true, - doctorName: - Utils.convertToTitleCase(model.radiologyList[index].doctorName), - profileUrl: - model.radiologyList[index].doctorImageURL, - invoiceNO: - '${model.radiologyList[index].invoiceNo}', - branch: - '${model.radiologyList[index].projectName}', - clinic: - Utils.convertToTitleCase(model.radiologyList[index].clinicDescription), - appointmentDate: - model.radiologyList[index].orderDate ?? - model.radiologyList[index].reportDate, + doctorName: Utils.convertToTitleCase(model.radiologyList[index].doctorName), + profileUrl: model.radiologyList[index].doctorImageURL, + invoiceNO: model.isRadiologyVIDAPlus ? '${model.radiologyList[index].invoiceNo}' : '${model.radiologyList[index].invoiceNo}', + branch: '${model.radiologyList[index].projectName}', + clinic: Utils.convertToTitleCase(model.radiologyList[index].clinicDescription), + appointmentDate: model.radiologyList[index].orderDate ?? model.radiologyList[index].reportDate, onTap: () { Navigator.push( context, FadePage( page: RadiologyDetailsPage( - finalRadiology: - model.radiologyList[index], - patient: patient, - isInpatient: isInpatient), + finalRadiology: model.radiologyList[index], patient: patient, isInpatient: isInpatient, isVidaPlus: model.radiologyList[index].isRecordFromVidaPlus), ), ); }, @@ -191,8 +161,7 @@ class _RadiologyHomePageState extends State { ], ), )), - if (model.radiologyList.isEmpty && - patient.patientStatusType != 43) + if (model.radiologyList.isEmpty && patient.patientStatusType != 43) Center( child: ErrorMessage( error: TranslationBase.of(context).noDataAvailable, diff --git a/lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart index 77a6efbb..f33ec6bc 100644 --- a/lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart @@ -2,19 +2,20 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/PatientType.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; -import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referred_patient_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/material.dart'; + import '../../../../../routes.dart'; class ReferredPatientDetailScreen extends StatelessWidget { @@ -52,8 +53,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), Expanded( child: AppText( - (Utils.capitalize( - "${referredPatient.firstName} ${referredPatient.lastName}")), + (Utils.capitalize("${referredPatient.firstName} ${referredPatient.lastName}")), fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -70,19 +70,14 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), InkWell( onTap: () { - PatiantInformtion patient = - model.getPatientFromReferral(referredPatient); - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { + PatiantInformtion patient = model.getPatientFromReferral(referredPatient); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", - "isInpatient": - patientType == PatientType.IN_PATIENT, + "isInpatient": patientType == PatientType.IN_PATIENT, "arrivalType": "1", - "from": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), - "to": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), + "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), }); }, child: Icon( @@ -97,19 +92,14 @@ class ReferredPatientDetailScreen extends StatelessWidget { children: [ InkWell( onTap: () { - PatiantInformtion patient = - model.getPatientFromReferral(referredPatient); - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { + PatiantInformtion patient = model.getPatientFromReferral(referredPatient); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", - "isInpatient": - patientType == PatientType.IN_PATIENT, + "isInpatient": patientType == PatientType.IN_PATIENT, "arrivalType": "1", - "from": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), - "to": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), + "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), }); }, child: Column( @@ -120,9 +110,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { width: 60, height: 60, child: Image.asset( - referredPatient.gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + referredPatient.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -146,8 +134,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( referredPatient.referralStatusDesc, @@ -161,9 +148,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { : Colors.red[700], ), AppText( - AppDateUtils.convertDateFromServerFormat( - referredPatient.referralDate, - "dd MMM,yyyy"), + AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate, "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 2.0 * SizeConfig.textMultiplier, @@ -172,20 +157,16 @@ class ReferredPatientDetailScreen extends StatelessWidget { ], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .fileNumber, + TranslationBase.of(context).fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: - 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( @@ -198,9 +179,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { ], ), AppText( - AppDateUtils.convertDateFromServerFormat( - referredPatient.referralDate, - "hh:mm a"), + AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate, "hh:mm a"), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.8 * SizeConfig.textMultiplier, @@ -209,29 +188,25 @@ class ReferredPatientDetailScreen extends StatelessWidget { ], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( "${TranslationBase.of(context).refClinic}: ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * - SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient - .referralClinicDescription, + referredPatient.referralClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 13, @@ -240,29 +215,21 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), ], ), - if (referredPatient - .frequencyDescription != - null) + if (referredPatient.frequencyDescription != null) Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .frequency + - ": ", + TranslationBase.of(context).frequency + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * - SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient - .frequencyDescription, + referredPatient.frequencyDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 14, @@ -277,29 +244,19 @@ class ReferredPatientDetailScreen extends StatelessWidget { Row( children: [ AppText( - referredPatient.nationalityName != - null - ? referredPatient.nationalityName - : "", + referredPatient.nationalityName != null ? referredPatient.nationalityName : "", fontWeight: FontWeight.bold, color: Color(0xFF2E303A), - fontSize: - 1.4 * SizeConfig.textMultiplier, + fontSize: 1.4 * SizeConfig.textMultiplier, ), - referredPatient.nationalityFlagURL != - null + referredPatient.nationalityFlagURL != null ? ClipRRect( - borderRadius: - BorderRadius.circular(20.0), + borderRadius: BorderRadius.circular(20.0), child: Image.network( - referredPatient - .nationalityFlagURL, + referredPatient.nationalityFlagURL, height: 25, width: 30, - errorBuilder: (BuildContext - context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { return Text('No Image'); }, )) @@ -311,16 +268,13 @@ class ReferredPatientDetailScreen extends StatelessWidget { if (referredPatient.priorityDescription != null) Row( mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).priority + - ": ", + TranslationBase.of(context).priority + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: - 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( @@ -335,33 +289,21 @@ class ReferredPatientDetailScreen extends StatelessWidget { if (referredPatient.mAXResponseTime != null) Row( mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .maxResponseTime + - ": ", + TranslationBase.of(context).maxResponseTime + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: - 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient.mAXResponseTime != - null - ? AppDateUtils - .convertDateFromServerFormat( - referredPatient - .mAXResponseTime, - "dd MMM,yyyy") - : '', + referredPatient.mAXResponseTime != null ? AppDateUtils.convertDateFromServerFormat(referredPatient.mAXResponseTime, "dd MMM,yyyy") : '', fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -371,8 +313,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: - EdgeInsets.only(left: 10, right: 0), + margin: EdgeInsets.only(left: 10, right: 0), child: Image.asset( 'assets/images/patient/ic_ref_arrow_left.png', height: 50, @@ -380,34 +321,22 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), ), Container( - margin: EdgeInsets.only( - left: 0, - top: 25, - right: 0, - bottom: 0), - padding: EdgeInsets.only( - left: 4.0, right: 4.0), - child: referredPatient.doctorImageURL != - null + margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0), + padding: EdgeInsets.only(left: 4.0, right: 4.0), + child: referredPatient.doctorImageURL != null ? ClipRRect( - borderRadius: - BorderRadius.circular(20.0), + borderRadius: BorderRadius.circular(20.0), child: Image.network( referredPatient.doctorImageURL, height: 25, width: 30, - errorBuilder: - (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { return Text('No Image'); }, )) : Container( child: Image.asset( - referredPatient.gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + referredPatient.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -415,30 +344,22 @@ class ReferredPatientDetailScreen extends StatelessWidget { Expanded( flex: 4, child: Container( - margin: EdgeInsets.only( - left: 10, - top: 30, - right: 10, - bottom: 0), + margin: EdgeInsets.only(left: 10, top: 30, right: 10, bottom: 0), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( "${TranslationBase.of(context).dr} ${referredPatient.referralDoctorName}", fontFamily: 'Poppins', fontWeight: FontWeight.w800, - fontSize: 1.5 * - SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier, color: Colors.black, ), AppText( - referredPatient - .referralClinicDescription, + referredPatient.referralClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.3 * - SizeConfig.textMultiplier, + fontSize: 1.3 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -495,8 +416,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only( - left: 0, top: 0, right: 4, bottom: 0), + margin: EdgeInsets.only(left: 0, top: 0, right: 4, bottom: 0), padding: EdgeInsets.only(left: 4.0, right: 4.0), child: referredPatient.doctorImageURL != null ? ClipRRect( @@ -505,17 +425,13 @@ class ReferredPatientDetailScreen extends StatelessWidget { referredPatient.doctorImageURL, height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { return Text('No Image'); }, )) : Container( child: Image.asset( - referredPatient.gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + referredPatient.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -532,15 +448,11 @@ class ReferredPatientDetailScreen extends StatelessWidget { color: Color(0XFF2E303A), ), AppText( - referredPatient.referredDoctorRemarks == - null + referredPatient.referredDoctorRemarks == null ? '' - : referredPatient.referredDoctorRemarks - .isNotEmpty - ? referredPatient - .referredDoctorRemarks - : TranslationBase.of(context) - .notRepliedYet, + : referredPatient.referredDoctorRemarks.isNotEmpty + ? referredPatient.referredDoctorRemarks + : TranslationBase.of(context).notRepliedYet, fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.6 * SizeConfig.textMultiplier, @@ -576,8 +488,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showSuccesToast( - "Referral is acknowledged"); + DrAppToastMsg.showSuccesToast("Referral is acknowledged"); Navigator.pop(context); } }, diff --git a/lib/screens/prescription/old_prescriptions_page.dart b/lib/screens/prescription/old_prescriptions_page.dart index f937c8b1..1b9ab395 100644 --- a/lib/screens/prescription/old_prescriptions_page.dart +++ b/lib/screens/prescription/old_prescriptions_page.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/prescription_items_in_patient.dart'; import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/prescription_items_out_patient.dart'; @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import '../../utils/utils.dart'; import '../../widgets/shared/errors/error_message.dart'; @@ -29,10 +30,7 @@ class OldPrescriptionsPage extends StatelessWidget { bool isFromLiveCare = routeArgs['isFromLiveCare']; return BaseView( onModelReady: (model) async { - patient.admissionNo == null - ? model.getPrescriptions(patient, - patientType: patientType, isLocalBusy: false) - : model.getMedicationForInPatient(patient); + patient.admissionNo == null ? model.getPrescriptions(patient, patientType: patientType, isLocalBusy: false) : model.getMedicationForInPatient(patient); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, @@ -52,20 +50,18 @@ class OldPrescriptionsPage extends StatelessWidget { SizedBox( height: 12, ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ServiceTitle( - title: TranslationBase.of(context).orders, - subTitle: TranslationBase.of(context) - .prescriptions + "(${TranslationBase.of(context) - .old }) ", - ), - ], - ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ServiceTitle( + title: TranslationBase.of(context).orders, + subTitle: TranslationBase.of(context).prescriptions + "(${TranslationBase.of(context).old}) ", + ), + ], ), + ), ListView.builder( physics: BouncingScrollPhysics(), itemCount: model.prescriptionsList.length, @@ -76,8 +72,7 @@ class OldPrescriptionsPage extends StatelessWidget { context, FadePage( page: PrescriptionItemsPage( - prescriptions: model - .prescriptionsList[index], + prescriptions: model.prescriptionsList[index], patient: patient, arrivalType: arrivalType, ), @@ -86,143 +81,109 @@ class OldPrescriptionsPage extends StatelessWidget { child: Column( children: [ DoctorCard( - doctorName: - Utils.convertToTitleCase(model - .prescriptionsList[index] - .doctorName), - profileUrl: model - .prescriptionsList[index] - .doctorImageURL, - branch: model - .prescriptionsList[index].name, - clinic: model.prescriptionsList[index] - .clinicDescription, + doctorName: Utils.convertToTitleCase(model.prescriptionsList[index].doctorName), + profileUrl: model.prescriptionsList[index].doctorImageURL, + branch: model.prescriptionsList[index].name, + clinic: model.prescriptionsList[index].clinicDescription, isPrescriptions: true, - appointmentDate: AppDateUtils - .getDateTimeFromServerFormat( - model.prescriptionsList[index] - .appointmentDate, + appointmentDate: AppDateUtils.getDateTimeFromServerFormat( + model.prescriptionsList[index].appointmentDate, ), ), ], )); }), - if (model.prescriptionsList.isEmpty && - patient.patientStatusType != 43) + if (model.prescriptionsList.isEmpty && patient.patientStatusType != 43) Center( child: ErrorMessage( - error: TranslationBase.of(context) - .noPrescriptionsFound, + error: TranslationBase.of(context).noPrescriptionsFound, )) ], ), ), ) : Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 12, - ), - ServiceTitle( - title: TranslationBase.of(context).orders, - subTitle: TranslationBase.of(context) - .prescriptions + "(${TranslationBase.of(context) - .old }) ", - ), - model.medicationForInPatient.length == 0? - Center( - child: ErrorMessage( - error: TranslationBase.of(context) - .noPrescriptionsFound, - )): ListView.builder( - scrollDirection: Axis.vertical, - physics: NeverScrollableScrollPhysics(), - shrinkWrap: true, - itemCount: model.medicationForInPatient.length, - itemBuilder: (context, index) { - //model.medicationForInPatient.length, - return InkWell( - child: CardWithBgWidget( - bgColor: Colors.transparent, - widget: Column( - children: [ - CustomRow( - label: "", - value: Utils.convertToTitleCase(model - .medicationForInPatient[index] - .pHRItemDescription), - valueSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.5, - ), - SizedBox( - height: 10, - ), - CustomRow( - label: "Doctor Name :", - value: Utils.convertToTitleCase(model - .medicationForInPatient[index] - .doctorName - .toString()), - ), - CustomRow( - label: "Status :", - value: Utils.convertToTitleCase(model - .medicationForInPatient[index] - .statusDescription - .toString()), - ), - CustomRow( - label: "dose :", - value: Utils.convertToTitleCase(model - .medicationForInPatient[index] - .dose - .toString()), - ), CustomRow( - label: "comments :", - value: Utils.convertToTitleCase(model - .medicationForInPatient[index] - .comments - .toString()), - ), - - ], - ), - ), - onTap: () => Navigator.push( - context, - FadePage( - page: PrescriptionItemsInPatientPage( - prescriptionIndex: index, - prescriptions: - model.medicationForInPatient[index], - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - startOn: AppDateUtils - .getDateTimeFromServerFormat( - model.medicationForInPatient[index] - .startDatetime, + child: FractionallySizedBox( + widthFactor: 0.9, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + ServiceTitle( + title: TranslationBase.of(context).orders, + subTitle: TranslationBase.of(context).prescriptions + "(${TranslationBase.of(context).old}) ", + ), + model.medicationForInPatient.length == 0 + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).noPrescriptionsFound, + )) + : ListView.builder( + scrollDirection: Axis.vertical, + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: model.medicationForInPatient.length, + itemBuilder: (context, index) { + //model.medicationForInPatient.length, + return InkWell( + child: CardWithBgWidget( + bgColor: Colors.transparent, + widget: Column( + children: [ + CustomRow( + label: "", + value: Utils.convertToTitleCase(model.medicationForInPatient[index].pHRItemDescription), + valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, + ), + SizedBox( + height: 10, + ), + CustomRow( + label: "Doctor Name :", + value: Utils.convertToTitleCase(model.medicationForInPatient[index].doctorName.toString()), + ), + CustomRow( + label: "Status :", + value: Utils.convertToTitleCase(model.medicationForInPatient[index].statusDescription.toString()), + ), + CustomRow( + label: "dose :", + value: Utils.convertToTitleCase(model.medicationForInPatient[index].dose.toString()), + ), + CustomRow( + label: "comments :", + value: Utils.convertToTitleCase(model.medicationForInPatient[index].comments.toString()), + ), + ], + ), ), - stopOn: AppDateUtils - .getDateTimeFromServerFormat( - model.medicationForInPatient[index] - .stopDatetime, + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionItemsInPatientPage( + prescriptionIndex: index, + prescriptions: model.medicationForInPatient[index], + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + startOn: AppDateUtils.getDateTimeFromServerFormat( + model.medicationForInPatient[index].startDatetime, + ), + stopOn: AppDateUtils.getDateTimeFromServerFormat( + model.medicationForInPatient[index].stopDatetime, + ), + ), + ), ), - ), - ), - ), - ); - }), - ], + ); + }), + ], + ), ), ), - ), - ))); + ))); } }