prescription

merge-requests/251/head
hussam al-habibeh 5 years ago
parent dd53a9bd4d
commit 4b54ca7d47

@ -65,8 +65,8 @@ class _LandingPageState extends State<LandingPage> {
builder: Builder(builder: (context) => DashboardScreen()),
),
MessagesScreen(),
//MyScheduleScreen(),
NewPrescriptionScreen(),
MyScheduleScreen(),
//NewPrescriptionScreen(),
ServicesScreen()
],
),

@ -453,6 +453,27 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
.edit),
onTap: () {
updatePrescriptionForm(
dose: model
.prescriptionList[
0]
.entityList[
index]
.doseTimingID
.toString(),
frequency: model
.prescriptionList[
0]
.entityList[
index]
.frequencyID
.toString(),
rouat: model
.prescriptionList[
0]
.entityList[
index]
.routeID
.toString(),
patient:
patient,
drugId: model
@ -466,7 +487,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
0]
.entityList[
index]
.medicationName,
.doseDetail,
remarks: model
.prescriptionList[
0]
@ -571,13 +592,17 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
}
}
void updatePrescriptionForm(
{context,
String drugName,
int drugId,
String remarks,
PrescriptionViewModel model,
PatiantInformtion patient}) {
void updatePrescriptionForm({
context,
String drugName,
int drugId,
String remarks,
PrescriptionViewModel model,
PatiantInformtion patient,
String rouat,
String frequency,
String dose,
}) {
TextEditingController remarksController = TextEditingController();
TextEditingController doseController = TextEditingController();
TextEditingController frequencyController = TextEditingController();
@ -587,11 +612,11 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
isScrollControlled: true,
builder: (BuildContext bc) {
return Container(
height: 600,
height: MediaQuery.of(context).size.height * 0.73,
child: Form(
child: Padding(
padding:
EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
EdgeInsets.symmetric(horizontal: 20.0, vertical: 12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -626,7 +651,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: TextFields(
hintText: 'Dose',
hintText: 'Dose Time',
controller: doseController,
keyboardType: TextInputType.number,
),
@ -649,7 +674,6 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
SizedBox(
height: 12.0,
),
AppText('Remarks'),
Container(
decoration: BoxDecoration(
borderRadius:
@ -667,7 +691,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
height: 12.0,
),
SizedBox(
height: 140.0,
height: MediaQuery.of(context).size.height * 0.12,
),
Container(
margin:
@ -679,6 +703,9 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
title: 'update prescription'.toUpperCase(),
onPressed: () {
updatePrescription(
doseId: dose,
frequencyId: frequency,
routeId: rouat,
patient: patient,
model: model,
drugId: drugId,
@ -704,10 +731,13 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
updatePrescription(
{PrescriptionViewModel model,
int drugId,
String frequencyId,
String remarks,
String dose,
String doseId,
String frequency,
String route,
String routeId,
PatiantInformtion patient}) async {
//PrescriptionViewModel model = PrescriptionViewModel();
PostPrescriptionReqModel updatePrescriptionReqModel =
@ -725,12 +755,12 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
dose: frequency.isNotEmpty ? int.parse(dose) : 1,
itemId: drugId,
doseUnitId: 1,
route: frequency.isNotEmpty ? int.parse(route) : 1,
frequency: frequency.isNotEmpty ? int.parse(frequency) : 1,
route: route.isNotEmpty ? int.parse(route) : routeId,
frequency: frequency.isNotEmpty ? int.parse(frequency) : frequencyId,
remarks: remarks.isEmpty ? '' : remarks,
approvalRequired: true,
icdcode10Id: "test2",
doseTime: 1,
doseTime: dose.isNotEmpty ? int.parse(frequency) : doseId,
duration: 2,
doseStartDate: "2020-12-20T13:07:41.769Z"));
updatePrescriptionReqModel.prescriptionRequestModel = sss;

Loading…
Cancel
Save