development-3.3_voipCall
haroon amjad 3 years ago
parent 92c665197d
commit ac74e1e62d

@ -100,7 +100,17 @@ class BaseAppClient {
else else
body['PatientOutSA'] = false; body['PatientOutSA'] = false;
// if (!body.containsKey('ProjectID')) {
// if (projectID != null) {
// body['ProjectID'] = projectID;
// } else {
// body['ProjectID'] = 0;
// }
// }
body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
// print("ProjectID :");
// print(body['ProjectID']);
print("URL : $url"); print("URL : $url");
print("Body : ${json.encode(body)}"); print("Body : ${json.encode(body)}");
var asd = json.encode(body); var asd = json.encode(body);
@ -223,6 +233,17 @@ class BaseAppClient {
else else
body['PatientOutSA'] = false; 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("URL : $url");
print("Body : ${json.encode(body)}"); print("Body : ${json.encode(body)}");
var asd = json.encode(body); var asd = json.encode(body);

@ -6,12 +6,14 @@ const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]"; const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; 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://uat.hmgwebservices.com/';
// const BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; //Vida Plus URL // 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_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";

@ -6,6 +6,7 @@ class FinalRadiology {
dynamic patientID; dynamic patientID;
dynamic invoiceLineItemNo; dynamic invoiceLineItemNo;
dynamic invoiceNo; dynamic invoiceNo;
dynamic invoiceNo_VP;
dynamic doctorID; dynamic doctorID;
dynamic clinicID; dynamic clinicID;
DateTime orderDate; DateTime orderDate;
@ -43,6 +44,7 @@ class FinalRadiology {
bool isCVI; bool isCVI;
bool isRadMedicalReport; bool isRadMedicalReport;
bool isLiveCareAppodynamicment; bool isLiveCareAppodynamicment;
bool isRecordFromVidaPlus;
FinalRadiology( FinalRadiology(
{this.setupID, {this.setupID,
@ -50,6 +52,7 @@ class FinalRadiology {
this.patientID, this.patientID,
this.invoiceLineItemNo, this.invoiceLineItemNo,
this.invoiceNo, this.invoiceNo,
this.invoiceNo_VP,
this.doctorID, this.doctorID,
this.clinicID, this.clinicID,
this.orderDate, this.orderDate,
@ -86,7 +89,7 @@ class FinalRadiology {
this.speciality, this.speciality,
this.isCVI, this.isCVI,
this.isRadMedicalReport, this.isRadMedicalReport,
this.isLiveCareAppodynamicment}); this.isLiveCareAppodynamicment, this.isRecordFromVidaPlus});
FinalRadiology.fromJson(Map<dynamic, dynamic> json) { FinalRadiology.fromJson(Map<dynamic, dynamic> json) {
try { try {
@ -95,6 +98,7 @@ class FinalRadiology {
patientID = json['PatientID']; patientID = json['PatientID'];
invoiceLineItemNo = json['InvoiceLineItemNo']; invoiceLineItemNo = json['InvoiceLineItemNo'];
invoiceNo = json['InvoiceNo']; invoiceNo = json['InvoiceNo'];
invoiceNo_VP = json['InvoiceNo_VP'];
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
clinicID = json['ClinicID']; clinicID = json['ClinicID'];
orderDate = AppDateUtils.convertStringToDate(json['OrderDate']); orderDate = AppDateUtils.convertStringToDate(json['OrderDate']);
@ -132,6 +136,7 @@ class FinalRadiology {
// speciality = json['Speciality'].cast<dynamic>(); // speciality = json['Speciality'].cast<dynamic>();
isCVI = json['isCVI']; isCVI = json['isCVI'];
isRadMedicalReport = json['isRadMedicalReport']; isRadMedicalReport = json['isRadMedicalReport'];
isRecordFromVidaPlus = json['IsRecordFromVidaPlus'];
} catch (e) { } catch (e) {
print(e); print(e);
} }
@ -144,6 +149,7 @@ class FinalRadiology {
data['PatientID'] = this.patientID; data['PatientID'] = this.patientID;
data['InvoiceLineItemNo'] = this.invoiceLineItemNo; data['InvoiceLineItemNo'] = this.invoiceLineItemNo;
data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNo_VP;
data['DoctorID'] = this.doctorID; data['DoctorID'] = this.doctorID;
data['ClinicID'] = this.clinicID; data['ClinicID'] = this.clinicID;
data['OrderDate'] = this.orderDate; data['OrderDate'] = this.orderDate;
@ -179,6 +185,7 @@ class FinalRadiology {
data['Speciality'] = this.speciality; data['Speciality'] = this.speciality;
data['isCVI'] = this.isCVI; data['isCVI'] = this.isCVI;
data['isRadMedicalReport'] = this.isRadMedicalReport; data['isRadMedicalReport'] = this.isRadMedicalReport;
data['IsRecordFromVidaPlus'] = this.isRecordFromVidaPlus;
return data; return data;
} }
} }

@ -1,6 +1,6 @@
import 'package:doctor_app_flutter/config/config.dart'; 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/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import '../../base/base_service.dart'; import '../../base/base_service.dart';
@ -8,20 +8,17 @@ import '../../base/base_service.dart';
class RadiologyService extends BaseService { class RadiologyService extends BaseService {
List<FinalRadiology> finalRadiologyList = List(); List<FinalRadiology> finalRadiologyList = List();
String url = ''; String url = '';
bool isRadiologyVIDAPlus = false;
Future getRadImageURL( Future getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async {
{int invoiceNo,
int lineItem,
int projectId,
@required PatiantInformtion patient}) async {
hasError = false; hasError = false;
final Map<String, dynamic> body = new Map<String, dynamic>(); final Map<String, dynamic> body = new Map<String, dynamic>();
body['InvoiceNo'] = invoiceNo; body['InvoiceNo'] = invoiceNo;
body['InvoiceNo_VP'] = invoiceNo;
body['LineItemNo'] = lineItem; body['LineItemNo'] = lineItem;
body['ProjectID'] = projectId; body['ProjectID'] = projectId;
await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
url = response['Data']; url = response['Data'];
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -29,8 +26,7 @@ class RadiologyService extends BaseService {
}, body: body); }, body: body);
} }
Future getPatientRadOrders(PatiantInformtion patient, Future getPatientRadOrders(PatiantInformtion patient, {isInPatient = false}) async {
{isInPatient = false}) async {
String url = GET_PATIENT_ORDERS; String url = GET_PATIENT_ORDERS;
final Map<String, dynamic> body = new Map<String, dynamic>(); final Map<String, dynamic> body = new Map<String, dynamic>();
if (isInPatient) { if (isInPatient) {
@ -39,19 +35,29 @@ class RadiologyService extends BaseService {
} }
finalRadiologyList.clear(); finalRadiologyList.clear();
hasError = false; hasError = false;
await baseAppClient.postPatient(url, patient: patient, await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
finalRadiologyList = []; finalRadiologyList = [];
String label = "ListRAD"; String label = "ListRAD";
if (isInPatient) { if (isInPatient) {
label = "List_GetRadOreders"; label = "List_GetRadOreders";
} }
if (response[label] == null || response[label].length == 0) { if (response['FinalRadiologyList'] != null && response['FinalRadiologyList'].length != 0) {
label = "FinalRadiologyList"; 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) { // if (response[label] == null || response[label].length == 0) {
finalRadiologyList.add(FinalRadiology.fromJson(radiology)); // label = "FinalRadiologyList";
}); // }
// response[label].forEach((radiology) {
// finalRadiologyList.add(FinalRadiology.fromJson(radiology));
// });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -100,6 +100,7 @@ class SickLeaveService extends BaseService {
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
// Future.value(response); // Future.value(response);
getAllSickLeavePatient = []; getAllSickLeavePatient = [];
getAllSickLeavePatient.clear();
response['List_SickLeave'].forEach((v) { response['List_SickLeave'].forEach((v) {
getAllSickLeavePatient.add(SickLeavePatientModel.fromJson(v)); getAllSickLeavePatient.add(SickLeavePatientModel.fromJson(v));
}); });

@ -238,7 +238,7 @@ class AuthenticationViewModel extends BaseViewModel {
/// add token to shared preferences in case of send activation code is success /// add token to shared preferences in case of send activation code is success
setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) async { setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) async {
// print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); // 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_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID);
await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID);
await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID); await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID);

@ -72,6 +72,10 @@ class ProcedureViewModel extends BaseViewModel {
List<ProcedureTempleteDetailsModel> get procedureTemplateDetails => List<ProcedureTempleteDetailsModel> get procedureTemplateDetails =>
_procedureService.templateDetailsList; _procedureService.templateDetailsList;
bool _isRadiologyVIDAPlus = false;
bool get isRadiologyVIDAPlus => _isRadiologyVIDAPlus;
Future getProcedure( Future getProcedure(
{int mrn, {int mrn,
String patientType, String patientType,
@ -240,6 +244,7 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Busy); setState(ViewState.Busy);
await _radiologyService.getPatientRadOrders(patient, await _radiologyService.getPatientRadOrders(patient,
isInPatient: isInPatient); isInPatient: isInPatient);
_isRadiologyVIDAPlus = _radiologyService.isRadiologyVIDAPlus;
if (_radiologyService.hasError) { if (_radiologyService.hasError) {
error = _radiologyService.error; error = _radiologyService.error;
if (patientType == "7") if (patientType == "7")

@ -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/medical_file_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_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/base/base_view.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
@ -30,18 +30,7 @@ class MedicalFileDetails extends StatefulWidget {
String doctorImage; String doctorImage;
MedicalFileDetails( MedicalFileDetails(
{this.age, {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.firstName,
this.lastName,
this.gender,
this.encounterNumber,
this.pp,
this.patient,
this.doctorName,
this.vistDate,
this.clinicName,
this.episode,
this.doctorImage});
@override @override
_MedicalFileDetailsState createState() => _MedicalFileDetailsState( _MedicalFileDetailsState createState() => _MedicalFileDetailsState(
@ -75,18 +64,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
String doctorImage; String doctorImage;
_MedicalFileDetailsState( _MedicalFileDetailsState(
{this.age, {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.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 isPhysicalExam = true;
bool isProcedureExpand = true; bool isProcedureExpand = true;
@ -102,9 +80,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
model.getMedicalFile(mrn: pp); model.getMedicalFile(mrn: pp);
} }
}, },
builder: builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold(
(BuildContext context, MedicalFileViewModel model, Widget child) =>
AppScaffold(
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(
patient, patient,
doctorName: doctorName, doctorName: doctorName,
@ -113,10 +89,9 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
isPrescriptions: true, isPrescriptions: true,
isMedicalFile: true, isMedicalFile: true,
episode: episode, episode: episode,
visitDate: visitDate: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(
'${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( vistDate,
vistDate, ), isArabic: projectViewModel.isArabic)}',
), isArabic: projectViewModel.isArabic)}',
isAppointmentHeader: true, isAppointmentHeader: true,
), ),
isShowAppBar: true, isShowAppBar: true,
@ -128,125 +103,67 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
model.medicalFileList.length != 0 && model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0
model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations
.length !=
0
? Padding( ? Padding(
padding: EdgeInsets.all(10.0), padding: EdgeInsets.all(10.0),
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
SizedBox(height: 25.0), SizedBox(height: 25.0),
if (model.medicalFileList.length != 0 && if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0)
model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations
.length !=
0)
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only( margin: EdgeInsets.only(top: 10, left: 10, right: 10),
top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
), ),
border: Border.all( border: Border.all(color: Colors.grey[200], width: 0.5),
color: Colors.grey[200],
width: 0.5),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier( child: HeaderBodyExpandableNotifier(
headerWidget: Row( headerWidget: Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
children: [ children: [
AppText( AppText(TranslationBase.of(context).historyOfPresentIllness.toUpperCase(),
TranslationBase.of( variant: isHistoryExpand ? "bodyText" : '', bold: isHistoryExpand ? true : true, color: Colors.black),
context)
.historyOfPresentIllness
.toUpperCase(),
variant: isHistoryExpand
? "bodyText"
: '',
bold: isHistoryExpand
? true
: true,
color: Colors.black),
], ],
), ),
InkWell( InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
isHistoryExpand = isHistoryExpand = !isHistoryExpand;
!isHistoryExpand;
}); });
}, },
child: Icon(isHistoryExpand child: Icon(isHistoryExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown))
? EvaIcons.arrowUp
: EvaIcons.arrowDown))
], ],
), ),
bodyWidget: ListView.builder( bodyWidget: ListView.builder(
physics: physics: NeverScrollableScrollPhysics(),
NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstCheifComplaint.length,
.medicalFileList[0] itemBuilder: (BuildContext ctxt, int index) {
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstCheifComplaint
.length,
itemBuilder: (BuildContext ctxt,
int index) {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Container( child: Container(
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.center,
MainAxisAlignment
.center,
children: [ children: [
Row( Row(
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
model model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstCheifComplaint[index].hOPI
.medicalFileList[
0]
.entityList[
0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstCheifComplaint[
index]
.hOPI
.trim(), .trim(),
), ),
), ),
SizedBox( SizedBox(width: 35.0),
width: 35.0),
], ],
), ),
], ],
@ -265,87 +182,50 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
SizedBox( SizedBox(
height: 30, height: 30,
), ),
if (model.medicalFileList.length != 0 && if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0)
model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations
.length !=
0)
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only( margin: EdgeInsets.only(top: 10, left: 10, right: 10),
top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
), ),
border: Border.all( border: Border.all(color: Colors.grey[200], width: 0.5),
color: Colors.grey[200],
width: 0.5),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier( child: HeaderBodyExpandableNotifier(
headerWidget: Row( headerWidget: Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
children: [ children: [
AppText( AppText(TranslationBase.of(context).assessment.toUpperCase(),
TranslationBase.of( variant: isAssessmentExpand ? "bodyText" : '', bold: isAssessmentExpand ? true : true, color: Colors.black),
context)
.assessment
.toUpperCase(),
variant:
isAssessmentExpand
? "bodyText"
: '',
bold: isAssessmentExpand
? true
: true,
color: Colors.black),
], ],
), ),
InkWell( InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
isAssessmentExpand = isAssessmentExpand = !isAssessmentExpand;
!isAssessmentExpand;
}); });
}, },
child: Icon(isAssessmentExpand child: Icon(isAssessmentExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown))
? EvaIcons.arrowUp
: EvaIcons.arrowDown))
], ],
), ),
bodyWidget: ListView.builder( bodyWidget: ListView.builder(
physics: physics: NeverScrollableScrollPhysics(),
NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments.length,
.medicalFileList[0] itemBuilder: (BuildContext ctxt, int index) {
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstAssessments
.length,
itemBuilder: (BuildContext ctxt,
int index) {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Container( child: Container(
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.center,
MainAxisAlignment
.center,
children: [ children: [
Row( Row(
children: [ children: [
@ -354,59 +234,25 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
fontSize: 13.0, fontSize: 13.0,
), ),
AppText( AppText(
model model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].iCD10.trim(),
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstAssessments[
index]
.iCD10
.trim(),
fontSize: 13.5, fontSize: 13.5,
fontWeight: fontWeight: FontWeight.w700,
FontWeight
.w700,
), ),
SizedBox( SizedBox(width: 15.0),
width: 15.0),
], ],
), ),
Row( Row(
children: [ children: [
AppText( AppText(
TranslationBase.of( TranslationBase.of(context).condition + ": ",
context)
.condition +
": ",
fontSize: 12.5, fontSize: 12.5,
), ),
Expanded( Expanded(
child: AppText( child: AppText(
model model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].condition
.medicalFileList[
0]
.entityList[
0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstAssessments[
index]
.condition
.trim(), .trim(),
fontSize: 13.0, fontSize: 13.0,
fontWeight: fontWeight: FontWeight.w700,
FontWeight
.w700,
), ),
), ),
], ],
@ -415,23 +261,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
model model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].description,
.medicalFileList[ fontWeight: FontWeight.w700,
0]
.entityList[
0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstAssessments[
index]
.description,
fontWeight:
FontWeight
.w700,
fontSize: 15.0, fontSize: 15.0,
), ),
) )
@ -440,32 +271,14 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Row( Row(
children: [ children: [
AppText( AppText(
TranslationBase.of( TranslationBase.of(context).type + ": ",
context)
.type +
": ",
fontSize: 15.5, fontSize: 15.5,
), ),
Expanded( Expanded(
child: AppText( child: AppText(
model model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].type,
.medicalFileList[
0]
.entityList[
0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstAssessments[
index]
.type,
fontSize: 16.0, fontSize: 16.0,
fontWeight: fontWeight: FontWeight.w700,
FontWeight
.w700,
), ),
), ),
], ],
@ -474,18 +287,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
height: 15.0, height: 15.0,
), ),
AppText( AppText(
model model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].remarks.trim(),
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstAssessments[
index]
.remarks
.trim(),
), ),
Divider( Divider(
height: 1, height: 1,
@ -508,86 +310,50 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
SizedBox( SizedBox(
height: 30, height: 30,
), ),
if (model.medicalFileList.length != 0 && if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0)
model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations
.length !=
0)
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only( margin: EdgeInsets.only(top: 10, left: 10, right: 10),
top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
), ),
border: Border.all( border: Border.all(color: Colors.grey[200], width: 0.5),
color: Colors.grey[200],
width: 0.5),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier( child: HeaderBodyExpandableNotifier(
headerWidget: Row( headerWidget: Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
children: [ children: [
AppText( AppText(TranslationBase.of(context).test.toUpperCase(),
TranslationBase.of( variant: isProcedureExpand ? "bodyText" : '', bold: isProcedureExpand ? true : true, color: Colors.black),
context)
.test
.toUpperCase(),
variant: isProcedureExpand
? "bodyText"
: '',
bold: isProcedureExpand
? true
: true,
color: Colors.black),
], ],
), ),
InkWell( InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
isProcedureExpand = isProcedureExpand = !isProcedureExpand;
!isProcedureExpand;
}); });
}, },
child: Icon(isProcedureExpand child: Icon(isProcedureExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown))
? EvaIcons.arrowUp
: EvaIcons.arrowDown))
], ],
), ),
bodyWidget: ListView.builder( bodyWidget: ListView.builder(
physics: physics: NeverScrollableScrollPhysics(),
NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure.length,
.medicalFileList[0] itemBuilder: (BuildContext ctxt, int index) {
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstProcedure
.length,
itemBuilder: (BuildContext ctxt,
int index) {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Container( child: Container(
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.center,
MainAxisAlignment
.center,
children: [ children: [
Row( Row(
children: [ children: [
@ -597,65 +363,26 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
'Procedure ID: ', 'Procedure ID: ',
), ),
AppText( AppText(
model model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].procedureId
.medicalFileList[
0]
.entityList[
0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstProcedure[
index]
.procedureId
.trim(), .trim(),
fontSize: fontSize: 13.5,
13.5, fontWeight: FontWeight.w700,
fontWeight:
FontWeight
.w700,
), ),
], ],
), ),
SizedBox( SizedBox(width: 35.0),
width: 35.0),
Column( Column(
children: [ children: [
AppText( AppText(
TranslationBase.of( TranslationBase.of(context).orderDate + ": ",
context)
.orderDate +
": ",
), ),
AppText( AppText(
AppDateUtils AppDateUtils.getDateFormatted(DateTime.parse(
.getDateFormatted( model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].orderDate
DateTime
.parse(
model
.medicalFileList[
0]
.entityList[
0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstProcedure[
index]
.orderDate
.trim(), .trim(),
)), )),
fontSize: fontSize: 13.5,
13.5, fontWeight: FontWeight.w700,
fontWeight:
FontWeight
.w700,
), ),
], ],
), ),
@ -668,23 +395,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
model model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].procName,
.medicalFileList[ fontWeight: FontWeight.w700,
0]
.entityList[
0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstProcedure[
index]
.procName,
fontWeight:
FontWeight
.w700,
), ),
) )
], ],
@ -695,23 +407,9 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
'CPT Code : ', 'CPT Code : ',
), ),
AppText( AppText(
model model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].patientID
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstProcedure[
index]
.patientID
.toString(), .toString(),
fontWeight: fontWeight: FontWeight.w700,
FontWeight
.w700,
), ),
], ],
), ),
@ -739,79 +437,45 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
SizedBox( SizedBox(
height: 30, height: 30,
), ),
if (model.medicalFileList.length != 0 && if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0)
model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations
.length !=
0)
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only( margin: EdgeInsets.only(top: 10, left: 10, right: 10),
top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
), ),
border: Border.all( border: Border.all(color: Colors.grey[200], width: 0.5),
color: Colors.grey[200],
width: 0.5),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier( child: HeaderBodyExpandableNotifier(
headerWidget: Row( headerWidget: Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
children: [ children: [
AppText( AppText(TranslationBase.of(context).physicalSystemExamination.toUpperCase(),
TranslationBase.of( variant: isPhysicalExam ? "bodyText" : '', bold: isPhysicalExam ? true : true, color: Colors.black),
context)
.physicalSystemExamination
.toUpperCase(),
variant: isPhysicalExam
? "bodyText"
: '',
bold: isPhysicalExam
? true
: true,
color: Colors.black),
], ],
), ),
InkWell( InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
isPhysicalExam = isPhysicalExam = !isPhysicalExam;
!isPhysicalExam;
}); });
}, },
child: Icon(isPhysicalExam child: Icon(isPhysicalExam ? EvaIcons.arrowUp : EvaIcons.arrowDown))
? EvaIcons.arrowUp
: EvaIcons.arrowDown))
], ],
), ),
bodyWidget: ListView.builder( bodyWidget: ListView.builder(
physics: physics: NeverScrollableScrollPhysics(),
NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam.length,
.medicalFileList[0] itemBuilder: (BuildContext ctxt, int index) {
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstPhysicalExam
.length,
itemBuilder: (BuildContext ctxt,
int index) {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Container( child: Container(
@ -819,75 +483,27 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
Row( Row(
children: [ children: [
AppText(TranslationBase.of( AppText(TranslationBase.of(context).examType + ": "),
context)
.examType +
": "),
AppText( AppText(
model model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].examDesc,
.medicalFileList[ fontWeight: FontWeight.w700,
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstPhysicalExam[
index]
.examDesc,
fontWeight:
FontWeight
.w700,
), ),
], ],
), ),
Row( Row(
children: [ children: [
AppText( AppText(
model model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].examDesc,
.medicalFileList[ fontWeight: FontWeight.w700,
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstPhysicalExam[
index]
.examDesc,
fontWeight:
FontWeight
.w700,
) )
], ],
), ),
Row( Row(
children: [ children: [
AppText(TranslationBase.of( AppText(TranslationBase.of(context).abnormal + ": "),
context)
.abnormal +
": "),
AppText( AppText(
model model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].abnormal,
.medicalFileList[ fontWeight: FontWeight.w700,
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstPhysicalExam[
index]
.abnormal,
fontWeight:
FontWeight
.w700,
), ),
], ],
), ),
@ -895,17 +511,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
height: 15.0, height: 15.0,
), ),
AppText( AppText(
model model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].remarks,
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstPhysicalExam[
index]
.remarks,
), ),
Divider( Divider(
height: 1, height: 1,

@ -1,22 +1,23 @@
import 'dart:async'; import 'dart:async';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_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/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/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/service/VideoCallService.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/LiveCarePatientViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.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/base/base_view.dart';
import 'package:doctor_app_flutter/screens/live_care/end_call_screen.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_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_other.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_search.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/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/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/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/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_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(); _PatientProfileScreenState createState() => _PatientProfileScreenState();
} }
class _PatientProfileScreenState extends State<PatientProfileScreen> class _PatientProfileScreenState extends State<PatientProfileScreen> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin {
PatiantInformtion patient; PatiantInformtion patient;
LiveCarePatientViewModel _liveCareViewModel = LiveCarePatientViewModel(); LiveCarePatientViewModel _liveCareViewModel = LiveCarePatientViewModel();
@ -115,15 +115,14 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
StreamSubscription callTimer; StreamSubscription callTimer;
callConnected() { callConnected() {
callTimer = callTimer = CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null)
CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null) ..onDone(() {
..onDone(() { callTimer.cancel();
callTimer.cancel(); })
}) ..onData((data) {
..onData((data) { var t = Utils.timeFrom(duration: data.elapsed);
var t = Utils.timeFrom(duration: data.elapsed); videoCallDurationStreamController.sink.add(t);
videoCallDurationStreamController.sink.add(t); });
});
} }
callDisconnected() { callDisconnected() {
@ -140,8 +139,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
return BaseView<LiveCarePatientViewModel>( return BaseView<LiveCarePatientViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (isFromLiveCare && patient.patientStatus == 1) if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient.vcId);
await model.addPatientToDoctorList(patient.vcId);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
@ -154,13 +152,11 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
children: [ children: [
Column( Column(
children: [ children: [
PatientProfileHeaderNewDesignAppBar( PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType,
patient, arrivalType ?? '0', patientType,
videoCallDurationStream: videoCallDurationStream, videoCallDurationStream: videoCallDurationStream,
isInpatient: isInpatient, isInpatient: isInpatient,
isFromLiveCare: isFromLiveCare, isFromLiveCare: isFromLiveCare,
height: (patient.patientStatusType != null && height: (patient.patientStatusType != null && patient.patientStatusType == 43)
patient.patientStatusType == 43)
? 210 ? 210
: isDischargedPatient : isDischargedPatient
? 240 ? 240
@ -192,8 +188,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
isInpatient: isInpatient, isInpatient: isInpatient,
from: from, from: from,
to: to, to: to,
isDischargedPatient: isDischargedPatient: isDischargedPatient,
isDischargedPatient,
isFromSearch: isFromSearch, isFromSearch: isFromSearch,
) )
: ProfileGridForOther( : ProfileGridForOther(
@ -218,8 +213,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
? true ? true
: isFromLiveCare : isFromLiveCare
? patient.episodeNo != null ? patient.episodeNo != null
: patient.patientStatusType != null && : patient.patientStatusType != null && patient.patientStatusType == 43)
patient.patientStatusType == 43)
BaseView<SOAPViewModel>( BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
model.getDoctorProfile(); model.getDoctorProfile();
@ -237,10 +231,8 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
if (patient.episodeNo == 0) if (patient.episodeNo == 0)
AppButton( AppButton(
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
disabled: disabled: model.state == ViewState.BusyLocal,
model.state == ViewState.BusyLocal, title: "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}",
title:
"${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}",
color: isFromLiveCare || isInpatient color: isFromLiveCare || isInpatient
? AppGlobal.appRedColor ? AppGlobal.appRedColor
: patient.patientStatusType == 43 : patient.patientStatusType == 43
@ -248,8 +240,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
: AppGlobal.appRedColor, : AppGlobal.appRedColor,
fontColor: Colors.white, fontColor: Colors.white,
// vPadding: 8, // vPadding: 8,
height: SizeConfig.heightMultiplier * height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 9 : 6),
(SizeConfig.isHeightVeryShort ? 9 : 6),
radius: 30, radius: 30,
hPadding: 25, hPadding: 25,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
@ -260,34 +251,24 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
height: 30, height: 30,
), ),
onPressed: () async { onPressed: () async {
if ((isFromLiveCare && if ((isFromLiveCare && patient.appointmentNo != null) || patient.patientStatusType == 43 || isInpatient) {
patient.appointmentNo != null) || createEpisode(patient: patient, model: model);
patient.patientStatusType == 43 ||
isInpatient) {
createEpisode(
patient: patient, model: model);
} }
}, },
), ),
if (patient.episodeNo != 0) if (patient.episodeNo != 0)
AppButton( AppButton(
loading: loading: model.state == ViewState.BusyLocal,
model.state == ViewState.BusyLocal, disabled: model.state == ViewState.BusyLocal,
disabled: title: "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}",
model.state == ViewState.BusyLocal, color: ((isInpatient) || isFromLiveCare) && model.state != ViewState.BusyLocal
title:
"${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}",
color: ((isInpatient) ||
isFromLiveCare) &&
model.state != ViewState.BusyLocal
? AppGlobal.appRedColor ? AppGlobal.appRedColor
: patient.patientStatusType == 43 : patient.patientStatusType == 43
?AppGlobal.appRedColor ? AppGlobal.appRedColor
: AppGlobal.appRedColor, : AppGlobal.appRedColor,
fontColor: Colors.white, fontColor: Colors.white,
// vPadding: 8, // vPadding: 8,
height: SizeConfig.heightMultiplier * height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 9 : 6),
(SizeConfig.isHeightVeryShort ? 9 : 6),
radius: 30, radius: 30,
hPadding: 25, hPadding: 25,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
@ -298,19 +279,12 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
height: 30, height: 30,
), ),
onPressed: () async { onPressed: () async {
await locator<AnalyticsService>() await locator<AnalyticsService>().logEvent(
.logEvent(
eventCategory: "Patient Profile ", eventCategory: "Patient Profile ",
eventAction: "Update Episode", eventAction: "Update Episode",
); );
if ((isFromLiveCare && if ((isFromLiveCare && patient.appointmentNo != null && patient.appointmentNo != 0) || patient.patientStatusType == 43 || isInpatient) {
patient.appointmentNo != null && Navigator.of(context).pushNamed(UPDATE_EPISODE, arguments: {'patient': patient});
patient.appointmentNo != 0) ||
patient.patientStatusType == 43 ||
isInpatient) {
Navigator.of(context).pushNamed(
UPDATE_EPISODE,
arguments: {'patient': patient});
} }
}), }),
], ],
@ -342,14 +316,9 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
child: Center( child: Center(
child: AppButton( child: AppButton(
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: isCallFinished color: isCallFinished ? Colors.red[600] : AppGlobal.appGreenColor,
? Colors.red[600] title: isCallFinished ? TranslationBase.of(context).endCall : TranslationBase.of(context).initiateCall,
: AppGlobal.appGreenColor, disabled: isCallStarted || model.state == ViewState.BusyLocal,
title: isCallFinished
? TranslationBase.of(context).endCall
: TranslationBase.of(context).initiateCall,
disabled: isCallStarted ||
model.state == ViewState.BusyLocal,
onPressed: () async { onPressed: () async {
// TODO MOSA TEST // TODO MOSA TEST
// AppPermissionsUtils // AppPermissionsUtils
@ -367,50 +336,32 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (BuildContext context) => builder: (BuildContext context) => EndCallScreen(patient: patient),
EndCallScreen(patient: patient), settings: RouteSettings(name: 'EndCallScreen'),
settings:
RouteSettings(name: 'EndCallScreen'),
), ),
); );
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.startCall( await model.startCall(isReCall: false, vCID: patient.vcId);
isReCall: false, vCID: patient.vcId);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else { } else {
await model.getDoctorProfile(); await model.getDoctorProfile();
patient.appointmentNo = int.parse(model patient.appointmentNo = int.parse(model.startCallRes.appointmentNo.toString());
.startCallRes.appointmentNo
.toString());
patient.episodeNo = 0; patient.episodeNo = 0;
model.updateInCallPatient( model.updateInCallPatient(patient: patient, appointmentNo: int.parse(model.startCallRes.appointmentNo.toString()));
patient: patient,
appointmentNo: int.parse(model
.startCallRes.appointmentNo
.toString()));
setState(() { setState(() {
isCallStarted = true; isCallStarted = true;
}); });
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppPermissionsUtils AppPermissionsUtils.requestVideoCallPermission(
.requestVideoCallPermission( context: context,
context: context, onTapGrant: () {
onTapGrant: () { locator<VideoCallService>()
locator<VideoCallService>() .openVideo(model.startCallRes, patient, model.startCallRes != null ? model.startCallRes.isRecording : true, callConnected, callDisconnected);
.openVideo( });
model.startCallRes,
patient,
model.startCallRes != null
? model.startCallRes
.isRecording
: true,
callConnected,
callDisconnected);
});
} }
} }
}, },
@ -436,15 +387,10 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
); );
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
if (patient.admissionNo != null && patient.admissionNo.isNotEmpty) { if (patient.admissionNo != null && patient.admissionNo.isNotEmpty) {
PostEpisodeForInpatientRequestModel postEpisodeReqModel = PostEpisodeForInpatientRequestModel postEpisodeReqModel = PostEpisodeForInpatientRequestModel(admissionNo: int.parse(patient.admissionNo), patientID: patient.patientId);
PostEpisodeForInpatientRequestModel(
admissionNo: int.parse(patient.admissionNo),
patientID: patient.patientId);
await model.postEpisodeForInPatient(postEpisodeReqModel); await model.postEpisodeForInPatient(postEpisodeReqModel);
} else { } else {
PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(appointmentNo: int.parse(patient.appointmentNo.toString()), patientMRN: patient.patientMRN);
appointmentNo: int.parse(patient.appointmentNo.toString()),
patientMRN: patient.patientMRN);
await model.postEpisode(postEpisodeReqModel); await model.postEpisode(postEpisodeReqModel);
} }
@ -454,8 +400,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else { } else {
patient.episodeNo = model.episodeID; patient.episodeNo = model.episodeID;
Navigator.of(context) Navigator.of(context).pushNamed(CREATE_EPISODE, arguments: {'patient': patient});
.pushNamed(CREATE_EPISODE, arguments: {'patient': patient});
} }
} }
} }
@ -469,12 +414,7 @@ class AvatarWidget extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
boxShadow: [ boxShadow: [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.08), offset: Offset(0.0, 5.0), blurRadius: 16.0)],
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)), borderRadius: BorderRadius.all(Radius.circular(35.0)),
color: Color(0xffCCCCCC), color: Color(0xffCCCCCC),
), ),

