add in patient prescription details screen

merge-requests/104/head
Elham Rababah 5 years ago
parent 3495e6bc9b
commit 610ae3c1fb

@ -1,3 +1,5 @@
import 'package:doctor_app_flutter/util/helpers.dart';
class PrescriptionReportForInPatient {
int admissionNo;
int authorizedBy;
@ -25,7 +27,7 @@ class PrescriptionReportForInPatient {
int orderNo;
int patientID;
String pharmacyRemarks;
String prescriptionDatetime;
DateTime prescriptionDatetime;
int prescriptionNo;
String processedBy;
int projectID;
@ -38,11 +40,11 @@ class PrescriptionReportForInPatient {
int routeId;
Null routeN;
Null setupID;
String startDatetime;
DateTime startDatetime;
int status;
String statusDescription;
Null statusDescriptionN;
String stopDatetime;
DateTime stopDatetime;
int unitofMeasurement;
String unitofMeasurementDescription;
Null unitofMeasurementDescriptionN;
@ -123,7 +125,7 @@ class PrescriptionReportForInPatient {
orderNo = json['OrderNo'];
patientID = json['PatientID'];
pharmacyRemarks = json['PharmacyRemarks'];
prescriptionDatetime = json['PrescriptionDatetime'];
prescriptionDatetime = Helpers.convertStringToDate(json['PrescriptionDatetime']);
prescriptionNo = json['PrescriptionNo'];
processedBy = json['ProcessedBy'];
projectID = json['ProjectID'];
@ -136,11 +138,11 @@ class PrescriptionReportForInPatient {
routeId = json['RouteId'];
routeN = json['RouteN'];
setupID = json['SetupID'];
startDatetime = json['StartDatetime'];
startDatetime = Helpers.convertStringToDate(json['StartDatetime']) ;
status = json['Status'];
statusDescription = json['StatusDescription'];
statusDescriptionN = json['StatusDescriptionN'];
stopDatetime = json['StopDatetime'];
stopDatetime = Helpers.convertStringToDate(json['StopDatetime']);
unitofMeasurement = json['UnitofMeasurement'];
unitofMeasurementDescription = json['UnitofMeasurementDescription'];
unitofMeasurementDescriptionN = json['UnitofMeasurementDescriptionN'];

@ -273,6 +273,7 @@ class PatientsProvider with ChangeNotifier {
isLoading = false;
}, onFailure: (String error, int statusCode) {
isError = true;
isLoading = false;
this.error = error;
}, body: patient);
notifyListeners();

@ -1,4 +1,6 @@
import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart';
import './screens/QR_reader_screen.dart';
import './screens/auth/change_password_screen.dart';
import './screens/auth/login_screen.dart';
@ -58,6 +60,7 @@ const String PATIENT_ORDERS = 'patients/patient_orders';
const String PATIENT_INSURANCE_APPROVALS = 'patients/patient_insurance_approvals';
const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details';
const String BODY_MEASUREMENTS = 'patients/body-measurements';
const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details';
var routes = {
HOME: (_) => LandingPage(),
@ -89,5 +92,6 @@ var routes = {
PATIENT_ORDERS: (_) => PatientsOrdersScreen(),
PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(),
VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(),
BODY_MEASUREMENTS: (_) => VitalSignItemDetailsScreen()
BODY_MEASUREMENTS: (_) => VitalSignItemDetailsScreen(),
IN_PATIENT_PRESCRIPTIONS_DETAILS:(_)=> InpatientPrescriptionDetailsScreen()
};

@ -1,5 +1,3 @@
import 'dart:async';
import 'package:flutter/material.dart';
import '../../lookups/auth_lookup.dart';

@ -0,0 +1,200 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/my_referral_patient_model.dart';
import 'package:doctor_app_flutter/models/patient/prescription_report_for_in_patient.dart';
import 'package:doctor_app_flutter/providers/referral_patient_provider.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_button.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_bgNew_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class InpatientPrescriptionDetailsScreen extends StatefulWidget {
@override
_InpatientPrescriptionDetailsScreenState createState() =>
_InpatientPrescriptionDetailsScreenState();
}
class _InpatientPrescriptionDetailsScreenState
extends State<InpatientPrescriptionDetailsScreen> {
bool _showDetails = false;
bool _isLoading = false;
final _formKey = GlobalKey<FormState>();
String error;
TextEditingController answerController;
bool _isInit = true;
PrescriptionReportForInPatient prescription;
@override
void initState() {
// answerController = new TextEditingController(text: widget.myReferralPatientModel.referredDoctorRemarks ?? '');
super.initState();
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
prescription = routeArgs['prescription'];
}
_isInit = false;
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: 'perscription info',
body: CardWithBgWidgetNew(
widget: Container(
child: ListView(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
AppText(
prescription.itemDescription,
fontSize: 2.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
InkWell(
onTap: () {
setState(() {
_showDetails = !_showDetails;
});
},
child: Icon(_showDetails
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down)),
],
),
!_showDetails
? Container()
: AnimatedContainer(
duration: Duration(milliseconds: 200),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 5,
),
Divider(
color: Color(0xFF000000),
height: 0.5,
),
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 0.5),
),
children: [
buildTableRow(
des: '${prescription.direction}',
key: 'Direction'),
buildTableRow(
des: '${prescription.refillID}',
key: 'Refill'),
buildTableRow(
des: '${prescription.dose}',
key: 'Dose'),
buildTableRow(
des: '${prescription.unitofMeasurement}',
key: 'UOM'),
buildTableRow(
des: '${Helpers.getDate(prescription.startDatetime) }',
key: 'Start Date'),
buildTableRow(
des: '${Helpers.getDate(prescription.stopDatetime)}',
key: 'Stop Date'),
buildTableRow(
des: '${prescription.noOfDoses}',
key: 'No of Doses'),
buildTableRow(
des: '${prescription.route}',
key: 'Route'),
buildTableRow(
des: '${prescription.comments}',
key: 'Comments'),
buildTableRow(
des: '${prescription.pharmacyRemarks}',
key: 'Pharmacy Remarks'),
buildTableRow(
des: '${Helpers.getDate(prescription.prescriptionDatetime)}',
key: 'Prescription Date'),
buildTableRow(
des: '${prescription.refillID}',
key: 'Status'),
buildTableRow(
des: '${prescription.refillID}',
key: 'Created By'),
buildTableRow(
des: '${prescription.refillID}',
key: 'Processed By'),
buildTableRow(
des: '${prescription.refillID}',
key: 'Authorized By'),
],
),
Divider(
color: Color(0xFF000000),
height: 0.5,
),
SizedBox(
height: 5,
),
],
),
)
],
),
),
),
);
}
TableRow buildTableRow({des, key}) {
print('$key: $des');
return TableRow(children: [
Container(
margin: EdgeInsets.all(2.5),
padding: EdgeInsets.all(5),
child: Row(
children: <Widget>[
Expanded(
child: Container(
child: AppText(
key,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
),
),
),
Expanded(
child: Container(
margin:
EdgeInsets.only(left: 4, top: 2.5, right: 2.5, bottom: 2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
AppText(
'${des}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
textAlign: TextAlign.center,
)
],
),
),
),
],
),
),
]);
}
}

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/patient/prescription_report_for_in_patient.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
@ -26,7 +27,11 @@ class PrescriptionInPatientWidget extends StatelessWidget {
itemCount: prescriptionReportForInPatientList.length,
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {},
onTap: () {
Navigator.of(context).pushNamed(IN_PATIENT_PRESCRIPTIONS_DETAILS, arguments: {
'prescription': prescriptionReportForInPatientList[index]
});
},
child: CardWithBgWidgetNew(
widget: Column(
crossAxisAlignment: CrossAxisAlignment.start,

Loading…
Cancel
Save