Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into in_patient_soap

merge-requests/807/head
hussam al-habibeh 5 years ago
commit 393943a19b

@ -125,6 +125,7 @@ const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLab
const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail'; const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail';
const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults'; const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults';
const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults';
const GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION = 'Services/Patients.svc/REST/GetPatientLabOrdersResultsHistoryByDescription';
// SOAP // SOAP

@ -709,5 +709,7 @@ const Map<String, Map<String, String>> localizedValues = {
"Completed": {"en": "Completed", "ar": "مكتمل"}, "Completed": {"en": "Completed", "ar": "مكتمل"},
"Locked": {"en": "Locked", "ar": "مقفل"}, "Locked": {"en": "Locked", "ar": "مقفل"},
"textCopiedSuccessfully": {"en": "Text copied successfully", "ar": "تم نسخ النص بنجاح"}, "textCopiedSuccessfully": {"en": "Text copied successfully", "ar": "تم نسخ النص بنجاح"},
"seeMore": {"en": "See More ...", "ar": "شاهد المزيد..."},
"roomNo": {"en": "Room No", "ar": "رقم الغرفة"},
}; };

@ -0,0 +1,108 @@
class LabResultHistory {
String description;
String femaleInterpretativeData;
int gender;
bool isCertificateAllowed;
int lineItemNo;
String maleInterpretativeData;
String notes;
int orderLineItemNo;
int orderNo;
String packageID;
int patientID;
String projectID;
String referanceRange;
String resultValue;
int resultValueBasedLineItemNo;
String resultValueFlag;
String sampleCollectedOn;
String sampleReceivedOn;
String setupID;
String superVerifiedOn;
String testCode;
String uOM;
String verifiedOn;
String verifiedOnDateTime;
LabResultHistory(
{this.description,
this.femaleInterpretativeData,
this.gender,
this.isCertificateAllowed,
this.lineItemNo,
this.maleInterpretativeData,
this.notes,
this.orderLineItemNo,
this.orderNo,
this.packageID,
this.patientID,
this.projectID,
this.referanceRange,
this.resultValue,
this.resultValueBasedLineItemNo,
this.resultValueFlag,
this.sampleCollectedOn,
this.sampleReceivedOn,
this.setupID,
this.superVerifiedOn,
this.testCode,
this.uOM,
this.verifiedOn,
this.verifiedOnDateTime});
LabResultHistory.fromJson(Map<String, dynamic> json) {
description = json['Description'];
femaleInterpretativeData = json['FemaleInterpretativeData'];
gender = json['Gender'];
isCertificateAllowed = json['IsCertificateAllowed'];
lineItemNo = json['LineItemNo'];
maleInterpretativeData = json['MaleInterpretativeData'];
notes = json['Notes'];
orderLineItemNo = json['OrderLineItemNo'];
orderNo = json['OrderNo'];
packageID = json['PackageID'];
patientID = json['PatientID'];
projectID = json['ProjectID'];
referanceRange = json['ReferanceRange'];
resultValue = json['ResultValue'];
resultValueBasedLineItemNo = json['ResultValueBasedLineItemNo'];
resultValueFlag = json['ResultValueFlag'];
sampleCollectedOn = json['SampleCollectedOn'];
sampleReceivedOn = json['SampleReceivedOn'];
setupID = json['SetupID'];
superVerifiedOn = json['SuperVerifiedOn'];
testCode = json['TestCode'];
uOM = json['UOM'];
verifiedOn = json['VerifiedOn'];
verifiedOnDateTime = json['VerifiedOnDateTime'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Description'] = this.description;
data['FemaleInterpretativeData'] = this.femaleInterpretativeData;
data['Gender'] = this.gender;
data['IsCertificateAllowed'] = this.isCertificateAllowed;
data['LineItemNo'] = this.lineItemNo;
data['MaleInterpretativeData'] = this.maleInterpretativeData;
data['Notes'] = this.notes;
data['OrderLineItemNo'] = this.orderLineItemNo;
data['OrderNo'] = this.orderNo;
data['PackageID'] = this.packageID;
data['PatientID'] = this.patientID;
data['ProjectID'] = this.projectID;
data['ReferanceRange'] = this.referanceRange;
data['ResultValue'] = this.resultValue;
data['ResultValueBasedLineItemNo'] = this.resultValueBasedLineItemNo;
data['ResultValueFlag'] = this.resultValueFlag;
data['SampleCollectedOn'] = this.sampleCollectedOn;
data['SampleReceivedOn'] = this.sampleReceivedOn;
data['SetupID'] = this.setupID;
data['SuperVerifiedOn'] = this.superVerifiedOn;
data['TestCode'] = this.testCode;
data['UOM'] = this.uOM;
data['VerifiedOn'] = this.verifiedOn;
data['VerifiedOnDateTime'] = this.verifiedOnDateTime;
return data;
}
}

@ -13,15 +13,15 @@ class DoctorReplyService extends BaseService {
List<ListGtMyPatientsQuestions> _listDoctorWorkingHoursTable = []; List<ListGtMyPatientsQuestions> _listDoctorWorkingHoursTable = [];
RequestDoctorReply _requestDoctorReply = RequestDoctorReply();
List<MyReferralPatientModel> _listMyReferralPatientModel = []; List<MyReferralPatientModel> _listMyReferralPatientModel = [];
List<MyReferralPatientModel> get listMyReferralPatientModel => _listMyReferralPatientModel; List<MyReferralPatientModel> get listMyReferralPatientModel => _listMyReferralPatientModel;
int notRepliedCount = 0; int notRepliedCount = 0;
Future getDoctorReply() async { Future getDoctorReply(RequestDoctorReply _requestDoctorReply,{bool clearData = false}) async {
hasError = false; hasError = false;
await baseAppClient.post(GT_MY_PATIENT_QUESTION, await baseAppClient.post(GT_MY_PATIENT_QUESTION,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
if(clearData)
_listDoctorWorkingHoursTable.clear(); _listDoctorWorkingHoursTable.clear();
response['List_GtMyPatientsQuestions'].forEach((v) { response['List_GtMyPatientsQuestions'].forEach((v) {
_listDoctorWorkingHoursTable _listDoctorWorkingHoursTable

@ -1,5 +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/labs/LabOrderResult.dart'; import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart';
import 'package:doctor_app_flutter/core/model/labs/LabResultHistory.dart';
import 'package:doctor_app_flutter/core/model/labs/lab_result.dart'; import 'package:doctor_app_flutter/core/model/labs/lab_result.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart';
@ -52,6 +53,7 @@ class LabsService extends BaseService {
List<PatientLabSpecialResult> patientLabSpecialResult = List(); List<PatientLabSpecialResult> patientLabSpecialResult = List();
List<LabResult> labResultList = List(); List<LabResult> labResultList = List();
List<LabOrderResult> labOrdersResultsList = List(); List<LabOrderResult> labOrdersResultsList = List();
List<LabResultHistory> labOrdersResultHistoryList = List();
Future getLaboratoryResult( Future getLaboratoryResult(
{String projectID, {String projectID,
@ -113,7 +115,8 @@ class LabsService extends BaseService {
labResultList.add(LabResult.fromJson(hospital)); labResultList.add(LabResult.fromJson(hospital));
}); });
response['List_GetLabSpecial'].forEach((hospital) { response['List_GetLabSpecial'].forEach((hospital) {
patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital)); patientLabSpecialResult
.add(PatientLabSpecialResult.fromJson(hospital));
}); });
} else { } else {
response['ListPLR'].forEach((lab) { response['ListPLR'].forEach((lab) {
@ -179,4 +182,30 @@ class LabsService extends BaseService {
// super.error = error; // super.error = error;
// }, body: _requestSendLabReportEmail.toJson()); // }, body: _requestSendLabReportEmail.toJson());
} }
Future getPatientLabOrdersResultHistoryByDescription(
{PatientLabOrders patientLabOrder,
String procedureDescription,
PatiantInformtion patient}) async {
hasError = false;
Map<String, dynamic> body = Map();
if (patientLabOrder != null) {
body['SetupID'] = patientLabOrder.setupID;
body['ProjectID'] = 0;
body['ClinicID'] = 0;
}
body['isDentalAllowedBackend'] = false;
body['ProcedureDescription'] = procedureDescription;
await baseAppClient.postPatient(
GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION,
patient: patient, onSuccess: (dynamic response, int statusCode) {
labOrdersResultHistoryList.clear();
response['ListGeneralResultHistory'].forEach((lab) {
labOrdersResultHistoryList.add(LabResultHistory.fromJson(lab));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
} }

@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart'; import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart';
import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart';
import 'package:doctor_app_flutter/models/doctor/replay/request_create_doctor_response.dart'; import 'package:doctor_app_flutter/models/doctor/replay/request_create_doctor_response.dart';
import 'package:doctor_app_flutter/models/doctor/replay/request_doctor_reply.dart';
import '../../locator.dart'; import '../../locator.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';
@ -12,13 +13,25 @@ class DoctorReplayViewModel extends BaseViewModel {
List<ListGtMyPatientsQuestions> get listDoctorWorkingHoursTable => List<ListGtMyPatientsQuestions> get listDoctorWorkingHoursTable =>
_doctorReplyService.listDoctorWorkingHoursTable; _doctorReplyService.listDoctorWorkingHoursTable;
Future getDoctorReply() async { Future getDoctorReply(
setState(ViewState.Busy); {int pageSize = 10, int pageIndex = 1, bool isLocalBusy = true}) async {
if (isLocalBusy) {
setState(ViewState.BusyLocal);
} else {
setState(ViewState.Busy);
}
await getDoctorProfile(); await getDoctorProfile();
await _doctorReplyService.getDoctorReply(); RequestDoctorReply _requestDoctorReply =
RequestDoctorReply(pageIndex: pageIndex, pageSize: pageSize);
await _doctorReplyService.getDoctorReply(_requestDoctorReply, clearData:!isLocalBusy );
if (_doctorReplyService.hasError) { if (_doctorReplyService.hasError) {
error = _doctorReplyService.error; error = _doctorReplyService.error;
setState(ViewState.Error); if (isLocalBusy) {
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Error);
}
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
@ -28,13 +41,12 @@ class DoctorReplayViewModel extends BaseViewModel {
await getDoctorProfile(); await getDoctorProfile();
CreateDoctorResponseModel createDoctorResponseModel = CreateDoctorResponseModel createDoctorResponseModel =
CreateDoctorResponseModel( CreateDoctorResponseModel(
transactionNo: model.transactionNo.toString(), transactionNo: model.transactionNo.toString(),
doctorResponse: response, doctorResponse: response,
infoStatus: 6, infoStatus: 6,
createdBy:this.doctorProfile.doctorID, createdBy: this.doctorProfile.doctorID,
infoEnteredBy: this.doctorProfile.doctorID, infoEnteredBy: this.doctorProfile.doctorID,
setupID:"010266" setupID: "010266");
);
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _doctorReplyService.createDoctorResponse(createDoctorResponseModel); await _doctorReplyService.createDoctorResponse(createDoctorResponseModel);
if (_doctorReplyService.hasError) { if (_doctorReplyService.hasError) {
@ -43,7 +55,6 @@ class DoctorReplayViewModel extends BaseViewModel {
} else { } else {
setState(ViewState.Idle); setState(ViewState.Idle);
_doctorReplyService.getNotRepliedCount(); _doctorReplyService.getNotRepliedCount();
} }
} }
} }

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart'; import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart';
import 'package:doctor_app_flutter/core/model/labs/LabResultHistory.dart';
import 'package:doctor_app_flutter/core/model/labs/lab_result.dart'; import 'package:doctor_app_flutter/core/model/labs/lab_result.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart';
@ -26,6 +27,8 @@ class LabsViewModel extends BaseViewModel {
? _patientLabOrdersListClinic ? _patientLabOrdersListClinic
: _patientLabOrdersListHospital; : _patientLabOrdersListHospital;
List<LabResultHistory> get labOrdersResultHistoryList => _labsService.labOrdersResultHistoryList;
void getLabs(PatiantInformtion patient) async { void getLabs(PatiantInformtion patient) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _labsService.getPatientLabOrdersList(patient, true); await _labsService.getPatientLabOrdersList(patient, true);
@ -132,7 +135,7 @@ class LabsViewModel extends BaseViewModel {
} }
} }
void setLabResultDependOnFilterName(){ void setLabResultDependOnFilterName() {
_labsService.labResultList.forEach((element) { _labsService.labResultList.forEach((element) {
List<LabResultList> patientLabOrdersClinic = labResultLists List<LabResultList> patientLabOrdersClinic = labResultLists
.where( .where(
@ -176,6 +179,23 @@ class LabsViewModel extends BaseViewModel {
} }
} }
getPatientLabResultHistoryByDescription(
{PatientLabOrders patientLabOrder,
String procedureDescription,
PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _labsService.getPatientLabOrdersResultHistoryByDescription(
patientLabOrder: patientLabOrder,
procedureDescription: procedureDescription,
patient: patient);
if (_labsService.hasError) {
error = _labsService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
sendLabReportEmail({PatientLabOrders patientLabOrder, String mes}) async { sendLabReportEmail({PatientLabOrders patientLabOrder, String mes}) async {
await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder);
if (_labsService.hasError) { if (_labsService.hasError) {

@ -13,20 +13,24 @@ class RequestDoctorReply {
String sessionID; String sessionID;
bool isLoginForDoctorApp; bool isLoginForDoctorApp;
bool patientOutSA; bool patientOutSA;
int pageIndex;
int pageSize;
RequestDoctorReply( RequestDoctorReply(
{this.projectID , {this.projectID,
this.doctorID , this.doctorID,
this.transactionNo = TRANSACTION_NO , this.transactionNo = TRANSACTION_NO,
this.languageID , this.languageID,
this.stamp , this.stamp,
this.iPAdress, this.iPAdress,
this.versionID , this.versionID,
this.channel, this.channel,
this.tokenID , this.tokenID,
this.sessionID, this.sessionID,
this.isLoginForDoctorApp , this.isLoginForDoctorApp,
this.patientOutSA }); this.patientOutSA,
this.pageIndex,
this.pageSize});
RequestDoctorReply.fromJson(Map<String, dynamic> json) { RequestDoctorReply.fromJson(Map<String, dynamic> json) {
projectID = json['ProjectID']; projectID = json['ProjectID'];
@ -41,6 +45,8 @@ class RequestDoctorReply {
sessionID = json['SessionID']; sessionID = json['SessionID'];
isLoginForDoctorApp = json['IsLoginForDoctorApp']; isLoginForDoctorApp = json['IsLoginForDoctorApp'];
patientOutSA = json['PatientOutSA']; patientOutSA = json['PatientOutSA'];
pageIndex = json['PageIndex'];
pageSize = json['PageSize'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -57,6 +63,8 @@ class RequestDoctorReply {
data['SessionID'] = this.sessionID; data['SessionID'] = this.sessionID;
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
data['PatientOutSA'] = this.patientOutSA; data['PatientOutSA'] = this.patientOutSA;
data['PageIndex'] = this.pageIndex;
data['PageSize'] = this.pageSize;
return data; return data;
} }
} }

@ -370,7 +370,7 @@ class DoctorReplayChat extends StatelessWidget {
Helpers.showErrorToast(previousModel.error); Helpers.showErrorToast(previousModel.error);
} else { } else {
DrAppToastMsg.showSuccesToast("Thank you for your replay "); DrAppToastMsg.showSuccesToast("Thank you for your replay ");
await previousModel.getDoctorReply(); await previousModel.getDoctorReply(isLocalBusy: false);
Navigator.pop(context); Navigator.pop(context);
} }
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -1,10 +1,16 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/doctor_replay_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/doctor/doctor_repaly_chat.dart'; import 'package:doctor_app_flutter/screens/doctor/doctor_repaly_chat.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/doctor/doctor_reply_widget.dart'; import 'package:doctor_app_flutter/widgets/doctor/doctor_reply_widget.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/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -15,21 +21,27 @@ import 'package:flutter/material.dart';
*@return: *@return:
*@desc: Doctor Reply Screen display data from GtMyPatientsQuestions service *@desc: Doctor Reply Screen display data from GtMyPatientsQuestions service
*/ */
class DoctorReplyScreen extends StatelessWidget { class DoctorReplyScreen extends StatefulWidget {
final Function changeCurrentTab; final Function changeCurrentTab;
const DoctorReplyScreen({Key key, this.changeCurrentTab}) : super(key: key); const DoctorReplyScreen({Key key, this.changeCurrentTab}) : super(key: key);
@override
_DoctorReplyScreenState createState() => _DoctorReplyScreenState();
}
class _DoctorReplyScreenState extends State<DoctorReplyScreen> {
int pageIndex = 1;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<DoctorReplayViewModel>( return BaseView<DoctorReplayViewModel>(
onModelReady: (model) { onModelReady: (model) {
model.getDoctorReply(); model.getDoctorReply(isLocalBusy: false);
}, },
builder: (_, model, w) => WillPopScope( builder: (_, model, w) => WillPopScope(
onWillPop: ()async{ onWillPop: () async {
changeCurrentTab(); widget.changeCurrentTab();
return false; return false;
}, },
child: AppScaffold( child: AppScaffold(
@ -38,36 +50,62 @@ class DoctorReplyScreen extends StatelessWidget {
isShowAppBar: false, isShowAppBar: false,
body: model.listDoctorWorkingHoursTable.isEmpty body: model.listDoctorWorkingHoursTable.isEmpty
? DrAppEmbeddedError(error: TranslationBase.of(context).noItem) ? DrAppEmbeddedError(error: TranslationBase.of(context).noItem)
: Container( : Column(
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), children: [
child: ListView( Expanded(
children: [ child: Container(
Column( padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
crossAxisAlignment: CrossAxisAlignment.start, child: NotificationListener(
mainAxisAlignment: MainAxisAlignment.spaceBetween, child: ListView.builder(
children: scrollDirection: Axis.vertical,
model.listDoctorWorkingHoursTable.map((reply) { itemCount: model.listDoctorWorkingHoursTable.length,
return InkWell( shrinkWrap: true,
onTap: () { itemBuilder: (BuildContext ctxt, int index) {
Navigator.push( return Column(
context, children: [
MaterialPageRoute( InkWell(
builder: (BuildContext context) => onTap: () {
DoctorReplayChat( Navigator.push(
reply: reply, context,
previousModel: model, MaterialPageRoute(
), settings: RouteSettings(name: 'DoctorReplayChat'),)); builder: (BuildContext context) =>
}, DoctorReplayChat(
child: DoctorReplyWidget(reply: reply), reply:
); model.listDoctorWorkingHoursTable[
}).toList(), index],
) previousModel: model,
], ),
settings: RouteSettings(
name: 'DoctorReplayChat'),
));
},
child: DoctorReplyWidget(
reply: model
.listDoctorWorkingHoursTable[index]),
),
if(model.state == ViewState.BusyLocal && index == model.listDoctorWorkingHoursTable.length-1)
DrAppCircularProgressIndeicator()
],
);
}),
onNotification: (t) {
if (t is ScrollEndNotification &&
model.state != ViewState.BusyLocal) {
setState(() {
pageIndex++;
});
model.getDoctorReply(pageIndex: pageIndex);
}
return;
},
),
),
), ),
), ],
),
), ),
), ),
); );
} }
} }

@ -0,0 +1,132 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.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/errors/error_message.dart';
import 'package:flutter/material.dart';
class LabResultHistoryPage extends StatelessWidget {
final PatientLabOrders patientLabOrder;
final String filterName;
final PatiantInformtion patient;
LabResultHistoryPage({this.patientLabOrder, this.filterName, this.patient});
@override
Widget build(BuildContext context) {
return BaseView<LabsViewModel>(
onModelReady: (model) => model.getPatientLabResultHistoryByDescription(
patientLabOrder: patientLabOrder,
procedureDescription: filterName,
patient: patient),
builder: (context, model, w) => AppScaffold(
isShowAppBar: true,
appBarTitle: filterName,
baseViewModel: model,
body: model.labOrdersResultHistoryList.length > 0
? SingleChildScrollView(
child: Column(
children: [
...List.generate(model.labOrdersResultHistoryList.length,
(index) {
return Container(
child: Column(
children: [
Row(
children: [
AppText(
TranslationBase.of(context).description,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
SizedBox(
width: 1,
),
AppText(
model.labOrdersResultHistoryList[index].description,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
isCopyable: true,
),
],
),
Row(
children: [
AppText(
"Reference Range",
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
SizedBox(
width: 1,
),
AppText(
model.labOrdersResultHistoryList[index].referanceRange,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
isCopyable: true,
),
],
),
Row(
children: [
AppText(
"Result Value",
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
SizedBox(
width: 1,
),
AppText(
model.labOrdersResultHistoryList[index].resultValue,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
isCopyable: true,
),
],
),
Row(
children: [
AppText(
"Verified On",
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
SizedBox(
width: 1,
),
AppText(
model.labOrdersResultHistoryList[index].verifiedOn,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
isCopyable: true,
),
],
),
],
),
);
}),
],
),
)
: ErrorMessage(
error: "No data",
),
),
);
}
}

@ -10,6 +10,8 @@ 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 'LabResultHistoryPage.dart';
class LabResultWidget extends StatelessWidget { class LabResultWidget extends StatelessWidget {
final String filterName; final String filterName;
final List<LabResult> patientLabResultList; final List<LabResult> patientLabResultList;
@ -18,7 +20,12 @@ class LabResultWidget extends StatelessWidget {
final bool isInpatient; final bool isInpatient;
LabResultWidget( LabResultWidget(
{Key key, this.filterName, this.patientLabResultList, this.patientLabOrder, this.patient, this.isInpatient}) {Key key,
this.filterName,
this.patientLabResultList,
this.patientLabOrder,
this.patient,
this.isInpatient})
: super(key: key); : super(key: key);
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
@ -35,7 +42,30 @@ class LabResultWidget extends StatelessWidget {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
AppText(filterName), Row(
children: [
AppText(filterName),
InkWell(
onTap: (){
Navigator.push(
context,
FadePage(
page: LabResultHistoryPage(
filterName: filterName,
patientLabOrder: patientLabOrder,
patient: patient,
),
),
);
},
child: AppText(
" (show details)",
color: Colors.blue,
fontSize: 12,
),
),
],
),
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
@ -117,7 +147,8 @@ class LabResultWidget extends StatelessWidget {
color: Colors.white, color: Colors.white,
child: Center( child: Center(
child: AppText( child: AppText(
'${patientLabResultList[index].testCode}\n' + patientLabResultList[index].description, '${patientLabResultList[index].testCode}\n' +
patientLabResultList[index].description,
textAlign: TextAlign.center, textAlign: TextAlign.center,
isCopyable: true, isCopyable: true,
), ),
@ -131,7 +162,9 @@ class LabResultWidget extends StatelessWidget {
child: Center( child: Center(
child: AppText( child: AppText(
patientLabResultList[index].resultValue ?? patientLabResultList[index].resultValue ??
"" + " " + "${patientLabResultList[index].uOM ?? ""}", "" +
" " +
"${patientLabResultList[index].uOM ?? ""}",
textAlign: TextAlign.center, textAlign: TextAlign.center,
isCopyable: true, isCopyable: true,
), ),

@ -1371,6 +1371,8 @@ class TranslationBase {
String get summeryReply => localizedValues['summeryReply'][locale.languageCode]; String get summeryReply => localizedValues['summeryReply'][locale.languageCode];
String get severityValidationError => localizedValues['severityValidationError'][locale.languageCode]; String get severityValidationError => localizedValues['severityValidationError'][locale.languageCode];
String get textCopiedSuccessfully => localizedValues['textCopiedSuccessfully'][locale.languageCode]; String get textCopiedSuccessfully => localizedValues['textCopiedSuccessfully'][locale.languageCode];
String get roomNo => localizedValues['roomNo'][locale.languageCode];
String get seeMore => localizedValues['seeMore'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -35,7 +35,6 @@ class PatientCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
width: SizeConfig.screenWidth * 0.9, width: SizeConfig.screenWidth * 0.9,
margin: EdgeInsets.all(6), margin: EdgeInsets.all(6),
@ -260,9 +259,9 @@ class PatientCard extends StatelessWidget {
patientInfo.fullName) patientInfo.fullName)
: (Helpers.capitalize( : (Helpers.capitalize(
patientInfo.firstName) + patientInfo.firstName) +
" " + " " +
Helpers.capitalize( Helpers.capitalize(
patientInfo.lastName)), patientInfo.lastName)),
fontSize: 16, fontSize: 16,
color: Color(0xff2e303a), color: Color(0xff2e303a),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -270,7 +269,6 @@ class PatientCard extends StatelessWidget {
textOverflow: TextOverflow.ellipsis, textOverflow: TextOverflow.ellipsis,
), ),
), ),
if (patientInfo.gender == 1) if (patientInfo.gender == 1)
Icon( Icon(
DoctorApp.male_2, DoctorApp.male_2,
@ -281,9 +279,10 @@ class PatientCard extends StatelessWidget {
DoctorApp.female_1, DoctorApp.female_1,
color: Colors.pink, color: Colors.pink,
), ),
if (isFromLiveCare)
if(isFromLiveCare) ShowTimer(
ShowTimer(patientInfo: patientInfo,), patientInfo: patientInfo,
),
]), ]),
), ),
Row( Row(
@ -351,79 +350,37 @@ class PatientCard extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( CustomRow(
child: RichText( label: TranslationBase.of(context).fileNumber,
text: new TextSpan( value: patientInfo.patientId.toString(),
style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context)
.fileNumber,
style: TextStyle(
fontSize: 12,
fontFamily: 'Poppins')),
new TextSpan(
text: patientInfo.patientId.toString(),
style: TextStyle(
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
fontSize: 13)),
],
),
),
), ),
//if (isInpatient) //if (isInpatient)
Container(
child: RichText( CustomRow(
text: new TextSpan( label: TranslationBase.of(context).age + " : ",
style: new TextStyle( value:
fontSize: 2.0 * SizeConfig.textMultiplier, "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}",
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).age +
" : ",
style: TextStyle(fontSize: 12)),
new TextSpan(
text:
"${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 13)),
],
),
),
), ),
if (isInpatient) if (isInpatient)
Container( CustomRow(
child: RichText( label: patientInfo.admissionDate == null
text: new TextSpan( ? ""
style: new TextStyle( : TranslationBase.of(context)
fontSize: .admissionDate +
2.0 * SizeConfig.textMultiplier, " : ",
color: Colors.black, value: patientInfo.admissionDate == null
fontFamily: 'Poppins', ? ""
), : "${AppDateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}",
children: <TextSpan>[ ),
new TextSpan( if (patientInfo.admissionDate != null)
text: patientInfo.admissionDate == null CustomRow(
? "" label: TranslationBase.of(context).numOfDays +
: TranslationBase.of(context) " : ",
.admissionDate + value:
" : ", "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}",
style: TextStyle(fontSize: 12)), ),
new TextSpan(
text: patientInfo.admissionDate == null
? ""
: "${AppDateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 13)),
]))),
if (patientInfo.admissionDate != null) if (patientInfo.admissionDate != null)
Container( Container(
child: RichText( child: RichText(
@ -437,12 +394,12 @@ class PatientCard extends StatelessWidget {
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of(context) text: TranslationBase.of(context)
.numOfDays + .roomNo +
" : ", " : ",
style: TextStyle(fontSize: 12)), style: TextStyle(fontSize: 12)),
new TextSpan( new TextSpan(
text: text:
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", "${patientInfo.roomId}",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 13)), fontSize: 13)),
@ -450,30 +407,11 @@ class PatientCard extends StatelessWidget {
if (isFromLiveCare) if (isFromLiveCare)
Column( Column(
children: [ children: [
Container(
child: RichText( CustomRow(label: TranslationBase.of(context)
text: new TextSpan( .clinic +
style: new TextStyle( " : ",
fontSize: 2.0 * SizeConfig.textMultiplier, value: patientInfo.clinicName,),
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text:
TranslationBase.of(context).clinic +
" : ",
style: TextStyle(fontSize: 12)),
new TextSpan(
text:
patientInfo.clinicName,
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 13)),
],
),
),
),
], ],
), ),
])) ]))
@ -522,14 +460,47 @@ class PatientCard extends StatelessWidget {
height: 25, height: 25,
width: 35, width: 35,
)), )),
]) ])
: SizedBox() : SizedBox()
], ],
), ),
onTap: onTap, onTap: onTap,
)), )),
)); ));
} }
}
class CustomRow extends StatelessWidget {
const CustomRow({
Key key,
this.label,
this.value,
}) : super(key: key);
} final String label;
final String value;
@override
Widget build(BuildContext context) {
return Row(
children: [
AppText(
label,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.8,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
SizedBox(
width: 1,
),
AppText(
value,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
isCopyable: true,
),
],
);
}
}

@ -71,14 +71,17 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
right: 5, right: 5,
bottom: 5, bottom: 5,
), ),
decoration: BoxDecoration(color: Colors.white, border: Border(bottom: BorderSide(color: Color(0xFFEFEFEF)))), decoration: BoxDecoration(
color: Colors.white,
border: Border(bottom: BorderSide(color: Color(0xFFEFEFEF)))),
child: Container( child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: SizeConfig.isHeightVeryShort ? 30 : 50), margin: EdgeInsets.only(top: SizeConfig.isHeightVeryShort ? 30 : 50),
child: Column( child: Column(
children: [ children: [
Container( Container(
padding: EdgeInsets.only(left: SizeConfig.isHeightVeryShort ? 0 : 12.0), padding: EdgeInsets.only(
left: SizeConfig.isHeightVeryShort ? 0 : 12.0),
child: Row(children: [ child: Row(children: [
IconButton( IconButton(
icon: Icon(Icons.arrow_back_ios), icon: Icon(Icons.arrow_back_ios),
@ -91,8 +94,11 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
Expanded( Expanded(
child: AppText( child: AppText(
patient.firstName != null patient.firstName != null
? (Helpers.capitalize(patient.firstName) + " " + Helpers.capitalize(patient.lastName)) ? (Helpers.capitalize(patient.firstName) +
: Helpers.capitalize(patient.fullName ?? patient.patientDetails.fullName), " " +
Helpers.capitalize(patient.lastName))
: Helpers.capitalize(patient.fullName ??
patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -125,7 +131,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
), ),
Row(children: [ Row(children: [
Padding( Padding(
padding: EdgeInsets.only(left: SizeConfig.isHeightVeryShort ? 0 : 12.0), padding: EdgeInsets.only(
left: SizeConfig.isHeightVeryShort ? 0 : 12.0),
child: Container( child: Container(
width: SizeConfig.getTextMultiplierBasedOnWidth() * 20, width: SizeConfig.getTextMultiplierBasedOnWidth() * 20,
height: SizeConfig.getTextMultiplierBasedOnWidth() * 20, height: SizeConfig.getTextMultiplierBasedOnWidth() * 20,
@ -153,19 +160,25 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
color: Colors.green, color: Colors.green,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.5,
) )
: AppText( : AppText(
TranslationBase.of(context).notArrived, TranslationBase.of(context).notArrived,
color: Colors.red[800], color: Colors.red[800],
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.5,
), ),
patient.startTime != null patient.startTime != null
? AppText(patient.startTime != null ? patient.startTime : '', ? AppText(patient.startTime != null ? patient.startTime : '',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.5,
color: Color(0xFF2E303A)) color: Color(0xFF2E303A))
: SizedBox() : SizedBox()
], ],
@ -179,7 +192,9 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
children: [ children: [
AppText( AppText(
TranslationBase.of(context).fileNumber, TranslationBase.of(context).fileNumber,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, fontSize:
SizeConfig.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF575757), color: Color(0xFF575757),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
@ -188,7 +203,9 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
), ),
AppText( AppText(
patient.patientId.toString(), patient.patientId.toString(),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, fontSize:
SizeConfig.getTextMultiplierBasedOnWidth() *
3.5,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
isCopyable: true, isCopyable: true,
@ -198,9 +215,14 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
Row( Row(
children: [ children: [
AppText( AppText(
patient.nationalityName ?? patient.nationality ?? patient.nationalityId ?? '', patient.nationalityName ??
patient.nationality ??
patient.nationalityId ??
'',
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, fontSize:
SizeConfig.getTextMultiplierBasedOnWidth() *
3.5,
), ),
patient.nationalityFlagURL != null patient.nationalityFlagURL != null
? ClipRRect( ? ClipRRect(
@ -209,7 +231,9 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
patient.nationalityFlagURL, patient.nationalityFlagURL,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { errorBuilder: (BuildContext context,
Object exception,
StackTrace stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -218,144 +242,52 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
) )
], ],
), ),
Container(
child: RichText( HeaderRow(
text: new TextSpan( label: TranslationBase.of(context).age + " : ",
style: new TextStyle( value:
fontSize: 1.6 * SizeConfig.textMultiplier, "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).age + " : ",
style: TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
)),
new TextSpan(
text:
"${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
color: Color(0xFF2E303A),
)),
],
),
),
), ),
if (patient.appointmentDate != null && patient.appointmentDate.isNotEmpty && !isFromLabResult) if (patient.appointmentDate != null &&
Row( patient.appointmentDate.isNotEmpty &&
mainAxisAlignment: MainAxisAlignment.start, !isFromLabResult)
children: <Widget>[ HeaderRow(
AppText( label:
TranslationBase.of(context).appointmentDate + " : ", TranslationBase.of(context).appointmentDate + " : ",
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, value: AppDateUtils.getDayMonthYearDateFormatted(
color: Color(0xFF575757), AppDateUtils.convertStringToDate(
fontWeight: FontWeight.w600, patient.appointmentDate)),
fontFamily: 'Poppins',
),
SizedBox(
width: 3.5,
),
AppText(
AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(patient.appointmentDate)),
fontWeight: FontWeight.w700,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
color: Color(0xFF2E303A),
),
SizedBox(
height: 0.5,
)
],
), ),
if (isFromLabResult) if (isFromLabResult)
Container( HeaderRow(
child: RichText( label: "Result Date: ",
text: new TextSpan( value:
style: new TextStyle( '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',
fontSize: 1.6 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: "Result Date: ",
style: TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
)),
new TextSpan(
text:
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 12)),
],
),
),
), ),
// if(isInpatient) // if(isInpatient)
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (patient.admissionDate != null && patient.admissionDate.isNotEmpty) if (patient.admissionDate != null &&
Container( patient.admissionDate.isNotEmpty)
child: RichText( HeaderRow(
text: new TextSpan( label: patient.admissionDate == null
style: new TextStyle( ? ""
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, : TranslationBase.of(context).admissionDate +
fontWeight: FontWeight.w600, " : ",
color: Color(0xFF575757), value: patient.admissionDate == null
fontFamily: 'Poppins', ? ""
), : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate.toString())))}",
children: <TextSpan>[
new TextSpan(
text: patient.admissionDate == null
? ""
: TranslationBase.of(context).admissionDate + " : ",
style: TextStyle(fontSize: 10)),
new TextSpan(
text: patient.admissionDate == null
? ""
: "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate.toString())))}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
color: Color(0xFF2E303A),
)),
]))),
if (patient.admissionDate != null)
Row(
children: [
AppText(
"${TranslationBase.of(context).numOfDays}: ",
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
isCopyable: true,
),
if (isDischargedPatient && patient.dischargeDate != null)
AppText(
"${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}",
fontWeight: FontWeight.w700,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
color: Color(0xFF2E303A),
)
else
AppText(
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}",
fontWeight: FontWeight.w700,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
color: Color(0xFF2E303A),
isCopyable: true,
),
],
), ),
if (patient.admissionDate != null)
HeaderRow(
label: "${TranslationBase.of(context).numOfDays}: ",
value: isDischargedPatient &&
patient.dischargeDate != null
? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}"
: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}",
)
], ],
), ),
], ],
@ -374,7 +306,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border( border: Border(
bottom: BorderSide(color: Colors.grey[400], width: 2.5), bottom:
BorderSide(color: Colors.grey[400], width: 2.5),
left: BorderSide(color: Colors.grey[400], width: 2.5), left: BorderSide(color: Colors.grey[400], width: 2.5),
)), )),
), ),
@ -397,100 +330,56 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
flex: 5, flex: 5,
child: Container( child: Container(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ child: Column(
AppText( crossAxisAlignment: CrossAxisAlignment.start,
'${TranslationBase.of(context).dr}$doctorName', children: <Widget>[
color: Color(0xFF2E303A), AppText(
fontWeight: FontWeight.w700, '${TranslationBase.of(context).dr}$doctorName',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, color: Color(0xFF2E303A),
), fontWeight: FontWeight.w700,
if (orderNo != null && !isPrescriptions) fontSize: SizeConfig
Row( .getTextMultiplierBasedOnWidth() *
children: <Widget>[ 3.5,
AppText( isCopyable: true,
'Order No: ', ),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, if (orderNo != null && !isPrescriptions)
fontWeight: FontWeight.w600, HeaderRow(
color: Color(0xFF575757), label: 'Order No: ',
value: orderNo ?? '',
), ),
AppText(orderNo ?? '', fontSize: 12) if (invoiceNO != null && !isPrescriptions)
], HeaderRow(
), label: 'Invoice: ',
if (invoiceNO != null && !isPrescriptions) value: invoiceNO ?? "",
Row(
children: <Widget>[
AppText(
'Invoice: ',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
), ),
AppText(invoiceNO ?? "", fontSize: 12) if (branch != null)
], HeaderRow(
), label: 'Branch: ',
if (branch != null) value: branch ?? '',
Row(
children: [
AppText(
'Branch: ',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
), ),
AppText(branch ?? '', fontSize: 12) if (clinic != null)
], HeaderRow(
), label: 'Clinic: ',
if (clinic != null) value: clinic ?? '',
Row(
children: [
AppText(
'Clinic: ',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
), ),
AppText(clinic ?? '', fontSize: 12) if (isMedicalFile && episode != null)
], HeaderRow(
), label: 'Episode: ',
if (isMedicalFile && episode != null) value: episode ?? '',
Row(
children: [
AppText(
'Episode: ',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
), ),
AppText(episode ?? '', fontSize: 12) if (isMedicalFile && visitDate != null)
], HeaderRow(
), label: 'Visit Date: ',
if (isMedicalFile && visitDate != null) value: visitDate ?? '',
Row(
children: [
AppText(
'Visit Date: ',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
), ),
AppText(visitDate ?? '', fontSize: 12) if (!isMedicalFile)
], HeaderRow(
label: !isPrescriptions
? 'Result Date:'
: 'Prescriptions Date ',
value:
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',
), ),
if (!isMedicalFile)
Row(
children: <Widget>[
AppText(
!isPrescriptions ? 'Result Date:' : 'Prescriptions Date ',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
),
AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
)
],
)
]), ]),
), ),
), ),
@ -518,6 +407,39 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
? 137 ? 137
: SizeConfig.isHeightShort : SizeConfig.isHeightShort
? 190 ? 190
: SizeConfig.heightMultiplier * (SizeConfig.isWidthLarge ? 25 : 20) : SizeConfig.heightMultiplier *
(SizeConfig.isWidthLarge ? 25 : 20)
: height); : height);
} }
class HeaderRow extends StatelessWidget {
final String label;
final String value;
const HeaderRow({Key key, this.label, this.value}) : super(key: key);
@override
Widget build(BuildContext context) {
return Row(
children: [
AppText(
label,
isCopyable: true,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
SizedBox(
width: 1,
),
AppText(
value,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
isCopyable: true,
),
],
);
}
}

@ -7,13 +7,15 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with PreferredSizeWidget { class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
with PreferredSizeWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
final String patientType; final String patientType;
final String arrivalType; final String arrivalType;
@ -24,7 +26,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
final Stream<String> videoCallDurationStream; final Stream<String> videoCallDurationStream;
PatientProfileHeaderNewDesignAppBar(this.patient, this.patientType, this.arrivalType, PatientProfileHeaderNewDesignAppBar(
this.patient, this.patientType, this.arrivalType,
{this.height = 0.0, {this.height = 0.0,
this.isInpatient = false, this.isInpatient = false,
this.isDischargedPatient = false, this.isDischargedPatient = false,
@ -69,8 +72,11 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
Expanded( Expanded(
child: AppText( child: AppText(
patient.firstName != null patient.firstName != null
? (Helpers.capitalize(patient.firstName) + " " + Helpers.capitalize(patient.lastName)) ? (Helpers.capitalize(patient.firstName) +
: Helpers.capitalize(patient.fullName ?? patient.patientDetails.fullName), " " +
Helpers.capitalize(patient.lastName))
: Helpers.capitalize(patient.fullName ??
patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -103,13 +109,17 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
), ),
StreamBuilder( StreamBuilder(
stream: videoCallDurationStream, stream: videoCallDurationStream,
builder: (BuildContext context, AsyncSnapshot<String> snapshot) { builder:
(BuildContext context, AsyncSnapshot<String> snapshot) {
if (snapshot.hasData && snapshot.data != null) if (snapshot.hasData && snapshot.data != null)
return InkWell( return InkWell(
onTap: () {}, onTap: () {},
child: Container( child: Container(
decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.circular(20)), decoration: BoxDecoration(
padding: EdgeInsets.symmetric(vertical: 2, horizontal: 10), color: Colors.red,
borderRadius: BorderRadius.circular(20)),
padding:
EdgeInsets.symmetric(vertical: 2, horizontal: 10),
child: Text( child: Text(
snapshot.data, snapshot.data,
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
@ -129,7 +139,9 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
width: 60, width: 60,
height: 60, height: 60,
child: Image.asset( child: Image.asset(
gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
@ -141,7 +153,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SERVICES_PATIANT2[int.parse(patientType)] == "patientArrivalList" SERVICES_PATIANT2[int.parse(patientType)] ==
"patientArrivalList"
? Container( ? Container(
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -163,14 +176,18 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
), ),
arrivalType == '1' || patient.arrivedOn == null arrivalType == '1' || patient.arrivedOn == null
? AppText( ? AppText(
patient.startTime != null ? patient.startTime : '', patient.startTime != null
? patient.startTime
: '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
) )
: AppText( : AppText(
patient.arrivedOn != null patient.arrivedOn != null
? AppDateUtils.convertStringToDateFormat( ? AppDateUtils
patient.arrivedOn, 'MM-dd-yyyy HH:mm') .convertStringToDateFormat(
patient.arrivedOn,
'MM-dd-yyyy HH:mm')
: '', : '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -178,13 +195,16 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
], ],
)) ))
: SizedBox(), : SizedBox(),
if (SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient" && !isFromLiveCare) if (SERVICES_PATIANT2[int.parse(patientType)] ==
"List_MyOutPatient" &&
!isFromLiveCare)
Container( Container(
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
TranslationBase.of(context).appointmentDate + " : ", TranslationBase.of(context).appointmentDate +
" : ",
fontSize: 14, fontSize: 14,
), ),
patient.startTime != null patient.startTime != null
@ -209,7 +229,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
), ),
Container( Container(
child: AppText( child: AppText(
convertDateFormat2(patient.appointmentDate ?? ''), convertDateFormat2(
patient.appointmentDate ?? ''),
fontSize: 1.5 * SizeConfig.textMultiplier, fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@ -226,23 +247,17 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
RichText( HeaderRow(
text: TextSpan( label: TranslationBase.of(context).fileNumber,
style: TextStyle(fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black), value: patient.patientId.toString(),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).fileNumber,
style: TextStyle(fontSize: 12, fontFamily: 'Poppins')),
new TextSpan(
text: patient.patientId.toString(),
style: TextStyle(fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 14)),
],
),
), ),
Row( Row(
children: [ children: [
AppText( AppText(
patient.nationalityName ?? patient.nationality ?? patient.nationalityId ?? '', patient.nationalityName ??
patient.nationality ??
patient.nationalityId ??
'',
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
@ -253,7 +268,9 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
patient.nationalityFlagURL, patient.nationalityFlagURL,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { errorBuilder: (BuildContext context,
Object exception,
StackTrace stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -262,67 +279,31 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
) )
], ],
), ),
Container( HeaderRow(
child: RichText( label: TranslationBase.of(context).age + " : ",
text: new TextSpan( value:
style: new TextStyle( "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
fontSize: 1.6 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(text: TranslationBase.of(context).age + " : ", style: TextStyle(fontSize: 14)),
new TextSpan(
text:
"${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 14)),
],
),
),
), ),
if (isInpatient) if (isInpatient)
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( HeaderRow(
child: RichText( label: patient.admissionDate == null
text: new TextSpan( ? ""
style: new TextStyle( : TranslationBase.of(context).admissionDate +
fontSize: 2.0 * SizeConfig.textMultiplier, " : ",
color: Colors.black, value: patient.admissionDate == null
fontFamily: 'Poppins', ? ""
), : "${AppDateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}"),
children: <TextSpan>[
new TextSpan(
text: patient.admissionDate == null
? ""
: TranslationBase.of(context).admissionDate + " : ",
style: TextStyle(fontSize: 14)),
new TextSpan(
text: patient.admissionDate == null
? ""
: "${AppDateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}",
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 15)),
]))),
if (patient.admissionDate != null) if (patient.admissionDate != null)
Row( HeaderRow(
children: [ label: "${TranslationBase.of(context).numOfDays}: ",
AppText( value: isDischargedPatient &&
"${TranslationBase.of(context).numOfDays}: ", patient.dischargeDate != null
fontSize: 15, ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}"
), : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}",
if (isDischargedPatient && patient.dischargeDate != null) )
AppText(
"${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}",
fontSize: 15,
fontWeight: FontWeight.w700)
else
AppText(
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}",
fontSize: 15,
fontWeight: FontWeight.w700),
],
),
], ],
) )
], ],
@ -344,7 +325,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
final startIndex = str.indexOf(start); final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length); final endIndex = str.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(str.substring(startIndex + start.length, endIndex))); var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
newDate = date.year.toString() + newDate = date.year.toString() +
"/" + "/" +
date.month.toString().padLeft(2, '0') + date.month.toString().padLeft(2, '0') +
@ -357,7 +339,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred
isToday(date) { isToday(date) {
DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date);
return DateFormat("yyyy-MM-dd").format(tempDate) == DateFormat("yyyy-MM-dd").format(DateTime.now()); return DateFormat("yyyy-MM-dd").format(tempDate) ==
DateFormat("yyyy-MM-dd").format(DateTime.now());
} }
myBoxDecoration() { myBoxDecoration() {

@ -664,7 +664,7 @@ packages:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.4" version: "1.3.0-nullsafety.3"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -956,7 +956,7 @@ packages:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.2" version: "1.10.0-nullsafety.1"
sticky_headers: sticky_headers:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1154,5 +1154,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.10.0 <=2.11.0-213.1.beta" dart: ">=2.10.0 <2.11.0"
flutter: ">=1.22.0 <2.0.0" flutter: ">=1.22.0 <2.0.0"

Loading…
Cancel
Save