|
|
|
|
@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/viewModel/authentication_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/screens/patients/profile/pharmacy-intervention-model/new_medication_res_model.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/dr_app_toast_msg.dart';
|
|
|
|
|
@ -24,7 +25,8 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
|
|
|
|
|
|
|
|
|
class InterventionMedicationHistoryScreen extends StatefulWidget {
|
|
|
|
|
final PatiantInformtion patient;
|
|
|
|
|
const InterventionMedicationHistoryScreen(this.patient, {Key key}) : super(key: key);
|
|
|
|
|
final InterventionMedicationResModel interventionMedication;
|
|
|
|
|
const InterventionMedicationHistoryScreen(this.patient, this.interventionMedication, {Key key}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_InterventionMedicationHistoryScreenState createState() => _InterventionMedicationHistoryScreenState();
|
|
|
|
|
@ -41,7 +43,12 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
|
|
|
|
|
projectViewModel = Provider.of(context);
|
|
|
|
|
|
|
|
|
|
return BaseView<InterventionMedicationViewModel>(
|
|
|
|
|
onModelReady: (model) => model.getInterventionMedicationHistory(patientId: widget.patient.patientId,
|
|
|
|
|
onModelReady: (model) => model.getInterventionMedicationHistory(
|
|
|
|
|
patientId: widget.patient.patientId,
|
|
|
|
|
projectId: widget.interventionMedication.projectID,
|
|
|
|
|
admissionNo: widget.interventionMedication.admissionNo,
|
|
|
|
|
prescriptionNo: widget.interventionMedication.prescriptionNo,
|
|
|
|
|
orderNo: widget.interventionMedication.orderNo,
|
|
|
|
|
),
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
@ -133,61 +140,10 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
|
|
|
|
|
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(
|
|
|
|
|
@ -197,12 +153,10 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
// AppText(
|
|
|
|
|
// TranslationBase.of(context)
|
|
|
|
|
// .VTE_Type +
|
|
|
|
|
// " : ",
|
|
|
|
|
// fontSize: 12,
|
|
|
|
|
// ),
|
|
|
|
|
AppText(
|
|
|
|
|
'Remark: ',
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppText(
|
|
|
|
|
model
|
|
|
|
|
@ -221,12 +175,10 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
// AppText(
|
|
|
|
|
// TranslationBase.of(context)
|
|
|
|
|
// .pharmacology +
|
|
|
|
|
// " : ",
|
|
|
|
|
// fontSize: 12,
|
|
|
|
|
// ),
|
|
|
|
|
AppText(
|
|
|
|
|
'Created By Name: ',
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppText(
|
|
|
|
|
model
|
|
|
|
|
@ -245,12 +197,10 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
// AppText(
|
|
|
|
|
// TranslationBase.of(context)
|
|
|
|
|
// .reasonsThrombo +
|
|
|
|
|
// " : ",
|
|
|
|
|
// fontSize: 12,
|
|
|
|
|
// ),
|
|
|
|
|
AppText(
|
|
|
|
|
'SetUp ID: ',
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppText(
|
|
|
|
|
model
|
|
|
|
|
@ -265,28 +215,6 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
// AppText(
|
|
|
|
|
// TranslationBase.of(context)
|
|
|
|
|
// .reasonsThrombo +
|
|
|
|
|
// " : ",
|
|
|
|
|
// fontSize: 12,
|
|
|
|
|
// ),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppText(
|
|
|
|
|
model
|
|
|
|
|
.allInterventionHistoryList[
|
|
|
|
|
index]
|
|
|
|
|
.setupId,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
isCopyable: true,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
@ -295,9 +223,16 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
|
|
|
|
|
children: [
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () async {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
|
|
|
|
|
await model.setAcceptedOrRejected(remarks: "Accepted", );
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
model.setAcceptedOrRejected(
|
|
|
|
|
remarks: "Accepted",
|
|
|
|
|
memberId: model.allInterventionHistoryList[index].commentedBy,
|
|
|
|
|
prescriptionNo: model.allInterventionHistoryList[index].prescriptionId,
|
|
|
|
|
patientID: model.allInterventionHistoryList[index].patientId,
|
|
|
|
|
orderNo: model.allInterventionHistoryList[index].orderNo,
|
|
|
|
|
admissionNo: model.allInterventionHistoryList[index].admissionNo,
|
|
|
|
|
);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if(model.state == ViewState.ErrorLocal) {
|
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
|
@ -305,7 +240,6 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
|
|
|
|
|
DrAppToastMsg.showSuccesToast(
|
|
|
|
|
"Has been Successfully accepted");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
@ -339,8 +273,14 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
|
|
|
|
|
onTap: () async {
|
|
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
|
|
|
|
|
model.setAcceptedOrRejected(remarks: "Rejected");
|
|
|
|
|
model.setAcceptedOrRejected(
|
|
|
|
|
remarks: "Rejected",
|
|
|
|
|
memberId: model.allInterventionHistoryList[index].commentedBy,
|
|
|
|
|
prescriptionNo: model.allInterventionHistoryList[index].prescriptionId,
|
|
|
|
|
patientID: model.allInterventionHistoryList[index].patientId,
|
|
|
|
|
orderNo: model.allInterventionHistoryList[index].orderNo,
|
|
|
|
|
admissionNo: model.allInterventionHistoryList[index].admissionNo,
|
|
|
|
|
);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if(model.state == ViewState.ErrorLocal) {
|
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
|
@ -376,7 +316,6 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
|