@ -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/model/radiology/final_radiology.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.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/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/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.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'; 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 patientType;
final String arrivalType; final String arrivalType;
final bool isInpatient; final bool isInpatient;
final bool isVidaPlus;
RadiologyDetailsPage( RadiologyDetailsPage({Key key, this.finalRadiology, this.patient, this.patientType, this.arrivalType, this.isInpatient = false, this.isVidaPlus = false});
{Key key,
this.finalRadiology,
this.patient,
this.patientType,
this.arrivalType,
this.isInpatient = false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<RadiologyViewModel>( return BaseView<RadiologyViewModel>(
onModelReady: (model) => model.getRadImageURL( onModelReady: (model) => model.getRadImageURL(
patient: patient, patient: patient, projectId: finalRadiology.projectID, lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: isVidaPlus ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo),
projectId: finalRadiology.projectID,
lineItem: finalRadiology.invoiceLineItemNo,
invoiceNo: finalRadiology.invoiceNo),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(
patient, patient,
@ -50,7 +42,7 @@ class RadiologyDetailsPage extends StatelessWidget {
), ),
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -99,8 +91,7 @@ class RadiologyDetailsPage extends StatelessWidget {
height: 80, height: 80,
width: double.maxFinite, width: double.maxFinite,
child: Container( child: Container(
margin: margin: EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12),
EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12),
child: AppButton( child: AppButton(
color: Color(0xffD02127), color: Color(0xffD02127),
disabled: finalRadiology.dIAPACSURL == "", disabled: finalRadiology.dIAPACSURL == "",

@ -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/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_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/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.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'; 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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../../widgets/shared/errors/error_message.dart'; import '../../../../widgets/shared/errors/error_message.dart';
class RadiologyHomePage extends StatefulWidget { class RadiologyHomePage extends StatefulWidget {
@ -47,8 +48,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getPatientRadOrders(patient, onModelReady: (model) => model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false),
patientType: patientType, isInPatient: false),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.grey[100], backgroundColor: Colors.grey[100],
@ -66,21 +66,17 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
if (model.radiologyList.isNotEmpty && if (model.radiologyList.isNotEmpty && patient.patientStatusType != 43)
patient.patientStatusType != 43)
ServiceTitle( ServiceTitle(
title: TranslationBase.of(context).radiology, title: TranslationBase.of(context).radiology,
subTitle: TranslationBase.of(context).result, subTitle: TranslationBase.of(context).result,
), ),
if (patient.patientStatusType != null && if (patient.patientStatusType != null && patient.patientStatusType == 43)
patient.patientStatusType == 43)
ServiceTitle( ServiceTitle(
title: TranslationBase.of(context).radiology, title: TranslationBase.of(context).radiology,
subTitle: TranslationBase.of(context).result, subTitle: TranslationBase.of(context).result,
), ),
if ((patient.patientStatusType != null && if ((patient.patientStatusType != null && patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null))
patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null))
AddNewOrder( AddNewOrder(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
@ -96,6 +92,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
}, },
label: TranslationBase.of(context).applyForRadiologyOrder, label: TranslationBase.of(context).applyForRadiologyOrder,
), ),
///TODO Elham * fix this to be list view builder ///TODO Elham * fix this to be list view builder
...List.generate( ...List.generate(
model.radiologyList.length, model.radiologyList.length,
@ -117,43 +114,26 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
height: 160, height: 160,
decoration: BoxDecoration( decoration: BoxDecoration(
//Colors.red[900] Color(0xff404545) //Colors.red[900] Color(0xff404545)
color: model.radiologyList[index] color: model.radiologyList[index].isLiveCareAppodynamicment
.isLiveCareAppodynamicment
? Colors.red[900] ? Colors.red[900]
: !model.radiologyList[index].isInOutPatient : !model.radiologyList[index].isInOutPatient
? Colors.black ? Colors.black
: Color(0xffa9a089), : Color(0xffa9a089),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
? Radius.circular(0) bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
: Radius.circular(8), topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0),
bottomLeft: projectViewModel.isArabic bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)),
? 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( child: RotatedBox(
quarterTurns: 3, quarterTurns: 3,
child: Center( child: Center(
child: Text( child: Text(
model.radiologyList[index] model.radiologyList[index].isLiveCareAppodynamicment
.isLiveCareAppodynamicment ? TranslationBase.of(context).liveCare.toUpperCase()
? TranslationBase.of(context) : !model.radiologyList[index].isInOutPatient
.liveCare ? TranslationBase.of(context).inPatientLabel.toUpperCase()
.toUpperCase() : TranslationBase.of(context).outpatient.toUpperCase(),
: !model.radiologyList[index]
.isInOutPatient
? TranslationBase.of(context)
.inPatientLabel
.toUpperCase()
: TranslationBase.of(context)
.outpatient
.toUpperCase(),
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
)), )),
@ -161,28 +141,18 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
Expanded( Expanded(
child: DoctorCard( child: DoctorCard(
isNoMargin: true, isNoMargin: true,
doctorName: doctorName: Utils.convertToTitleCase(model.radiologyList[index].doctorName),
Utils.convertToTitleCase(model.radiologyList[index].doctorName), profileUrl: model.radiologyList[index].doctorImageURL,
profileUrl: invoiceNO: model.isRadiologyVIDAPlus ? '${model.radiologyList[index].invoiceNo}' : '${model.radiologyList[index].invoiceNo}',
model.radiologyList[index].doctorImageURL, branch: '${model.radiologyList[index].projectName}',
invoiceNO: clinic: Utils.convertToTitleCase(model.radiologyList[index].clinicDescription),
'${model.radiologyList[index].invoiceNo}', appointmentDate: model.radiologyList[index].orderDate ?? model.radiologyList[index].reportDate,
branch:
'${model.radiologyList[index].projectName}',
clinic:
Utils.convertToTitleCase(model.radiologyList[index].clinicDescription),
appointmentDate:
model.radiologyList[index].orderDate ??
model.radiologyList[index].reportDate,
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: RadiologyDetailsPage( page: RadiologyDetailsPage(
finalRadiology: finalRadiology: model.radiologyList[index], patient: patient, isInpatient: isInpatient, isVidaPlus: model.radiologyList[index].isRecordFromVidaPlus),
model.radiologyList[index],
patient: patient,
isInpatient: isInpatient),
), ),
); );
}, },
@ -191,8 +161,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
], ],
), ),
)), )),
if (model.radiologyList.isEmpty && if (model.radiologyList.isEmpty && patient.patientStatusType != 43)
patient.patientStatusType != 43)
Center( Center(
child: ErrorMessage( child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable, error: TranslationBase.of(context).noDataAvailable,

@ -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/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/PatientType.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/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/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/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/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/date-utils.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/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/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_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_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:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../../../routes.dart'; import '../../../../../routes.dart';
class ReferredPatientDetailScreen extends StatelessWidget { class ReferredPatientDetailScreen extends StatelessWidget {
@ -52,8 +53,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
(Utils.capitalize( (Utils.capitalize("${referredPatient.firstName} ${referredPatient.lastName}")),
"${referredPatient.firstName} ${referredPatient.lastName}")),
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 2.5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -70,19 +70,14 @@ class ReferredPatientDetailScreen extends StatelessWidget {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
PatiantInformtion patient = PatiantInformtion patient = model.getPatientFromReferral(referredPatient);
model.getPatientFromReferral(referredPatient); Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patient, "patient": patient,
"patientType": "1", "patientType": "1",
"isInpatient": "isInpatient": patientType == PatientType.IN_PATIENT,
patientType == PatientType.IN_PATIENT,
"arrivalType": "1", "arrivalType": "1",
"from": AppDateUtils.convertDateToFormat( "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
DateTime.now(), 'yyyy-MM-dd'), "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
"to": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
}); });
}, },
child: Icon( child: Icon(
@ -97,19 +92,14 @@ class ReferredPatientDetailScreen extends StatelessWidget {
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
PatiantInformtion patient = PatiantInformtion patient = model.getPatientFromReferral(referredPatient);
model.getPatientFromReferral(referredPatient); Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patient, "patient": patient,
"patientType": "1", "patientType": "1",
"isInpatient": "isInpatient": patientType == PatientType.IN_PATIENT,
patientType == PatientType.IN_PATIENT,
"arrivalType": "1", "arrivalType": "1",
"from": AppDateUtils.convertDateToFormat( "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
DateTime.now(), 'yyyy-MM-dd'), "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
"to": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
}); });
}, },
child: Column( child: Column(
@ -120,9 +110,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
width: 60, width: 60,
height: 60, height: 60,
child: Image.asset( child: Image.asset(
referredPatient.gender == 1 referredPatient.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png',
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
@ -146,8 +134,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
AppText( AppText(
referredPatient.referralStatusDesc, referredPatient.referralStatusDesc,
@ -161,9 +148,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
: Colors.red[700], : Colors.red[700],
), ),
AppText( AppText(
AppDateUtils.convertDateFromServerFormat( AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate, "dd MMM,yyyy"),
referredPatient.referralDate,
"dd MMM,yyyy"),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 2.0 * SizeConfig.textMultiplier, fontSize: 2.0 * SizeConfig.textMultiplier,
@ -172,20 +157,16 @@ class ReferredPatientDetailScreen extends StatelessWidget {
], ],
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).fileNumber,
.fileNumber,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: fontSize: 1.7 * SizeConfig.textMultiplier,
1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
AppText( AppText(
@ -198,9 +179,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
], ],
), ),
AppText( AppText(
AppDateUtils.convertDateFromServerFormat( AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate, "hh:mm a"),
referredPatient.referralDate,
"hh:mm a"),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier,
@ -209,29 +188,25 @@ class ReferredPatientDetailScreen extends StatelessWidget {
], ],
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
"${TranslationBase.of(context).refClinic}: ", "${TranslationBase.of(context).refClinic}: ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * fontSize: 1.7 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
referredPatient referredPatient.referralClinicDescription,
.referralClinicDescription,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 13, fontSize: 13,
@ -240,29 +215,21 @@ class ReferredPatientDetailScreen extends StatelessWidget {
), ),
], ],
), ),
if (referredPatient if (referredPatient.frequencyDescription != null)
.frequencyDescription !=
null)
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).frequency + ": ",
.frequency +
": ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * fontSize: 1.7 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
referredPatient referredPatient.frequencyDescription,
.frequencyDescription,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 14, fontSize: 14,
@ -277,29 +244,19 @@ class ReferredPatientDetailScreen extends StatelessWidget {
Row( Row(
children: [ children: [
AppText( AppText(
referredPatient.nationalityName != referredPatient.nationalityName != null ? referredPatient.nationalityName : "",
null
? referredPatient.nationalityName
: "",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: fontSize: 1.4 * SizeConfig.textMultiplier,
1.4 * SizeConfig.textMultiplier,
), ),
referredPatient.nationalityFlagURL != referredPatient.nationalityFlagURL != null
null
? ClipRRect( ? ClipRRect(
borderRadius: borderRadius: BorderRadius.circular(20.0),
BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
referredPatient referredPatient.nationalityFlagURL,
.nationalityFlagURL,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) {
context,
Object exception,
StackTrace stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -311,16 +268,13 @@ class ReferredPatientDetailScreen extends StatelessWidget {
if (referredPatient.priorityDescription != null) if (referredPatient.priorityDescription != null)
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context).priority + TranslationBase.of(context).priority + ": ",
": ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: fontSize: 1.7 * SizeConfig.textMultiplier,
1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
AppText( AppText(
@ -335,33 +289,21 @@ class ReferredPatientDetailScreen extends StatelessWidget {
if (referredPatient.mAXResponseTime != null) if (referredPatient.mAXResponseTime != null)
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).maxResponseTime + ": ",
.maxResponseTime +
": ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: fontSize: 1.7 * SizeConfig.textMultiplier,
1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
referredPatient.mAXResponseTime != referredPatient.mAXResponseTime != null ? AppDateUtils.convertDateFromServerFormat(referredPatient.mAXResponseTime, "dd MMM,yyyy") : '',
null
? AppDateUtils
.convertDateFromServerFormat(
referredPatient
.mAXResponseTime,
"dd MMM,yyyy")
: '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: fontSize: 1.8 * SizeConfig.textMultiplier,
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
), ),
@ -371,8 +313,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
margin: margin: EdgeInsets.only(left: 10, right: 0),
EdgeInsets.only(left: 10, right: 0),
child: Image.asset( child: Image.asset(
'assets/images/patient/ic_ref_arrow_left.png', 'assets/images/patient/ic_ref_arrow_left.png',
height: 50, height: 50,
@ -380,34 +321,22 @@ class ReferredPatientDetailScreen extends StatelessWidget {
), ),
), ),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0),
left: 0, padding: EdgeInsets.only(left: 4.0, right: 4.0),
top: 25, child: referredPatient.doctorImageURL != null
right: 0,
bottom: 0),
padding: EdgeInsets.only(
left: 4.0, right: 4.0),
child: referredPatient.doctorImageURL !=
null
? ClipRRect( ? ClipRRect(
borderRadius: borderRadius: BorderRadius.circular(20.0),
BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
referredPatient.doctorImageURL, referredPatient.doctorImageURL,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) {
(BuildContext context,
Object exception,
StackTrace stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
: Container( : Container(
child: Image.asset( child: Image.asset(
referredPatient.gender == 1 referredPatient.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png',
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
@ -415,30 +344,22 @@ class ReferredPatientDetailScreen extends StatelessWidget {
Expanded( Expanded(
flex: 4, flex: 4,
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 10, top: 30, right: 10, bottom: 0),
left: 10,
top: 30,
right: 10,
bottom: 0),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
"${TranslationBase.of(context).dr} ${referredPatient.referralDoctorName}", "${TranslationBase.of(context).dr} ${referredPatient.referralDoctorName}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
fontSize: 1.5 * fontSize: 1.5 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier,
color: Colors.black, color: Colors.black,
), ),
AppText( AppText(
referredPatient referredPatient.referralClinicDescription,
.referralClinicDescription,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.3 * fontSize: 1.3 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
], ],
@ -495,8 +416,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 0, top: 0, right: 4, bottom: 0),
left: 0, top: 0, right: 4, bottom: 0),
padding: EdgeInsets.only(left: 4.0, right: 4.0), padding: EdgeInsets.only(left: 4.0, right: 4.0),
child: referredPatient.doctorImageURL != null child: referredPatient.doctorImageURL != null
? ClipRRect( ? ClipRRect(
@ -505,17 +425,13 @@ class ReferredPatientDetailScreen extends StatelessWidget {
referredPatient.doctorImageURL, referredPatient.doctorImageURL,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) {
Object exception,
StackTrace stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
: Container( : Container(
child: Image.asset( child: Image.asset(
referredPatient.gender == 1 referredPatient.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png',
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
@ -532,15 +448,11 @@ class ReferredPatientDetailScreen extends StatelessWidget {
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
AppText( AppText(
referredPatient.referredDoctorRemarks == referredPatient.referredDoctorRemarks == null
null
? '' ? ''
: referredPatient.referredDoctorRemarks : referredPatient.referredDoctorRemarks.isNotEmpty
.isNotEmpty ? referredPatient.referredDoctorRemarks
? referredPatient : TranslationBase.of(context).notRepliedYet,
.referredDoctorRemarks
: TranslationBase.of(context)
.notRepliedYet,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.6 * SizeConfig.textMultiplier, fontSize: 1.6 * SizeConfig.textMultiplier,
@ -576,8 +488,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} else { } else {
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast("Referral is acknowledged");
"Referral is acknowledged");
Navigator.pop(context); Navigator.pop(context);
} }
}, },

@ -1,6 +1,6 @@
import 'package:doctor_app_flutter/config/size_config.dart'; 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/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/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_in_patient.dart';
import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/prescription_items_out_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:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../utils/utils.dart'; import '../../utils/utils.dart';
import '../../widgets/shared/errors/error_message.dart'; import '../../widgets/shared/errors/error_message.dart';
@ -29,10 +30,7 @@ class OldPrescriptionsPage extends StatelessWidget {
bool isFromLiveCare = routeArgs['isFromLiveCare']; bool isFromLiveCare = routeArgs['isFromLiveCare'];
return BaseView<PrescriptionViewModel>( return BaseView<PrescriptionViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
patient.admissionNo == null patient.admissionNo == null ? model.getPrescriptions(patient, patientType: patientType, isLocalBusy: false) : model.getMedicationForInPatient(patient);
? model.getPrescriptions(patient,
patientType: patientType, isLocalBusy: false)
: model.getMedicationForInPatient(patient);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
@ -52,20 +50,18 @@ class OldPrescriptionsPage extends StatelessWidget {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
ServiceTitle( ServiceTitle(
title: TranslationBase.of(context).orders, title: TranslationBase.of(context).orders,
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context).prescriptions + "(${TranslationBase.of(context).old}) ",
.prescriptions + "(${TranslationBase.of(context) ),
.old }) ", ],
),
],
),
), ),
),
ListView.builder( ListView.builder(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
itemCount: model.prescriptionsList.length, itemCount: model.prescriptionsList.length,
@ -76,8 +72,7 @@ class OldPrescriptionsPage extends StatelessWidget {
context, context,
FadePage( FadePage(
page: PrescriptionItemsPage( page: PrescriptionItemsPage(
prescriptions: model prescriptions: model.prescriptionsList[index],
.prescriptionsList[index],
patient: patient, patient: patient,
arrivalType: arrivalType, arrivalType: arrivalType,
), ),
@ -86,143 +81,109 @@ class OldPrescriptionsPage extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
DoctorCard( DoctorCard(
doctorName: doctorName: Utils.convertToTitleCase(model.prescriptionsList[index].doctorName),
Utils.convertToTitleCase(model profileUrl: model.prescriptionsList[index].doctorImageURL,
.prescriptionsList[index] branch: model.prescriptionsList[index].name,
.doctorName), clinic: model.prescriptionsList[index].clinicDescription,
profileUrl: model
.prescriptionsList[index]
.doctorImageURL,
branch: model
.prescriptionsList[index].name,
clinic: model.prescriptionsList[index]
.clinicDescription,
isPrescriptions: true, isPrescriptions: true,
appointmentDate: AppDateUtils appointmentDate: AppDateUtils.getDateTimeFromServerFormat(
.getDateTimeFromServerFormat( model.prescriptionsList[index].appointmentDate,
model.prescriptionsList[index]
.appointmentDate,
), ),
), ),
], ],
)); ));
}), }),
if (model.prescriptionsList.isEmpty && if (model.prescriptionsList.isEmpty && patient.patientStatusType != 43)
patient.patientStatusType != 43)
Center( Center(
child: ErrorMessage( child: ErrorMessage(
error: TranslationBase.of(context) error: TranslationBase.of(context).noPrescriptionsFound,
.noPrescriptionsFound,
)) ))
], ],
), ),
), ),
) )
: Center( : Center(
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: 12, height: 12,
), ),
ServiceTitle( ServiceTitle(
title: TranslationBase.of(context).orders, title: TranslationBase.of(context).orders,
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context).prescriptions + "(${TranslationBase.of(context).old}) ",
.prescriptions + "(${TranslationBase.of(context) ),
.old }) ", model.medicationForInPatient.length == 0
), ? Center(
model.medicationForInPatient.length == 0? child: ErrorMessage(
Center( error: TranslationBase.of(context).noPrescriptionsFound,
child: ErrorMessage( ))
error: TranslationBase.of(context) : ListView.builder(
.noPrescriptionsFound, scrollDirection: Axis.vertical,
)): ListView.builder( physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), itemCount: model.medicationForInPatient.length,
shrinkWrap: true, itemBuilder: (context, index) {
itemCount: model.medicationForInPatient.length, //model.medicationForInPatient.length,
itemBuilder: (context, index) { return InkWell(
//model.medicationForInPatient.length, child: CardWithBgWidget(
return InkWell( bgColor: Colors.transparent,
child: CardWithBgWidget( widget: Column(
bgColor: Colors.transparent, children: [
widget: Column( CustomRow(
children: [ label: "",
CustomRow( value: Utils.convertToTitleCase(model.medicationForInPatient[index].pHRItemDescription),
label: "", valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
value: Utils.convertToTitleCase(model ),
.medicationForInPatient[index] SizedBox(
.pHRItemDescription), height: 10,
valueSize: SizeConfig ),
.getTextMultiplierBasedOnWidth() * CustomRow(
3.5, label: "Doctor Name :",
), value: Utils.convertToTitleCase(model.medicationForInPatient[index].doctorName.toString()),
SizedBox( ),
height: 10, CustomRow(
), label: "Status :",
CustomRow( value: Utils.convertToTitleCase(model.medicationForInPatient[index].statusDescription.toString()),
label: "Doctor Name :", ),
value: Utils.convertToTitleCase(model CustomRow(
.medicationForInPatient[index] label: "dose :",
.doctorName value: Utils.convertToTitleCase(model.medicationForInPatient[index].dose.toString()),
.toString()), ),
), CustomRow(
CustomRow( label: "comments :",
label: "Status :", value: Utils.convertToTitleCase(model.medicationForInPatient[index].comments.toString()),
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,
), ),
stopOn: AppDateUtils onTap: () => Navigator.push(
.getDateTimeFromServerFormat( context,
model.medicationForInPatient[index] FadePage(
.stopDatetime, 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,
),
),
),
), ),
), );
), }),
), ],
); ),
}),
],
), ),
), ),
), )));
)));
} }
} }

Loading…
Cancel
Save