add new service called intervention_medication_history_screen
parent
af9e8dd095
commit
e165ec5b1d
@ -0,0 +1,32 @@
|
||||
class InterventionMedicationHistoryReqModel {
|
||||
int projectID;
|
||||
int patientID;
|
||||
int admissionNo;
|
||||
int orderNo;
|
||||
int prescriptionNo;
|
||||
|
||||
InterventionMedicationHistoryReqModel(
|
||||
{this.projectID,
|
||||
this.patientID,
|
||||
this.admissionNo,
|
||||
this.orderNo,
|
||||
this.prescriptionNo});
|
||||
|
||||
InterventionMedicationHistoryReqModel.fromJson(Map<String, dynamic> json) {
|
||||
projectID = json['ProjectID'];
|
||||
patientID = json['PatientID'];
|
||||
admissionNo = json['AdmissionNo'];
|
||||
orderNo = json['OrderNo'];
|
||||
prescriptionNo = json['PrescriptionNo'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['AdmissionNo'] = this.admissionNo;
|
||||
data['OrderNo'] = this.orderNo;
|
||||
data['PrescriptionNo'] = this.prescriptionNo;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
class InterventionMedicationHistoryResModel {
|
||||
String setupId;
|
||||
String projectId;
|
||||
int patientId;
|
||||
int admissionNo;
|
||||
int prescriptionId;
|
||||
int orderNo;
|
||||
int id;
|
||||
int interventionId;
|
||||
Null intervention;
|
||||
String remark;
|
||||
int commentedBy;
|
||||
bool isDoctor;
|
||||
bool isActive;
|
||||
int createdBy;
|
||||
String createdByName;
|
||||
String createdByNameN;
|
||||
String createdOn;
|
||||
Null editedBy;
|
||||
Null editedByName;
|
||||
Null editedByNameN;
|
||||
Null editedOn;
|
||||
|
||||
InterventionMedicationHistoryResModel(
|
||||
{this.setupId,
|
||||
this.projectId,
|
||||
this.patientId,
|
||||
this.admissionNo,
|
||||
this.prescriptionId,
|
||||
this.orderNo,
|
||||
this.id,
|
||||
this.interventionId,
|
||||
this.intervention,
|
||||
this.remark,
|
||||
this.commentedBy,
|
||||
this.isDoctor,
|
||||
this.isActive,
|
||||
this.createdBy,
|
||||
this.createdByName,
|
||||
this.createdByNameN,
|
||||
this.createdOn,
|
||||
this.editedBy,
|
||||
this.editedByName,
|
||||
this.editedByNameN,
|
||||
this.editedOn});
|
||||
|
||||
InterventionMedicationHistoryResModel.fromJson(Map<String, dynamic> json) {
|
||||
setupId = json['SetupId'];
|
||||
projectId = json['ProjectId'];
|
||||
patientId = json['PatientId'];
|
||||
admissionNo = json['AdmissionNo'];
|
||||
prescriptionId = json['PrescriptionId'];
|
||||
orderNo = json['OrderNo'];
|
||||
id = json['Id'];
|
||||
interventionId = json['InterventionId'];
|
||||
intervention = json['Intervention'];
|
||||
remark = json['Remark'];
|
||||
commentedBy = json['CommentedBy'];
|
||||
isDoctor = json['IsDoctor'];
|
||||
isActive = json['IsActive'];
|
||||
createdBy = json['CreatedBy'];
|
||||
createdByName = json['CreatedByName'];
|
||||
createdByNameN = json['CreatedByNameN'];
|
||||
createdOn = json['CreatedOn'];
|
||||
editedBy = json['EditedBy'];
|
||||
editedByName = json['EditedByName'];
|
||||
editedByNameN = json['EditedByNameN'];
|
||||
editedOn = json['EditedOn'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['SetupId'] = this.setupId;
|
||||
data['ProjectId'] = this.projectId;
|
||||
data['PatientId'] = this.patientId;
|
||||
data['AdmissionNo'] = this.admissionNo;
|
||||
data['PrescriptionId'] = this.prescriptionId;
|
||||
data['OrderNo'] = this.orderNo;
|
||||
data['Id'] = this.id;
|
||||
data['InterventionId'] = this.interventionId;
|
||||
data['Intervention'] = this.intervention;
|
||||
data['Remark'] = this.remark;
|
||||
data['CommentedBy'] = this.commentedBy;
|
||||
data['IsDoctor'] = this.isDoctor;
|
||||
data['IsActive'] = this.isActive;
|
||||
data['CreatedBy'] = this.createdBy;
|
||||
data['CreatedByName'] = this.createdByName;
|
||||
data['CreatedByNameN'] = this.createdByNameN;
|
||||
data['CreatedOn'] = this.createdOn;
|
||||
data['EditedBy'] = this.editedBy;
|
||||
data['EditedByName'] = this.editedByName;
|
||||
data['EditedByNameN'] = this.editedByNameN;
|
||||
data['EditedOn'] = this.editedOn;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,418 @@
|
||||
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/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/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/error_message.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../../../config/config.dart';
|
||||
import '../../../../core/service/AnalyticsService.dart';
|
||||
import '../../../../core/viewModel/profile/intervention_medication_view_model.dart';
|
||||
import '../../../../icons_app/doctor_app_icons.dart';
|
||||
import '../../../../locator.dart';
|
||||
import '../operation_report/update_operation_report.dart';
|
||||
|
||||
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
||||
|
||||
class InterventionMedicationHistoryScreen extends StatefulWidget {
|
||||
final PatiantInformtion patient;
|
||||
const InterventionMedicationHistoryScreen(this.patient, {Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_InterventionMedicationHistoryScreenState createState() => _InterventionMedicationHistoryScreenState();
|
||||
}
|
||||
|
||||
class _InterventionMedicationHistoryScreenState extends State<InterventionMedicationHistoryScreen> {
|
||||
bool isDischargedPatient = false;
|
||||
AuthenticationViewModel authenticationViewModel;
|
||||
ProjectViewModel projectViewModel;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
authenticationViewModel = Provider.of(context);
|
||||
projectViewModel = Provider.of(context);
|
||||
|
||||
return BaseView<InterventionMedicationViewModel>(
|
||||
onModelReady: (model) => model.getInterventionMedicationHistory(patientId: widget.patient.patientId,
|
||||
),
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
baseViewModel: model,
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
appBar: PatientProfileAppBar(
|
||||
widget.patient,
|
||||
isInpatient: true,
|
||||
),
|
||||
body: model.allInterventionHistoryList == null ||
|
||||
model.allInterventionHistoryList.length == 0
|
||||
? Center(
|
||||
child: ErrorMessage(
|
||||
error: TranslationBase.of(context).noDataAvailable,
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
color: Colors.grey[200],
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: ListView.builder(
|
||||
itemCount: model.allInterventionHistoryList.length,
|
||||
itemBuilder: (BuildContext ctxt, int index) {
|
||||
return FractionallySizedBox(
|
||||
widthFactor: 0.95,
|
||||
child: CardWithBgWidget(
|
||||
hasBorder: false,
|
||||
bgColor: Colors.transparent,
|
||||
widget: Column(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.of(context)
|
||||
.size
|
||||
.width *
|
||||
0.60,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
AppText(
|
||||
model
|
||||
.allInterventionHistoryList[
|
||||
index].setupId,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 14,
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
AppText(
|
||||
AppDateUtils.getDayMonthYearDateFormatted(
|
||||
AppDateUtils.convertStringToDate(
|
||||
model
|
||||
.allInterventionHistoryList[
|
||||
index].createdOn)
|
||||
,isArabic:
|
||||
projectViewModel
|
||||
.isArabic,
|
||||
isMonthShort: true),
|
||||
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
|
||||
.allInterventionHistoryList[
|
||||
index]
|
||||
.remark,
|
||||
fontSize: 12,
|
||||
isCopyable: true,
|
||||
),
|
||||
),
|
||||
]),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
// AppText(
|
||||
// TranslationBase.of(context)
|
||||
// .pharmacology +
|
||||
// " : ",
|
||||
// fontSize: 12,
|
||||
// ),
|
||||
Expanded(
|
||||
child: AppText(
|
||||
model
|
||||
.allInterventionHistoryList[
|
||||
index]
|
||||
.createdByName,
|
||||
fontSize: 12,
|
||||
isCopyable: true,
|
||||
),
|
||||
),
|
||||
]),
|
||||
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,
|
||||
),
|
||||
),
|
||||
]),
|
||||
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,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.end,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
await locator<AnalyticsService>()
|
||||
.logEvent(
|
||||
eventCategory:
|
||||
"Operation Report Screen",
|
||||
eventAction:
|
||||
"Update Operation Report ",
|
||||
);
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// MaterialPageRoute(
|
||||
// builder: (context) =>
|
||||
// UpdateOperationReport(
|
||||
// reservation: model
|
||||
// .reservationList[
|
||||
// index],
|
||||
// patient: patient,
|
||||
// isUpdate: true,
|
||||
// )),
|
||||
// );
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppGlobal.appRedColor,
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
),
|
||||
// color:Colors.red[600],
|
||||
|
||||
child: Row(
|
||||
children: [
|
||||
|
||||
SizedBox(
|
||||
width: 2,
|
||||
),
|
||||
AppText(
|
||||
TranslationBase.of(context)
|
||||
.accept,
|
||||
fontSize: 10,
|
||||
color: Colors.white,
|
||||
),
|
||||
],
|
||||
),
|
||||
padding: EdgeInsets.all(6),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
await locator<AnalyticsService>()
|
||||
.logEvent(
|
||||
eventCategory:
|
||||
"Operation Report Screen",
|
||||
eventAction:
|
||||
"Update Operation Report ",
|
||||
);
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// MaterialPageRoute(
|
||||
// builder: (context) =>
|
||||
// UpdateOperationReport(
|
||||
// reservation: model
|
||||
// .reservationList[
|
||||
// index],
|
||||
// patient: patient,
|
||||
// isUpdate: true,
|
||||
// )),
|
||||
// );
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppGlobal.appGreenColor,
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
),
|
||||
// color:Colors.red[600],
|
||||
|
||||
child: Row(
|
||||
children: [
|
||||
|
||||
SizedBox(
|
||||
width: 2,
|
||||
),
|
||||
AppText(
|
||||
TranslationBase.of(context)
|
||||
.reject,
|
||||
fontSize: 10,
|
||||
color: Colors.white,
|
||||
),
|
||||
],
|
||||
),
|
||||
padding: EdgeInsets.all(6),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue