Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into get_pending_orders
commit
ff1cffc24d
@ -0,0 +1,4 @@
|
||||
enum CalenderType{
|
||||
Gregorian,
|
||||
Hijri,
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
||||
import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryReqModel.dart';
|
||||
import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.dart';
|
||||
import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart';
|
||||
import 'package:doctor_app_flutter/models/operation_report/get_operation_details_request_modle.dart';
|
||||
import 'package:doctor_app_flutter/models/operation_report/get_operation_details_response_modle.dart';
|
||||
import 'package:doctor_app_flutter/models/operation_report/get_reservations_response_model.dart';
|
||||
import 'package:doctor_app_flutter/models/operation_report/get_reservations_request_model.dart';
|
||||
|
||||
class DischargeSummaryService extends BaseService {
|
||||
List<GetDischargeSummaryResModel> _pendingDischargeSummaryList = [];
|
||||
List<GetDischargeSummaryResModel> get pendingDischargeSummaryList => _pendingDischargeSummaryList;
|
||||
|
||||
Future getPendingDischargeSummary(
|
||||
{GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async {
|
||||
|
||||
hasError = false;
|
||||
await baseAppClient.post(GET_PENDING_DISCHARGE_SUMMARY,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
_pendingDischargeSummaryList.clear();
|
||||
response['List_PendingDischargeSummary'].forEach(
|
||||
(v) {
|
||||
_pendingDischargeSummaryList.add(GetDischargeSummaryResModel.fromJson(v));
|
||||
},
|
||||
);
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: getDischargeSummaryReqModel.toJson());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||
import 'package:doctor_app_flutter/core/service/patient/profile/discharge_summary_servive.dart';
|
||||
import 'package:doctor_app_flutter/core/service/patient/profile/operation_report_servive.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
|
||||
import 'package:doctor_app_flutter/locator.dart';
|
||||
import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryReqModel.dart';
|
||||
import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.dart';
|
||||
|
||||
class DischargeSummaryViewModel extends BaseViewModel {
|
||||
bool hasError = false;
|
||||
DischargeSummaryService _dischargeSummaryService =
|
||||
locator<DischargeSummaryService>();
|
||||
|
||||
List<GetDischargeSummaryResModel> get pendingDischargeSummaryList =>
|
||||
_dischargeSummaryService.pendingDischargeSummaryList;
|
||||
|
||||
|
||||
Future getPendingDischargeSummary({int patientId, int admissionNo, }) async {
|
||||
GetDischargeSummaryReqModel getDischargeSummaryReqModel = GetDischargeSummaryReqModel(admissionNo:admissionNo,patientID: patientId );
|
||||
hasError = false;
|
||||
setState(ViewState.Busy);
|
||||
await _dischargeSummaryService.getPendingDischargeSummary(getDischargeSummaryReqModel: getDischargeSummaryReqModel);
|
||||
if (_dischargeSummaryService.hasError) {
|
||||
error = _dischargeSummaryService.error;
|
||||
setState(ViewState.ErrorLocal);
|
||||
} else {
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||
import 'package:doctor_app_flutter/core/service/operation_report_servive.dart';
|
||||
import 'package:doctor_app_flutter/core/service/patient/profile/operation_report_servive.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
|
||||
import 'package:doctor_app_flutter/locator.dart';
|
||||
import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart';
|
||||
@ -0,0 +1,27 @@
|
||||
class GetDischargeSummaryReqModel {
|
||||
int patientID;
|
||||
int admissionNo;
|
||||
int patientType;
|
||||
int patientTypeID;
|
||||
|
||||
GetDischargeSummaryReqModel(
|
||||
{this.patientID, this.admissionNo, this.patientType = 1, this.patientTypeID=1});
|
||||
|
||||
GetDischargeSummaryReqModel.fromJson(Map<String, dynamic> json) {
|
||||
patientID = json['PatientID'];
|
||||
admissionNo = json['AdmissionNo'];
|
||||
patientType = json['PatientType'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['PatientID'] = this.patientID;
|
||||
data['AdmissionNo'] = this.admissionNo;
|
||||
data['PatientType'] = this.patientType;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
data['SetupID'] = "010266";
|
||||
data['isDentalAllowedBackend'] = false;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,192 @@
|
||||
class GetDischargeSummaryResModel {
|
||||
String setupID;
|
||||
int projectID;
|
||||
int dischargeNo;
|
||||
String dischargeDate;
|
||||
int admissionNo;
|
||||
int assessmentNo;
|
||||
int patientType;
|
||||
int patientID;
|
||||
int clinicID;
|
||||
int doctorID;
|
||||
String finalDiagnosis;
|
||||
String persentation;
|
||||
String pastHistory;
|
||||
String planOfCare;
|
||||
String investigations;
|
||||
String followupPlan;
|
||||
String conditionOnDischarge;
|
||||
String significantFindings;
|
||||
String planedProcedure;
|
||||
int daysStayed;
|
||||
String remarks;
|
||||
String eRCare;
|
||||
int status;
|
||||
bool isActive;
|
||||
int createdBy;
|
||||
String createdOn;
|
||||
int editedBy;
|
||||
String editedOn;
|
||||
bool isPatientDied;
|
||||
Null isMedicineApproved;
|
||||
Null isOpenBillDischarge;
|
||||
Null activatedDate;
|
||||
Null activatedBy;
|
||||
Null lAMA;
|
||||
Null patientCodition;
|
||||
Null others;
|
||||
Null reconciliationInstruction;
|
||||
String dischargeInstructions;
|
||||
String reason;
|
||||
Null dischargeDisposition;
|
||||
Null hospitalID;
|
||||
String createdByName;
|
||||
Null createdByNameN;
|
||||
String editedByName;
|
||||
Null editedByNameN;
|
||||
|
||||
GetDischargeSummaryResModel(
|
||||
{this.setupID,
|
||||
this.projectID,
|
||||
this.dischargeNo,
|
||||
this.dischargeDate,
|
||||
this.admissionNo,
|
||||
this.assessmentNo,
|
||||
this.patientType,
|
||||
this.patientID,
|
||||
this.clinicID,
|
||||
this.doctorID,
|
||||
this.finalDiagnosis,
|
||||
this.persentation,
|
||||
this.pastHistory,
|
||||
this.planOfCare,
|
||||
this.investigations,
|
||||
this.followupPlan,
|
||||
this.conditionOnDischarge,
|
||||
this.significantFindings,
|
||||
this.planedProcedure,
|
||||
this.daysStayed,
|
||||
this.remarks,
|
||||
this.eRCare,
|
||||
this.status,
|
||||
this.isActive,
|
||||
this.createdBy,
|
||||
this.createdOn,
|
||||
this.editedBy,
|
||||
this.editedOn,
|
||||
this.isPatientDied,
|
||||
this.isMedicineApproved,
|
||||
this.isOpenBillDischarge,
|
||||
this.activatedDate,
|
||||
this.activatedBy,
|
||||
this.lAMA,
|
||||
this.patientCodition,
|
||||
this.others,
|
||||
this.reconciliationInstruction,
|
||||
this.dischargeInstructions,
|
||||
this.reason,
|
||||
this.dischargeDisposition,
|
||||
this.hospitalID,
|
||||
this.createdByName,
|
||||
this.createdByNameN,
|
||||
this.editedByName,
|
||||
this.editedByNameN});
|
||||
|
||||
GetDischargeSummaryResModel.fromJson(Map<String, dynamic> json) {
|
||||
setupID = json['SetupID'];
|
||||
projectID = json['ProjectID'];
|
||||
dischargeNo = json['DischargeNo'];
|
||||
dischargeDate = json['DischargeDate'];
|
||||
admissionNo = json['AdmissionNo'];
|
||||
assessmentNo = json['AssessmentNo'];
|
||||
patientType = json['PatientType'];
|
||||
patientID = json['PatientID'];
|
||||
clinicID = json['ClinicID'];
|
||||
doctorID = json['DoctorID'];
|
||||
finalDiagnosis = json['FinalDiagnosis'];
|
||||
persentation = json['Persentation'];
|
||||
pastHistory = json['PastHistory'];
|
||||
planOfCare = json['PlanOfCare'];
|
||||
investigations = json['Investigations'];
|
||||
followupPlan = json['FollowupPlan'];
|
||||
conditionOnDischarge = json['ConditionOnDischarge'];
|
||||
significantFindings = json['SignificantFindings'];
|
||||
planedProcedure = json['PlanedProcedure'];
|
||||
daysStayed = json['DaysStayed'];
|
||||
remarks = json['Remarks'];
|
||||
eRCare = json['ERCare'];
|
||||
status = json['Status'];
|
||||
isActive = json['IsActive'];
|
||||
createdBy = json['CreatedBy'];
|
||||
createdOn = json['CreatedOn'];
|
||||
editedBy = json['EditedBy'];
|
||||
editedOn = json['EditedOn'];
|
||||
isPatientDied = json['IsPatientDied'];
|
||||
isMedicineApproved = json['IsMedicineApproved'];
|
||||
isOpenBillDischarge = json['IsOpenBillDischarge'];
|
||||
activatedDate = json['ActivatedDate'];
|
||||
activatedBy = json['ActivatedBy'];
|
||||
lAMA = json['LAMA'];
|
||||
patientCodition = json['PatientCodition'];
|
||||
others = json['Others'];
|
||||
reconciliationInstruction = json['ReconciliationInstruction'];
|
||||
dischargeInstructions = json['DischargeInstructions'];
|
||||
reason = json['Reason'];
|
||||
dischargeDisposition = json['DischargeDisposition'];
|
||||
hospitalID = json['HospitalID'];
|
||||
createdByName = json['CreatedByName'];
|
||||
createdByNameN = json['CreatedByNameN'];
|
||||
editedByName = json['EditedByName'];
|
||||
editedByNameN = json['EditedByNameN'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['SetupID'] = this.setupID;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['DischargeNo'] = this.dischargeNo;
|
||||
data['DischargeDate'] = this.dischargeDate;
|
||||
data['AdmissionNo'] = this.admissionNo;
|
||||
data['AssessmentNo'] = this.assessmentNo;
|
||||
data['PatientType'] = this.patientType;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['ClinicID'] = this.clinicID;
|
||||
data['DoctorID'] = this.doctorID;
|
||||
data['FinalDiagnosis'] = this.finalDiagnosis;
|
||||
data['Persentation'] = this.persentation;
|
||||
data['PastHistory'] = this.pastHistory;
|
||||
data['PlanOfCare'] = this.planOfCare;
|
||||
data['Investigations'] = this.investigations;
|
||||
data['FollowupPlan'] = this.followupPlan;
|
||||
data['ConditionOnDischarge'] = this.conditionOnDischarge;
|
||||
data['SignificantFindings'] = this.significantFindings;
|
||||
data['PlanedProcedure'] = this.planedProcedure;
|
||||
data['DaysStayed'] = this.daysStayed;
|
||||
data['Remarks'] = this.remarks;
|
||||
data['ERCare'] = this.eRCare;
|
||||
data['Status'] = this.status;
|
||||
data['IsActive'] = this.isActive;
|
||||
data['CreatedBy'] = this.createdBy;
|
||||
data['CreatedOn'] = this.createdOn;
|
||||
data['EditedBy'] = this.editedBy;
|
||||
data['EditedOn'] = this.editedOn;
|
||||
data['IsPatientDied'] = this.isPatientDied;
|
||||
data['IsMedicineApproved'] = this.isMedicineApproved;
|
||||
data['IsOpenBillDischarge'] = this.isOpenBillDischarge;
|
||||
data['ActivatedDate'] = this.activatedDate;
|
||||
data['ActivatedBy'] = this.activatedBy;
|
||||
data['LAMA'] = this.lAMA;
|
||||
data['PatientCodition'] = this.patientCodition;
|
||||
data['Others'] = this.others;
|
||||
data['ReconciliationInstruction'] = this.reconciliationInstruction;
|
||||
data['DischargeInstructions'] = this.dischargeInstructions;
|
||||
data['Reason'] = this.reason;
|
||||
data['DischargeDisposition'] = this.dischargeDisposition;
|
||||
data['HospitalID'] = this.hospitalID;
|
||||
data['CreatedByName'] = this.createdByName;
|
||||
data['CreatedByNameN'] = this.createdByNameN;
|
||||
data['EditedByName'] = this.editedByName;
|
||||
data['EditedByNameN'] = this.editedByNameN;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
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/profile/discharge_summary_view_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/screens/doctor/doctor_replay/doctor_reply_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/error_message.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'discharge_Summary_widget.dart';
|
||||
|
||||
|
||||
class AllDischargeSummary extends StatefulWidget {
|
||||
final Function changeCurrentTab;
|
||||
|
||||
const AllDischargeSummary({Key key, this.changeCurrentTab}) : super(key: key);
|
||||
|
||||
@override
|
||||
_AllDischargeSummaryState createState() => _AllDischargeSummaryState();
|
||||
}
|
||||
|
||||
class _AllDischargeSummaryState extends State<AllDischargeSummary> {
|
||||
|
||||
int pageIndex = 1;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<DischargeSummaryViewModel>(
|
||||
onModelReady: (model) {
|
||||
model.getPendingDischargeSummary();
|
||||
},
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
baseViewModel: model,
|
||||
isShowAppBar: false,
|
||||
body: model.pendingDischargeSummaryList.isEmpty
|
||||
?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem)
|
||||
: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.vertical,
|
||||
itemCount: model.pendingDischargeSummaryList.length,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (BuildContext ctxt, int index) {
|
||||
return Column(
|
||||
children: [
|
||||
InkWell(
|
||||
child: DischargeSummaryWidget(
|
||||
dischargeSummary: model
|
||||
.pendingDischargeSummaryList[index]),
|
||||
),
|
||||
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,171 @@
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
|
||||
import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.dart';
|
||||
import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart';
|
||||
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||
import 'package:doctor_app_flutter/util/helpers.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class DischargeSummaryWidget extends StatefulWidget {
|
||||
final GetDischargeSummaryResModel dischargeSummary;
|
||||
bool isShowMore = false;
|
||||
|
||||
DischargeSummaryWidget({Key key, this.dischargeSummary});
|
||||
|
||||
@override
|
||||
_DischargeSummaryWidgetState createState() => _DischargeSummaryWidgetState();
|
||||
}
|
||||
|
||||
class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
|
||||
return Container(
|
||||
child: CardWithBgWidget(
|
||||
bgColor:Colors.transparent,
|
||||
hasBorder: false,
|
||||
widget: Container(
|
||||
child: InkWell(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
AppText(
|
||||
AppDateUtils.getDateTimeFromServerFormat(
|
||||
widget.dischargeSummary.createdOn)
|
||||
.day
|
||||
.toString() +
|
||||
" " +
|
||||
AppDateUtils.getMonth(
|
||||
AppDateUtils.getDateTimeFromServerFormat(
|
||||
widget.dischargeSummary.createdOn)
|
||||
.month)
|
||||
.toString()
|
||||
.substring(0, 3) +
|
||||
' ' +
|
||||
AppDateUtils.getDateTimeFromServerFormat(
|
||||
widget.dischargeSummary.createdOn)
|
||||
.year
|
||||
.toString(),
|
||||
fontFamily: 'Poppins',
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
AppText(
|
||||
AppDateUtils.getDateTimeFromServerFormat(
|
||||
widget.dischargeSummary.createdOn)
|
||||
.hour
|
||||
.toString() +
|
||||
":" +
|
||||
AppDateUtils.getDateTimeFromServerFormat(
|
||||
widget.dischargeSummary.createdOn)
|
||||
.minute
|
||||
.toString(),
|
||||
fontFamily: 'Poppins',
|
||||
fontWeight: FontWeight.w600,
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// SizedBox(height: 10,),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
CustomRow(
|
||||
label: TranslationBase.of(context).fileNumber,
|
||||
value: widget.dischargeSummary.patientID.toString(),
|
||||
isCopyable:false,
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.5,
|
||||
child: RichText(
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
text: new TextSpan(
|
||||
style: new TextStyle(
|
||||
fontSize: 1.3 * SizeConfig.textMultiplier,
|
||||
color: Color(0xFF575757)),
|
||||
children: <TextSpan>[
|
||||
new TextSpan(
|
||||
text:
|
||||
TranslationBase.of(context).requestType +
|
||||
": ",
|
||||
style: TextStyle(
|
||||
fontSize: SizeConfig
|
||||
.getTextMultiplierBasedOnWidth() *
|
||||
2.8,
|
||||
color: Color(0xFF575757),
|
||||
//TranslationBase.of(context).doctorResponse + " : ",
|
||||
)),
|
||||
new TextSpan(
|
||||
text:
|
||||
"${widget.dischargeSummary.dischargeInstructions}",
|
||||
style: TextStyle(
|
||||
fontFamily: 'Poppins',
|
||||
fontSize: SizeConfig
|
||||
.getTextMultiplierBasedOnWidth() *
|
||||
3,
|
||||
color: Color(0xFF2E303A),
|
||||
fontWeight: FontWeight.w700,
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
// Container(
|
||||
// alignment: projectViewModel.isArabic?Alignment.centerLeft:Alignment.centerRight,
|
||||
// child: Icon(FontAwesomeIcons.arrowRight,
|
||||
// size: 20, color: Colors.black),)
|
||||
],
|
||||
),
|
||||
// onTap: onTap,
|
||||
)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,187 @@
|
||||
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/models/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/screens/doctor/doctor_replay/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/screens/doctor/doctor_replay/doctor_reply_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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/loader/gif_loader_dialog_utils.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'all_discharge_summary.dart';
|
||||
import 'pending_discharge_summary.dart';
|
||||
|
||||
class DischargeSummaryPage extends StatefulWidget {
|
||||
final Function changeCurrentTab;
|
||||
|
||||
const DischargeSummaryPage({Key key, this.changeCurrentTab}) : super(key: key);
|
||||
|
||||
@override
|
||||
_DoctorReplyScreenState createState() => _DoctorReplyScreenState();
|
||||
}
|
||||
|
||||
class _DoctorReplyScreenState extends State<DischargeSummaryPage>
|
||||
with SingleTickerProviderStateMixin {
|
||||
TabController _tabController;
|
||||
int _activeTab = 0;
|
||||
int pageIndex = 1;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_tabController = TabController(length: 2, vsync: this);
|
||||
_tabController.addListener(_handleTabSelection);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
_tabController.dispose();
|
||||
}
|
||||
|
||||
_handleTabSelection() {
|
||||
setState(() {
|
||||
_activeTab = _tabController.index;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final screenSize = MediaQuery.of(context).size;
|
||||
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||
PatiantInformtion patient = routeArgs['patient'];
|
||||
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
widget.changeCurrentTab();
|
||||
return false;
|
||||
},
|
||||
child: AppScaffold(
|
||||
appBarTitle: TranslationBase.of(context).replay2,
|
||||
isShowAppBar: true,
|
||||
// appBarTitle: TranslationBase.of(context).progressNote,
|
||||
appBar: PatientProfileAppBar(
|
||||
patient,
|
||||
isInpatient: true,
|
||||
),
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Scaffold(
|
||||
extendBodyBehindAppBar: false,
|
||||
appBar: PreferredSize(
|
||||
preferredSize: Size.fromHeight(
|
||||
MediaQuery.of(context).size.height * 0.070),
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.070,
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Theme.of(context).dividerColor,
|
||||
width: 0.5), //width: 0.7
|
||||
),
|
||||
color: Colors.white),
|
||||
child: Center(
|
||||
child: TabBar(
|
||||
isScrollable: false,
|
||||
controller: _tabController,
|
||||
indicatorColor: Colors.transparent,
|
||||
indicatorWeight: 1.0,
|
||||
indicatorSize: TabBarIndicatorSize.tab,
|
||||
labelColor: Theme.of(context).primaryColor,
|
||||
labelPadding: EdgeInsets.only(
|
||||
top: 0, left: 0, right: 0, bottom: 0),
|
||||
unselectedLabelColor: Colors.grey[800],
|
||||
tabs: [
|
||||
tabWidget(
|
||||
screenSize,
|
||||
_activeTab == 0,
|
||||
"Pending",
|
||||
),
|
||||
tabWidget(
|
||||
screenSize,
|
||||
_activeTab == 1,
|
||||
TranslationBase.of(context).all,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
controller: _tabController,
|
||||
children: [
|
||||
PendingDischargeSummary(patient:patient ,),
|
||||
AllDischargeSummary(),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget tabWidget(Size screenSize, bool isActive, String title,
|
||||
{int counter = -1}) {
|
||||
return Center(
|
||||
child: Container(
|
||||
height: screenSize.height * 0.070,
|
||||
decoration: TextFieldsUtils.containerBorderDecoration(
|
||||
isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA),
|
||||
isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
|
||||
borderRadius: 4,
|
||||
borderWidth: 0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
AppText(
|
||||
title,
|
||||
fontSize: SizeConfig.textMultiplier * 1.5,
|
||||
color: isActive ? Colors.white : Color(0xFF2B353E),
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
if (counter != -1)
|
||||
Container(
|
||||
margin: EdgeInsets.all(4),
|
||||
width: 15,
|
||||
height: 15,
|
||||
decoration: BoxDecoration(
|
||||
color: isActive ? Colors.white : Color(0xFFD02127),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Center(
|
||||
child: FittedBox(
|
||||
child: AppText(
|
||||
"$counter",
|
||||
fontSize: SizeConfig.textMultiplier * 1.5,
|
||||
color: !isActive ? Colors.white : Color(0xFFD02127),
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
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/profile/discharge_summary_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/screens/doctor/doctor_replay/doctor_reply_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/error_message.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'discharge_Summary_widget.dart';
|
||||
|
||||
class PendingDischargeSummary extends StatefulWidget {
|
||||
final Function changeCurrentTab;
|
||||
final PatiantInformtion patient;
|
||||
|
||||
const PendingDischargeSummary({Key key, this.changeCurrentTab, this.patient})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_PendingDischargeSummaryState createState() =>
|
||||
_PendingDischargeSummaryState();
|
||||
}
|
||||
|
||||
class _PendingDischargeSummaryState extends State<PendingDischargeSummary> {
|
||||
int pageIndex = 1;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<DischargeSummaryViewModel>(
|
||||
onModelReady: (model) {
|
||||
model.getPendingDischargeSummary(
|
||||
patientId: widget.patient.patientId,
|
||||
admissionNo: int.parse(widget.patient.admissionNo),
|
||||
|
||||
);
|
||||
},
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
baseViewModel: model,
|
||||
isShowAppBar: false,
|
||||
body: model.pendingDischargeSummaryList.isEmpty
|
||||
? ErrorMessage(
|
||||
error: TranslationBase.of(context)
|
||||
.noItem) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem)
|
||||
: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.vertical,
|
||||
itemCount: model.pendingDischargeSummaryList.length,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (BuildContext ctxt, int index) {
|
||||
return Column(
|
||||
children: [
|
||||
InkWell(
|
||||
child: DischargeSummaryWidget(
|
||||
dischargeSummary: model
|
||||
.pendingDischargeSummaryList[index]),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue