|
|
|
|
@ -1,24 +1,29 @@
|
|
|
|
|
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/pednding_orders_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/profile/vte_assessment_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/project_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/date-utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/dr_app_shared_pref.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/patients/profile/app_bar/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/card_with_bg_widget.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 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
class InterventionMedicationScreen extends StatefulWidget {
|
|
|
|
|
const InterventionMedicationScreen({Key key, this.patient}) : super(key: key);
|
|
|
|
|
final PatiantInformtion patient ;
|
|
|
|
|
import '../../../../core/viewModel/profile/intervention_medication_view_model.dart';
|
|
|
|
|
|
|
|
|
|
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
|
|
|
|
|
|
|
|
|
class InterventionMedicationScreen extends StatefulWidget {
|
|
|
|
|
final PatiantInformtion patient;
|
|
|
|
|
const InterventionMedicationScreen(this.patient, {Key key}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_InterventionMedicationScreenState createState() => _InterventionMedicationScreenState();
|
|
|
|
|
@ -26,27 +31,29 @@ class InterventionMedicationScreen extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
class _InterventionMedicationScreenState extends State<InterventionMedicationScreen> {
|
|
|
|
|
bool isDischargedPatient = false;
|
|
|
|
|
|
|
|
|
|
AuthenticationViewModel authenticationViewModel;
|
|
|
|
|
|
|
|
|
|
ProjectViewModel projectViewModel;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
authenticationViewModel = Provider.of(context);
|
|
|
|
|
projectViewModel = Provider.of(context);
|
|
|
|
|
return BaseView<PendingOrdersViewModel>(
|
|
|
|
|
|
|
|
|
|
return BaseView<InterventionMedicationViewModel>(
|
|
|
|
|
onModelReady: (model) => model.getInterventionMedication(patientId: widget.patient.patientId,
|
|
|
|
|
// admissionNo: 2016023498
|
|
|
|
|
|
|
|
|
|
admissionNo:int.parse(widget.patient.admissionNo)
|
|
|
|
|
),
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
//appBarTitle: TranslationBase.of(context).progressNote,
|
|
|
|
|
appBar: PatientProfileAppBar(
|
|
|
|
|
widget.patient,
|
|
|
|
|
isInpatient: true,
|
|
|
|
|
),
|
|
|
|
|
body: model.admissionOrderList == null ||
|
|
|
|
|
model.admissionOrderList.length == 0
|
|
|
|
|
body: model.allInterventionList == null ||
|
|
|
|
|
model.allInterventionList.length == 0
|
|
|
|
|
? Center(
|
|
|
|
|
child: ErrorMessage(
|
|
|
|
|
error: TranslationBase.of(context).noDataAvailable,
|
|
|
|
|
@ -56,42 +63,16 @@ class _InterventionMedicationScreenState extends State<InterventionMedicationScr
|
|
|
|
|
color: Colors.grey[200],
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.all(12.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).admission,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).orders,
|
|
|
|
|
fontSize: 30.0,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Container(
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
itemCount: model.admissionOrderList.length,
|
|
|
|
|
itemCount: model.allInterventionList.length,
|
|
|
|
|
itemBuilder: (BuildContext ctxt, int index) {
|
|
|
|
|
return FractionallySizedBox(
|
|
|
|
|
widthFactor: 0.95,
|
|
|
|
|
child: CardWithBgWidget(
|
|
|
|
|
hasBorder: false,
|
|
|
|
|
bgColor: Colors.white,
|
|
|
|
|
bgColor: Colors.transparent,
|
|
|
|
|
widget: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
@ -122,83 +103,13 @@ class _InterventionMedicationScreenState extends State<InterventionMedicationScr
|
|
|
|
|
.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.createdBy
|
|
|
|
|
.toString(),
|
|
|
|
|
fontSize: 13,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppText(
|
|
|
|
|
model
|
|
|
|
|
.admissionOrderList[
|
|
|
|
|
index]
|
|
|
|
|
.createdByName
|
|
|
|
|
.toString() ??
|
|
|
|
|
'',
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.w600,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
isCopyable: true,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.procedureName
|
|
|
|
|
.toString() +
|
|
|
|
|
": ",
|
|
|
|
|
fontSize: 13,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppText(
|
|
|
|
|
model
|
|
|
|
|
.admissionOrderList[
|
|
|
|
|
index]
|
|
|
|
|
.procedureName
|
|
|
|
|
.toString() ??
|
|
|
|
|
'',
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.w600,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
isCopyable: true,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.orderNo
|
|
|
|
|
.toString(),
|
|
|
|
|
fontSize: 13,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppText(
|
|
|
|
|
model
|
|
|
|
|
.admissionOrderList[
|
|
|
|
|
index]
|
|
|
|
|
.orderNo
|
|
|
|
|
.toString() ??
|
|
|
|
|
'',
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.w600,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
isCopyable: true,
|
|
|
|
|
),
|
|
|
|
|
model
|
|
|
|
|
.allInterventionList[
|
|
|
|
|
index].cS,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -206,74 +117,174 @@ class _InterventionMedicationScreenState extends State<InterventionMedicationScr
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
AppDateUtils.convertDateFormatImproved(
|
|
|
|
|
model
|
|
|
|
|
.allInterventionList[
|
|
|
|
|
index].startDatetime),
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
// Column(
|
|
|
|
|
// children: [
|
|
|
|
|
// AppText(
|
|
|
|
|
// model
|
|
|
|
|
// .allInterventionList[
|
|
|
|
|
// index]
|
|
|
|
|
// .startDatetime !=
|
|
|
|
|
// null
|
|
|
|
|
// ? AppDateUtils.getDayMonthYearDateFormatted(
|
|
|
|
|
// AppDateUtils
|
|
|
|
|
// .getDateTimeFromString(model
|
|
|
|
|
// .allInterventionList[
|
|
|
|
|
// index]
|
|
|
|
|
// .startDatetime),
|
|
|
|
|
// isArabic:
|
|
|
|
|
// projectViewModel
|
|
|
|
|
// .isArabic,
|
|
|
|
|
// isMonthShort: true)
|
|
|
|
|
// : AppDateUtils
|
|
|
|
|
// .getDayMonthYearDateFormatted(
|
|
|
|
|
// DateTime.now(),
|
|
|
|
|
// isArabic:
|
|
|
|
|
// projectViewModel
|
|
|
|
|
// .isArabic),
|
|
|
|
|
// fontWeight: FontWeight.w600,
|
|
|
|
|
// fontSize: 14,
|
|
|
|
|
// isCopyable: true,
|
|
|
|
|
// ),
|
|
|
|
|
// AppText(
|
|
|
|
|
// model
|
|
|
|
|
// .allInterventionList[
|
|
|
|
|
// index]
|
|
|
|
|
// .startDatetime !=
|
|
|
|
|
// null
|
|
|
|
|
// ? AppDateUtils.getHour(
|
|
|
|
|
// AppDateUtils
|
|
|
|
|
// .getDateTimeFromString(model
|
|
|
|
|
// .allInterventionList[
|
|
|
|
|
// index]
|
|
|
|
|
// .startDatetime))
|
|
|
|
|
// : AppDateUtils.getHour(
|
|
|
|
|
// DateTime.now()),
|
|
|
|
|
// fontWeight: FontWeight.w600,
|
|
|
|
|
// fontSize: 14,
|
|
|
|
|
// isCopyable: true,
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// crossAxisAlignment:
|
|
|
|
|
// CrossAxisAlignment.end,
|
|
|
|
|
// )
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
// AppText(
|
|
|
|
|
// TranslationBase.of(context)
|
|
|
|
|
// .VTE_Type +
|
|
|
|
|
// " : ",
|
|
|
|
|
// fontSize: 12,
|
|
|
|
|
// ),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppText(
|
|
|
|
|
model
|
|
|
|
|
.admissionOrderList[
|
|
|
|
|
.allInterventionList[
|
|
|
|
|
index]
|
|
|
|
|
.createdOn !=
|
|
|
|
|
null
|
|
|
|
|
? AppDateUtils.getDayMonthYearDateFormatted(
|
|
|
|
|
AppDateUtils
|
|
|
|
|
.getDateTimeFromServerFormat(model
|
|
|
|
|
.admissionOrderList[
|
|
|
|
|
index]
|
|
|
|
|
.createdOn),
|
|
|
|
|
isArabic:
|
|
|
|
|
projectViewModel
|
|
|
|
|
.isArabic,
|
|
|
|
|
isMonthShort: true)
|
|
|
|
|
: AppDateUtils
|
|
|
|
|
.getDayMonthYearDateFormatted(
|
|
|
|
|
DateTime.now(),
|
|
|
|
|
isArabic:
|
|
|
|
|
projectViewModel
|
|
|
|
|
.isArabic),
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
.description,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
isCopyable: true,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
// AppText(
|
|
|
|
|
// TranslationBase.of(context)
|
|
|
|
|
// .pharmacology +
|
|
|
|
|
// " : ",
|
|
|
|
|
// fontSize: 12,
|
|
|
|
|
// ),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppText(
|
|
|
|
|
model
|
|
|
|
|
.admissionOrderList[
|
|
|
|
|
.allInterventionList[
|
|
|
|
|
index]
|
|
|
|
|
.createdOn !=
|
|
|
|
|
null
|
|
|
|
|
? AppDateUtils.getHour(
|
|
|
|
|
AppDateUtils
|
|
|
|
|
.getDateTimeFromServerFormat(model
|
|
|
|
|
.admissionOrderList[
|
|
|
|
|
index]
|
|
|
|
|
.createdOn))
|
|
|
|
|
: AppDateUtils.getHour(
|
|
|
|
|
DateTime.now()),
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
.medication,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
isCopyable: true,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.end,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
// AppText(
|
|
|
|
|
// TranslationBase.of(context)
|
|
|
|
|
// .reasonsThrombo +
|
|
|
|
|
// " : ",
|
|
|
|
|
// fontSize: 12,
|
|
|
|
|
// ),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppText(
|
|
|
|
|
model
|
|
|
|
|
.allInterventionList[
|
|
|
|
|
index]
|
|
|
|
|
.doctorComments,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
isCopyable: true,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
),
|
|
|
|
|
// Row(
|
|
|
|
|
// mainAxisAlignment:
|
|
|
|
|
// MainAxisAlignment.start,
|
|
|
|
|
// children: [
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: AppText(
|
|
|
|
|
// model
|
|
|
|
|
// .admissionOrderList[
|
|
|
|
|
// index]
|
|
|
|
|
// .notes,
|
|
|
|
|
// fontSize: 10,
|
|
|
|
|
// isCopyable: true,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ])
|
|
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
// AppText(
|
|
|
|
|
// TranslationBase.of(context)
|
|
|
|
|
// .reasonsThrombo +
|
|
|
|
|
// " : ",
|
|
|
|
|
// fontSize: 12,
|
|
|
|
|
// ),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppText(
|
|
|
|
|
model
|
|
|
|
|
.allInterventionList[
|
|
|
|
|
index]
|
|
|
|
|
.statusDescription,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
isCopyable: true,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
|