Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into episode_inpatient_changes
Conflicts: lib/screens/patients/InPatientPage.dartmerge-requests/825/head
commit
8fc4b1596b
@ -0,0 +1,136 @@
|
|||||||
|
class GetMedicationForInPatientModel {
|
||||||
|
String setupID;
|
||||||
|
int projectID;
|
||||||
|
int admissionNo;
|
||||||
|
int patientID;
|
||||||
|
int orderNo;
|
||||||
|
int prescriptionNo;
|
||||||
|
int lineItemNo;
|
||||||
|
String prescriptionDatetime;
|
||||||
|
int itemID;
|
||||||
|
int directionID;
|
||||||
|
int refillID;
|
||||||
|
String dose;
|
||||||
|
int unitofMeasurement;
|
||||||
|
String startDatetime;
|
||||||
|
String stopDatetime;
|
||||||
|
int noOfDoses;
|
||||||
|
int routeId;
|
||||||
|
String comments;
|
||||||
|
int reviewedPharmacist;
|
||||||
|
dynamic reviewedPharmacistDatetime;
|
||||||
|
dynamic discountinueDatetime;
|
||||||
|
dynamic rescheduleDatetime;
|
||||||
|
int status;
|
||||||
|
String statusDescription;
|
||||||
|
int createdBy;
|
||||||
|
String createdOn;
|
||||||
|
dynamic editedBy;
|
||||||
|
dynamic editedOn;
|
||||||
|
dynamic strength;
|
||||||
|
String pHRItemDescription;
|
||||||
|
String pHRItemDescriptionN;
|
||||||
|
|
||||||
|
GetMedicationForInPatientModel(
|
||||||
|
{this.setupID,
|
||||||
|
this.projectID,
|
||||||
|
this.admissionNo,
|
||||||
|
this.patientID,
|
||||||
|
this.orderNo,
|
||||||
|
this.prescriptionNo,
|
||||||
|
this.lineItemNo,
|
||||||
|
this.prescriptionDatetime,
|
||||||
|
this.itemID,
|
||||||
|
this.directionID,
|
||||||
|
this.refillID,
|
||||||
|
this.dose,
|
||||||
|
this.unitofMeasurement,
|
||||||
|
this.startDatetime,
|
||||||
|
this.stopDatetime,
|
||||||
|
this.noOfDoses,
|
||||||
|
this.routeId,
|
||||||
|
this.comments,
|
||||||
|
this.reviewedPharmacist,
|
||||||
|
this.reviewedPharmacistDatetime,
|
||||||
|
this.discountinueDatetime,
|
||||||
|
this.rescheduleDatetime,
|
||||||
|
this.status,
|
||||||
|
this.statusDescription,
|
||||||
|
this.createdBy,
|
||||||
|
this.createdOn,
|
||||||
|
this.editedBy,
|
||||||
|
this.editedOn,
|
||||||
|
this.strength,
|
||||||
|
this.pHRItemDescription,
|
||||||
|
this.pHRItemDescriptionN});
|
||||||
|
|
||||||
|
GetMedicationForInPatientModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
setupID = json['SetupID'];
|
||||||
|
projectID = json['ProjectID'];
|
||||||
|
admissionNo = json['AdmissionNo'];
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
orderNo = json['OrderNo'];
|
||||||
|
prescriptionNo = json['PrescriptionNo'];
|
||||||
|
lineItemNo = json['LineItemNo'];
|
||||||
|
prescriptionDatetime = json['PrescriptionDatetime'];
|
||||||
|
itemID = json['ItemID'];
|
||||||
|
directionID = json['DirectionID'];
|
||||||
|
refillID = json['RefillID'];
|
||||||
|
dose = json['Dose'];
|
||||||
|
unitofMeasurement = json['UnitofMeasurement'];
|
||||||
|
startDatetime = json['StartDatetime'];
|
||||||
|
stopDatetime = json['StopDatetime'];
|
||||||
|
noOfDoses = json['NoOfDoses'];
|
||||||
|
routeId = json['RouteId'];
|
||||||
|
comments = json['Comments'];
|
||||||
|
reviewedPharmacist = json['ReviewedPharmacist'];
|
||||||
|
reviewedPharmacistDatetime = json['ReviewedPharmacistDatetime'];
|
||||||
|
discountinueDatetime = json['DiscountinueDatetime'];
|
||||||
|
rescheduleDatetime = json['RescheduleDatetime'];
|
||||||
|
status = json['Status'];
|
||||||
|
statusDescription = json['StatusDescription'];
|
||||||
|
createdBy = json['CreatedBy'];
|
||||||
|
createdOn = json['CreatedOn'];
|
||||||
|
editedBy = json['EditedBy'];
|
||||||
|
editedOn = json['EditedOn'];
|
||||||
|
strength = json['Strength'];
|
||||||
|
pHRItemDescription = json['PHRItemDescription'];
|
||||||
|
pHRItemDescriptionN = json['PHRItemDescriptionN'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['SetupID'] = this.setupID;
|
||||||
|
data['ProjectID'] = this.projectID;
|
||||||
|
data['AdmissionNo'] = this.admissionNo;
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['OrderNo'] = this.orderNo;
|
||||||
|
data['PrescriptionNo'] = this.prescriptionNo;
|
||||||
|
data['LineItemNo'] = this.lineItemNo;
|
||||||
|
data['PrescriptionDatetime'] = this.prescriptionDatetime;
|
||||||
|
data['ItemID'] = this.itemID;
|
||||||
|
data['DirectionID'] = this.directionID;
|
||||||
|
data['RefillID'] = this.refillID;
|
||||||
|
data['Dose'] = this.dose;
|
||||||
|
data['UnitofMeasurement'] = this.unitofMeasurement;
|
||||||
|
data['StartDatetime'] = this.startDatetime;
|
||||||
|
data['StopDatetime'] = this.stopDatetime;
|
||||||
|
data['NoOfDoses'] = this.noOfDoses;
|
||||||
|
data['RouteId'] = this.routeId;
|
||||||
|
data['Comments'] = this.comments;
|
||||||
|
data['ReviewedPharmacist'] = this.reviewedPharmacist;
|
||||||
|
data['ReviewedPharmacistDatetime'] = this.reviewedPharmacistDatetime;
|
||||||
|
data['DiscountinueDatetime'] = this.discountinueDatetime;
|
||||||
|
data['RescheduleDatetime'] = this.rescheduleDatetime;
|
||||||
|
data['Status'] = this.status;
|
||||||
|
data['StatusDescription'] = this.statusDescription;
|
||||||
|
data['CreatedBy'] = this.createdBy;
|
||||||
|
data['CreatedOn'] = this.createdOn;
|
||||||
|
data['EditedBy'] = this.editedBy;
|
||||||
|
data['EditedOn'] = this.editedOn;
|
||||||
|
data['Strength'] = this.strength;
|
||||||
|
data['PHRItemDescription'] = this.pHRItemDescription;
|
||||||
|
data['PHRItemDescriptionN'] = this.pHRItemDescriptionN;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,60 @@
|
|||||||
|
class GetMedicationForInPatientRequestModel {
|
||||||
|
bool isDentalAllowedBackend;
|
||||||
|
double versionID;
|
||||||
|
int channel;
|
||||||
|
int languageID;
|
||||||
|
String iPAdress;
|
||||||
|
String generalid;
|
||||||
|
int deviceTypeID;
|
||||||
|
String tokenID;
|
||||||
|
int patientID;
|
||||||
|
int admissionNo;
|
||||||
|
String sessionID;
|
||||||
|
int projectID;
|
||||||
|
|
||||||
|
GetMedicationForInPatientRequestModel(
|
||||||
|
{this.isDentalAllowedBackend,
|
||||||
|
this.versionID,
|
||||||
|
this.channel,
|
||||||
|
this.languageID,
|
||||||
|
this.iPAdress,
|
||||||
|
this.generalid,
|
||||||
|
this.deviceTypeID,
|
||||||
|
this.tokenID,
|
||||||
|
this.patientID,
|
||||||
|
this.admissionNo,
|
||||||
|
this.sessionID,
|
||||||
|
this.projectID});
|
||||||
|
|
||||||
|
GetMedicationForInPatientRequestModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||||
|
versionID = json['VersionID'];
|
||||||
|
channel = json['Channel'];
|
||||||
|
languageID = json['LanguageID'];
|
||||||
|
iPAdress = json['IPAdress'];
|
||||||
|
generalid = json['generalid'];
|
||||||
|
deviceTypeID = json['DeviceTypeID'];
|
||||||
|
tokenID = json['TokenID'];
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
admissionNo = json['AdmissionNo'];
|
||||||
|
sessionID = json['SessionID'];
|
||||||
|
projectID = json['ProjectID'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||||
|
data['VersionID'] = this.versionID;
|
||||||
|
data['Channel'] = this.channel;
|
||||||
|
data['LanguageID'] = this.languageID;
|
||||||
|
data['IPAdress'] = this.iPAdress;
|
||||||
|
data['generalid'] = this.generalid;
|
||||||
|
data['DeviceTypeID'] = this.deviceTypeID;
|
||||||
|
data['TokenID'] = this.tokenID;
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['AdmissionNo'] = this.admissionNo;
|
||||||
|
data['SessionID'] = this.sessionID;
|
||||||
|
data['ProjectID'] = this.projectID;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,214 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.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/UCAF/page-stepper-widget.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_scaffold_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../../../routes.dart';
|
||||||
|
import 'UCAF-detail-screen.dart';
|
||||||
|
import 'UCAF-input-screen.dart';
|
||||||
|
|
||||||
|
class UCAFPagerScreen extends StatefulWidget {
|
||||||
|
const UCAFPagerScreen({Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_UCAFPagerScreenState createState() => _UCAFPagerScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _UCAFPagerScreenState extends State<UCAFPagerScreen>
|
||||||
|
with TickerProviderStateMixin {
|
||||||
|
PageController _controller;
|
||||||
|
int _currentIndex = 0;
|
||||||
|
bool _isLoading = true;
|
||||||
|
|
||||||
|
PatiantInformtion patient;
|
||||||
|
String patientType;
|
||||||
|
String arrivalType;
|
||||||
|
|
||||||
|
changePageViewIndex(pageIndex, {isChangeState = true}) {
|
||||||
|
if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true);
|
||||||
|
_controller.jumpToPage(pageIndex);
|
||||||
|
setState(() {
|
||||||
|
_currentIndex = pageIndex;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void changeLoadingState(bool isLoading) {
|
||||||
|
setState(() {
|
||||||
|
_isLoading = isLoading;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
_controller = new PageController();
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||||
|
patient = routeArgs['patient'];
|
||||||
|
patientType = routeArgs['patientType'];
|
||||||
|
arrivalType = routeArgs['arrivalType'];
|
||||||
|
|
||||||
|
final screenSize = MediaQuery.of(context).size;
|
||||||
|
|
||||||
|
return BaseView<UcafViewModel>(
|
||||||
|
builder: (_, model, w) => AppScaffold(
|
||||||
|
isShowAppBar: true,
|
||||||
|
isLoading: _isLoading,
|
||||||
|
appBar: PatientProfileAppBar(patient),
|
||||||
|
appBarTitle: TranslationBase.of(context).ucaf,
|
||||||
|
body: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
// PatientHeaderWidgetNoAvatar(patient),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.all(16.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
AppText(
|
||||||
|
"${TranslationBase.of(context).patient}",
|
||||||
|
fontFamily: 'Poppins',
|
||||||
|
fontSize: SizeConfig.textMultiplier * 1.6,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
AppText(
|
||||||
|
"${TranslationBase.of(context).ucaf}",
|
||||||
|
fontFamily: 'Poppins',
|
||||||
|
fontSize: SizeConfig.textMultiplier * 3,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
PageStepperWidget(
|
||||||
|
stepsCount: 2,
|
||||||
|
currentStepIndex: _currentIndex + 1,
|
||||||
|
screenSize: screenSize,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
color: Theme.of(context).scaffoldBackgroundColor,
|
||||||
|
child: PageView(
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
controller: _controller,
|
||||||
|
onPageChanged: (index) {
|
||||||
|
setState(() {
|
||||||
|
_currentIndex = index;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
children: <Widget>[
|
||||||
|
UCAFInputScreen(
|
||||||
|
patient,
|
||||||
|
changeLoadingState: changeLoadingState,
|
||||||
|
),
|
||||||
|
UcafDetailScreen(
|
||||||
|
patient,
|
||||||
|
model,
|
||||||
|
changeLoadingState: changeLoadingState,
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
_isLoading
|
||||||
|
? Container(
|
||||||
|
height: 0,
|
||||||
|
)
|
||||||
|
: ucafButtons(model),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget ucafButtons(UcafViewModel model) {
|
||||||
|
switch (_currentIndex) {
|
||||||
|
case 0:
|
||||||
|
return Container(
|
||||||
|
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||||
|
child: AppButton(
|
||||||
|
title: TranslationBase.of(context).next,
|
||||||
|
color: Color(0xFFD02127),
|
||||||
|
onPressed: () {
|
||||||
|
changePageViewIndex(1);
|
||||||
|
// Navigator.of(context).pushNamed(PATIENT_UCAF_DETAIL, arguments: {
|
||||||
|
// 'patient': patient,
|
||||||
|
// 'patientType': patientType,
|
||||||
|
// 'arrivalType': arrivalType
|
||||||
|
// });
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
case 1:
|
||||||
|
return Container(
|
||||||
|
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: AppButton(
|
||||||
|
title: TranslationBase.of(context).cancel,
|
||||||
|
hasBorder: true,
|
||||||
|
vPadding: 8,
|
||||||
|
hPadding: 8,
|
||||||
|
borderColor: Colors.white,
|
||||||
|
color: Colors.white,
|
||||||
|
fontColor: Color(0xFFB8382B),
|
||||||
|
fontSize: 2.2,
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).popUntil((route) {
|
||||||
|
return route.settings.name == PATIENTS_PROFILE;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 8,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: AppButton(
|
||||||
|
title: TranslationBase.of(context).save,
|
||||||
|
hasBorder: true,
|
||||||
|
vPadding: 8,
|
||||||
|
hPadding: 8,
|
||||||
|
borderColor: Color(0xFFB8382B),
|
||||||
|
color: Color(0xFFB8382B),
|
||||||
|
fontColor: Colors.white,
|
||||||
|
fontSize: 2.0,
|
||||||
|
onPressed: () {
|
||||||
|
model.saveUCAFOnTap();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
default:
|
||||||
|
return Container();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue