create Prescription In and Out Patient

merge-requests/104/head
Mohammad ALjammal 6 years ago
parent ec81a16c0d
commit 2ad96dad88

@ -2,8 +2,8 @@ const MAX_SMALL_SCREEN = 660;
const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z]";
const ONLY_DATE = "[0-9/]";
// const BASE_URL = 'https://hmgwebservices.com/Services/';
const BASE_URL = 'https://uat.hmgwebservices.com/Services/';
const BASE_URL = 'https://hmgwebservices.com/Services/';
//const BASE_URL = 'https://uat.hmgwebservices.com/Services/';
const PHARMACY_ITEMS_URL = "Lists.svc/REST/GetPharmcyItems_Region";
const PHARMACY_LIST_URL = "Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = "DoctorApplication.svc/REST/GetProgressNoteForInPatient";

@ -1,5 +1,7 @@
import 'package:doctor_app_flutter/models/patient/reauest_prescription_report_for_in_patient.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/prescription_in_patinets_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/prescription_out_patinets_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -33,9 +35,10 @@ class PrescriptionScreen extends StatefulWidget {
class _PrescriptionScreenState extends State<PrescriptionScreen> {
PatientsProvider patientsProv;
var _isInit = true;
bool _isInit = true;
String type = '2';
/*
/*
*@author: Elham Rababah
*@Date:28/4/2020
*@param: context
@ -46,7 +49,7 @@ class _PrescriptionScreenState extends State<PrescriptionScreen> {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN);
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
if (type == '1') {
RequestPrescriptionReportForInPatient prescriptionReqModel =
@ -85,74 +88,14 @@ class _PrescriptionScreenState extends State<PrescriptionScreen> {
? DrAppCircularProgressIndeicator()
: patientsProv.isError
? DrAppEmbeddedError(error: patientsProv.error)
: patientsProv.patientPrescriptionsList.length == 0
? DrAppEmbeddedError(
error: 'You don\'t have any Prescriptions')
: Container(
margin: EdgeInsets.fromLTRB(
SizeConfig.realScreenWidth * 0.05,
0,
SizeConfig.realScreenWidth * 0.05,
0),
child: ListView.builder(
itemCount:
patientsProv.patientPrescriptionsList.length,
itemBuilder: (BuildContext context, int index) {
return InkWell(
child: CardWithBgWidgetNew(
widget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
LargeAvatar(
url: patientsProv
.patientPrescriptionsList[index]
.doctorImageURL,
name: patientsProv
.patientPrescriptionsList[index]
.doctorName,
radius: 10,
width: 70,
),
Expanded(
child: Container(
margin: EdgeInsets.only(
left: 15, right: 15),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
'${patientsProv.patientPrescriptionsList[index].name}',
fontSize: 2.5 *
SizeConfig.textMultiplier,
),
SizedBox(
height: 8,
),
AppText(
'${patientsProv.patientPrescriptionsList[index].clinicDescription}',
fontSize: 2.5 *
SizeConfig
.textMultiplier,
color: Theme.of(context)
.primaryColor),
SizedBox(
height: 8,
),
],
),
),
)
],
),
],
),
),
onTap: () {},
);
}),
: type == '1'
? PrescriptionInPatientWidget(
prescriptionReportForInPatientList:
patientsProv.prescriptionReportForInPatientList,
)
: PrescriptionOutPatientWidget(
patientPrescriptionsList:
patientsProv.patientPrescriptionsList,
),
);
}

@ -0,0 +1,82 @@
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/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';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'large_avatar.dart';
class PrescriptionInPatientWidget extends StatelessWidget {
final List<PrescriptionReportForInPatient> prescriptionReportForInPatientList;
PrescriptionInPatientWidget(
{Key key, this.prescriptionReportForInPatientList});
@override
Widget build(BuildContext context) {
return Container(
child: prescriptionReportForInPatientList.length == 0
? DrAppEmbeddedError(error: 'You don\'t have any Prescriptions')
: Container(
margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0,
SizeConfig.realScreenWidth * 0.05, 0),
child: ListView.builder(
itemCount: prescriptionReportForInPatientList.length,
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {},
child: CardWithBgWidgetNew(
widget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
LargeAvatar(
name:
prescriptionReportForInPatientList[index]
.createdByName,
radius: 10,
width: 70,
),
Expanded(
child: Container(
margin:
EdgeInsets.only(left: 15, right: 15),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
'${prescriptionReportForInPatientList[index].createdByName}',
fontSize:
2.5 * SizeConfig.textMultiplier,
),
SizedBox(
height: 8,
),
AppText(
'${prescriptionReportForInPatientList[index].itemDescription}',
fontSize:
2.5 * SizeConfig.textMultiplier,
color:
Theme.of(context).primaryColor),
SizedBox(
height: 8,
),
],
),
),
)
],
),
],
),
));
},
),
),
);
}
}

@ -0,0 +1,82 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/patient/prescription_res_model.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';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'large_avatar.dart';
class PrescriptionOutPatientWidget extends StatelessWidget {
final List<PrescriptionResModel> patientPrescriptionsList;
PrescriptionOutPatientWidget({Key key, this.patientPrescriptionsList});
@override
Widget build(BuildContext context) {
return Container(
child: patientPrescriptionsList.length == 0
? DrAppEmbeddedError(error: 'You don\'t have any Prescriptions')
: Container(
margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0,
SizeConfig.realScreenWidth * 0.05, 0),
child: ListView.builder(
itemCount: patientPrescriptionsList.length,
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {},
child: CardWithBgWidgetNew(
widget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
LargeAvatar(
url: patientPrescriptionsList[index]
.doctorImageURL,
name: patientPrescriptionsList[index]
.doctorName,
radius: 10,
width: 70,
),
Expanded(
child: Container(
margin:
EdgeInsets.only(left: 15, right: 15),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
'${patientPrescriptionsList[index].name}',
fontSize:
2.5 * SizeConfig.textMultiplier,
),
SizedBox(
height: 8,
),
AppText(
'${patientPrescriptionsList[index].clinicDescription}',
fontSize:
2.5 * SizeConfig.textMultiplier,
color:
Theme.of(context).primaryColor),
SizedBox(
height: 8,
),
],
),
),
)
],
),
],
),
));
},
),
),
);
}
}
Loading…
Cancel
Save