Merge branch 'design-updates' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into search_in_soap
Conflicts: lib/screens/patients/patient_search_screen.dartpull/208/head
commit
b60b45ab53
@ -1,18 +1,90 @@
|
|||||||
class CategoriseProcedureModel {
|
class CategoriseProcedureModel {
|
||||||
String categoryID;
|
List<EntityList> entityList;
|
||||||
String categoryName;
|
int rowcount;
|
||||||
|
dynamic statusMessage;
|
||||||
|
|
||||||
CategoriseProcedureModel({this.categoryID, this.categoryName});
|
CategoriseProcedureModel(
|
||||||
|
{this.entityList, this.rowcount, this.statusMessage});
|
||||||
|
|
||||||
CategoriseProcedureModel.fromJson(Map<String, dynamic> json) {
|
CategoriseProcedureModel.fromJson(Map<String, dynamic> json) {
|
||||||
categoryID = json['CategoryID'];
|
if (json['entityList'] != null) {
|
||||||
categoryName = json['CategoryName'];
|
entityList = new List<EntityList>();
|
||||||
|
json['entityList'].forEach((v) {
|
||||||
|
entityList.add(new EntityList.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
rowcount = json['rowcount'];
|
||||||
|
statusMessage = json['statusMessage'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
if (this.entityList != null) {
|
||||||
|
data['entityList'] = this.entityList.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['rowcount'] = this.rowcount;
|
||||||
|
data['statusMessage'] = this.statusMessage;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class EntityList {
|
||||||
|
bool allowedClinic;
|
||||||
|
String category;
|
||||||
|
String categoryID;
|
||||||
|
String genderValidation;
|
||||||
|
String group;
|
||||||
|
String orderedValidation;
|
||||||
|
dynamic price;
|
||||||
|
String procedureId;
|
||||||
|
String procedureName;
|
||||||
|
String specialPermission;
|
||||||
|
String subGroup;
|
||||||
|
String template;
|
||||||
|
|
||||||
|
EntityList(
|
||||||
|
{this.allowedClinic,
|
||||||
|
this.category,
|
||||||
|
this.categoryID,
|
||||||
|
this.genderValidation,
|
||||||
|
this.group,
|
||||||
|
this.orderedValidation,
|
||||||
|
this.price,
|
||||||
|
this.procedureId,
|
||||||
|
this.procedureName,
|
||||||
|
this.specialPermission,
|
||||||
|
this.subGroup,
|
||||||
|
this.template});
|
||||||
|
|
||||||
|
EntityList.fromJson(Map<String, dynamic> json) {
|
||||||
|
allowedClinic = json['allowedClinic'];
|
||||||
|
category = json['category'];
|
||||||
|
categoryID = json['categoryID'];
|
||||||
|
genderValidation = json['genderValidation'];
|
||||||
|
group = json['group'];
|
||||||
|
orderedValidation = json['orderedValidation'];
|
||||||
|
price = json['price'];
|
||||||
|
procedureId = json['procedureId'];
|
||||||
|
procedureName = json['procedureName'];
|
||||||
|
specialPermission = json['specialPermission'];
|
||||||
|
subGroup = json['subGroup'];
|
||||||
|
template = json['template'];
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
data['CategoryID'] = this.categoryID;
|
data['allowedClinic'] = this.allowedClinic;
|
||||||
data['CategoryName'] = this.categoryName;
|
data['category'] = this.category;
|
||||||
|
data['categoryID'] = this.categoryID;
|
||||||
|
data['genderValidation'] = this.genderValidation;
|
||||||
|
data['group'] = this.group;
|
||||||
|
data['orderedValidation'] = this.orderedValidation;
|
||||||
|
data['price'] = this.price;
|
||||||
|
data['procedureId'] = this.procedureId;
|
||||||
|
data['procedureName'] = this.procedureName;
|
||||||
|
data['specialPermission'] = this.specialPermission;
|
||||||
|
data['subGroup'] = this.subGroup;
|
||||||
|
data['template'] = this.template;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,212 +1,372 @@
|
|||||||
|
import 'package:doctor_app_flutter/client/base_app_client.dart';
|
||||||
import 'package:doctor_app_flutter/config/config.dart';
|
import 'package:doctor_app_flutter/config/config.dart';
|
||||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
|
||||||
import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart';
|
import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/prescription/prescription_screen.dart';
|
||||||
import 'package:doctor_app_flutter/screens/prescription/prescription_warnings.dart';
|
import 'package:doctor_app_flutter/screens/prescription/prescription_warnings.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
||||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
|
||||||
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
|
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
|
||||||
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
|
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
|
||||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hexcolor/hexcolor.dart';
|
import 'package:hexcolor/hexcolor.dart';
|
||||||
|
|
||||||
void addPrescriptionForm(context) {
|
void addPrescriptionForm(context, PrescriptionViewModel model) {
|
||||||
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
TextEditingController durationController = TextEditingController();
|
||||||
|
TextEditingController strengthController = TextEditingController();
|
||||||
|
TextEditingController routeController = TextEditingController();
|
||||||
|
TextEditingController frequencyController = TextEditingController();
|
||||||
|
TextEditingController indicationController = TextEditingController();
|
||||||
|
TextEditingController instructions = TextEditingController();
|
||||||
|
|
||||||
|
TextEditingController drugIdController = TextEditingController();
|
||||||
|
TextEditingController doseController = TextEditingController();
|
||||||
|
final GlobalKey<FormState> formKey = GlobalKey<FormState>();
|
||||||
final double spaceBetweenTextFileds = 12;
|
final double spaceBetweenTextFileds = 12;
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext bc) {
|
builder: (BuildContext bc) {
|
||||||
return SingleChildScrollView(
|
return DraggableScrollableSheet(
|
||||||
child: Container(
|
initialChildSize: 0.90,
|
||||||
height: 700,
|
maxChildSize: 0.90,
|
||||||
child: Padding(
|
minChildSize: 0.9,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0),
|
builder: (BuildContext context, ScrollController scrollController) {
|
||||||
child: Column(
|
return SingleChildScrollView(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
child: Container(
|
||||||
//mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
height: 980,
|
||||||
children: [
|
child: Padding(
|
||||||
AppText(
|
padding:
|
||||||
TranslationBase.of(context).medicines.toUpperCase(),
|
EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0),
|
||||||
fontWeight: FontWeight.w900,
|
child: Column(
|
||||||
),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
SizedBox(
|
//mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
height: spaceBetweenTextFileds,
|
children: [
|
||||||
),
|
AppText(
|
||||||
Container(
|
TranslationBase.of(context).medicines.toUpperCase(),
|
||||||
child: Form(
|
fontWeight: FontWeight.w900,
|
||||||
key: _formKey,
|
),
|
||||||
child: Column(
|
SizedBox(
|
||||||
//mainAxisAlignment: MainAxisAlignment.end,
|
height: spaceBetweenTextFileds,
|
||||||
children: [
|
),
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
child: Form(
|
||||||
borderRadius:
|
key: formKey,
|
||||||
BorderRadius.all(Radius.circular(6.0)),
|
child: Column(
|
||||||
border: Border.all(
|
//mainAxisAlignment: MainAxisAlignment.end,
|
||||||
width: 1.0, color: HexColor("#CCCCCC"))),
|
children: [
|
||||||
child: AppTextFormField(
|
Container(
|
||||||
labelText:
|
decoration: BoxDecoration(
|
||||||
TranslationBase.of(context).searchMedicine,
|
borderRadius: BorderRadius.all(
|
||||||
borderColor: Colors.white,
|
Radius.circular(6.0)),
|
||||||
textInputType: TextInputType.text,
|
border: Border.all(
|
||||||
inputFormatter: ONLY_LETTERS,
|
width: 1.0,
|
||||||
),
|
color: HexColor("#CCCCCC"))),
|
||||||
),
|
child: TextFields(
|
||||||
SizedBox(
|
hintText: TranslationBase.of(context)
|
||||||
height: spaceBetweenTextFileds,
|
.searchMedicine,
|
||||||
),
|
controller: drugIdController,
|
||||||
Container(
|
keyboardType: TextInputType.number,
|
||||||
decoration: BoxDecoration(
|
validator: (value) {
|
||||||
borderRadius:
|
if (value.isEmpty)
|
||||||
BorderRadius.all(Radius.circular(6.0)),
|
return TranslationBase.of(context)
|
||||||
border: Border.all(
|
.emptyMessage;
|
||||||
width: 1.0, color: HexColor("#CCCCCC"))),
|
else
|
||||||
child: AppTextFormField(
|
return null;
|
||||||
labelText: TranslationBase.of(context).orderType,
|
}),
|
||||||
borderColor: Colors.white,
|
),
|
||||||
textInputType: TextInputType.number,
|
SizedBox(
|
||||||
inputFormatter: ONLY_NUMBERS,
|
height: spaceBetweenTextFileds,
|
||||||
),
|
),
|
||||||
),
|
Container(
|
||||||
SizedBox(height: spaceBetweenTextFileds),
|
decoration: BoxDecoration(
|
||||||
Container(
|
borderRadius: BorderRadius.all(
|
||||||
decoration: BoxDecoration(
|
Radius.circular(6.0)),
|
||||||
borderRadius:
|
border: Border.all(
|
||||||
BorderRadius.all(Radius.circular(6.0)),
|
width: 1.0,
|
||||||
border: Border.all(
|
color: HexColor("#CCCCCC"))),
|
||||||
width: 1.0, color: HexColor("#CCCCCC"))),
|
child: TextFields(
|
||||||
child: AppTextFormField(
|
hintText:
|
||||||
labelText: TranslationBase.of(context).strength,
|
TranslationBase.of(context).orderType,
|
||||||
borderColor: Colors.white,
|
),
|
||||||
textInputType: TextInputType.number,
|
),
|
||||||
inputFormatter: ONLY_NUMBERS,
|
SizedBox(height: spaceBetweenTextFileds),
|
||||||
),
|
Container(
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
SizedBox(height: spaceBetweenTextFileds),
|
borderRadius: BorderRadius.all(
|
||||||
Container(
|
Radius.circular(6.0)),
|
||||||
decoration: BoxDecoration(
|
border: Border.all(
|
||||||
borderRadius:
|
width: 1.0,
|
||||||
BorderRadius.all(Radius.circular(6.0)),
|
color: HexColor("#CCCCCC"))),
|
||||||
border: Border.all(
|
child: TextFields(
|
||||||
width: 1.0, color: HexColor("#CCCCCC"))),
|
hintText:
|
||||||
child: AppTextFormField(
|
TranslationBase.of(context).strength,
|
||||||
labelText: TranslationBase.of(context).route,
|
keyboardType: TextInputType.number,
|
||||||
borderColor: Colors.white,
|
controller: strengthController,
|
||||||
textInputType: TextInputType.number,
|
validator: (value) {
|
||||||
inputFormatter: ONLY_NUMBERS,
|
if (value.isEmpty)
|
||||||
),
|
return TranslationBase.of(context)
|
||||||
),
|
.emptyMessage;
|
||||||
SizedBox(height: spaceBetweenTextFileds),
|
else
|
||||||
Container(
|
return null;
|
||||||
decoration: BoxDecoration(
|
},
|
||||||
borderRadius:
|
),
|
||||||
BorderRadius.all(Radius.circular(6.0)),
|
),
|
||||||
border: Border.all(
|
SizedBox(height: spaceBetweenTextFileds),
|
||||||
width: 1.0, color: HexColor("#CCCCCC"))),
|
Container(
|
||||||
child: AppTextFormField(
|
decoration: BoxDecoration(
|
||||||
labelText: TranslationBase.of(context).frequency,
|
borderRadius: BorderRadius.all(
|
||||||
borderColor: Colors.white,
|
Radius.circular(6.0)),
|
||||||
textInputType: TextInputType.number,
|
border: Border.all(
|
||||||
inputFormatter: ONLY_NUMBERS,
|
width: 1.0,
|
||||||
),
|
color: HexColor("#CCCCCC"))),
|
||||||
),
|
child: TextFields(
|
||||||
SizedBox(height: spaceBetweenTextFileds),
|
hintText: TranslationBase.of(context).route,
|
||||||
Container(
|
controller: routeController,
|
||||||
decoration: BoxDecoration(
|
keyboardType: TextInputType.number,
|
||||||
borderRadius:
|
validator: (value) {
|
||||||
BorderRadius.all(Radius.circular(6.0)),
|
if (value.isEmpty)
|
||||||
border: Border.all(
|
return TranslationBase.of(context)
|
||||||
width: 1.0, color: HexColor("#CCCCCC"))),
|
.emptyMessage;
|
||||||
child: AppTextFormField(
|
else
|
||||||
labelText: TranslationBase.of(context).doseTime,
|
return null;
|
||||||
borderColor: Colors.white,
|
},
|
||||||
textInputType: TextInputType.number,
|
),
|
||||||
inputFormatter: ONLY_NUMBERS,
|
),
|
||||||
),
|
SizedBox(height: spaceBetweenTextFileds),
|
||||||
),
|
Container(
|
||||||
SizedBox(height: spaceBetweenTextFileds),
|
decoration: BoxDecoration(
|
||||||
Container(
|
borderRadius: BorderRadius.all(
|
||||||
decoration: BoxDecoration(
|
Radius.circular(6.0)),
|
||||||
borderRadius:
|
border: Border.all(
|
||||||
BorderRadius.all(Radius.circular(6.0)),
|
width: 1.0,
|
||||||
border: Border.all(
|
color: HexColor("#CCCCCC"))),
|
||||||
width: 1.0, color: HexColor("#CCCCCC"))),
|
child: TextFields(
|
||||||
child: AppTextFormField(
|
hintText:
|
||||||
labelText: TranslationBase.of(context).indication,
|
TranslationBase.of(context).frequency,
|
||||||
borderColor: Colors.white,
|
controller: frequencyController,
|
||||||
textInputType: TextInputType.number,
|
keyboardType: TextInputType.number,
|
||||||
inputFormatter: ONLY_NUMBERS,
|
validator: (value) {
|
||||||
),
|
if (value.isEmpty)
|
||||||
),
|
return TranslationBase.of(context)
|
||||||
SizedBox(height: spaceBetweenTextFileds),
|
.emptyMessage;
|
||||||
Container(
|
else
|
||||||
decoration: BoxDecoration(
|
return null;
|
||||||
borderRadius:
|
},
|
||||||
BorderRadius.all(Radius.circular(6.0)),
|
),
|
||||||
border: Border.all(
|
),
|
||||||
width: 1.0, color: HexColor("#CCCCCC"))),
|
SizedBox(height: spaceBetweenTextFileds),
|
||||||
child: AppTextFormField(
|
Container(
|
||||||
labelText: TranslationBase.of(context).fromDate,
|
decoration: BoxDecoration(
|
||||||
borderColor: Colors.white,
|
borderRadius: BorderRadius.all(
|
||||||
textInputType: TextInputType.number,
|
Radius.circular(6.0)),
|
||||||
inputFormatter: ONLY_NUMBERS,
|
border: Border.all(
|
||||||
),
|
width: 1.0,
|
||||||
),
|
color: HexColor("#CCCCCC"))),
|
||||||
SizedBox(height: spaceBetweenTextFileds),
|
child: TextFields(
|
||||||
Container(
|
hintText:
|
||||||
decoration: BoxDecoration(
|
TranslationBase.of(context).doseTime,
|
||||||
borderRadius:
|
controller: doseController,
|
||||||
BorderRadius.all(Radius.circular(6.0)),
|
keyboardType: TextInputType.number,
|
||||||
border: Border.all(
|
validator: (value) {
|
||||||
width: 1.0, color: HexColor("#CCCCCC"))),
|
if (value.isEmpty)
|
||||||
child: AppTextFormField(
|
return TranslationBase.of(context)
|
||||||
labelText: TranslationBase.of(context).duration,
|
.emptyMessage;
|
||||||
borderColor: Colors.white,
|
else
|
||||||
textInputType: TextInputType.number,
|
return null;
|
||||||
inputFormatter: ONLY_NUMBERS,
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: spaceBetweenTextFileds),
|
SizedBox(height: spaceBetweenTextFileds),
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius:
|
borderRadius: BorderRadius.all(
|
||||||
BorderRadius.all(Radius.circular(6.0)),
|
Radius.circular(6.0)),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
width: 1.0, color: HexColor("#CCCCCC"))),
|
width: 1.0,
|
||||||
child: AppTextFormField(
|
color: HexColor("#CCCCCC"))),
|
||||||
labelText:
|
child: TextFields(
|
||||||
TranslationBase.of(context).instruction,
|
hintText:
|
||||||
borderColor: Colors.white,
|
TranslationBase.of(context).indication,
|
||||||
textInputType: TextInputType.number,
|
controller: indicationController,
|
||||||
inputFormatter: ONLY_NUMBERS,
|
keyboardType: TextInputType.number,
|
||||||
),
|
validator: (value) {
|
||||||
),
|
if (value.isEmpty)
|
||||||
SizedBox(height: spaceBetweenTextFileds),
|
return TranslationBase.of(context)
|
||||||
Container(
|
.emptyMessage;
|
||||||
margin:
|
else
|
||||||
EdgeInsets.all(SizeConfig.widthMultiplier * 5),
|
return null;
|
||||||
child: Wrap(
|
},
|
||||||
alignment: WrapAlignment.center,
|
),
|
||||||
children: <Widget>[
|
),
|
||||||
AppButton(
|
SizedBox(height: spaceBetweenTextFileds),
|
||||||
title:
|
Container(
|
||||||
TranslationBase.of(context).addMedication,
|
decoration: BoxDecoration(
|
||||||
onPressed: () {
|
borderRadius: BorderRadius.all(
|
||||||
Navigator.pop(context);
|
Radius.circular(6.0)),
|
||||||
prescriptionWarning(context);
|
border: Border.all(
|
||||||
},
|
width: 1.0,
|
||||||
|
color: HexColor("#CCCCCC"))),
|
||||||
|
child: TextFields(
|
||||||
|
hintText:
|
||||||
|
TranslationBase.of(context).fromDate,
|
||||||
|
keyboardType: TextInputType.datetime,
|
||||||
|
validator: (value) {
|
||||||
|
if (value.isEmpty)
|
||||||
|
return TranslationBase.of(context)
|
||||||
|
.emptyMessage;
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: spaceBetweenTextFileds),
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(6.0)),
|
||||||
|
border: Border.all(
|
||||||
|
width: 1.0,
|
||||||
|
color: HexColor("#CCCCCC"))),
|
||||||
|
child: TextFields(
|
||||||
|
hintText:
|
||||||
|
TranslationBase.of(context).duration,
|
||||||
|
// borderColor: Colors.white,
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
controller: durationController,
|
||||||
|
validator: (value) {
|
||||||
|
if (value.isEmpty)
|
||||||
|
return TranslationBase.of(context)
|
||||||
|
.emptyMessage;
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
SizedBox(height: spaceBetweenTextFileds),
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(6.0)),
|
||||||
|
border: Border.all(
|
||||||
|
width: 1.0,
|
||||||
|
color: HexColor("#CCCCCC"))),
|
||||||
|
child: TextFields(
|
||||||
|
hintText:
|
||||||
|
TranslationBase.of(context).instruction,
|
||||||
|
controller: indicationController,
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
validator: (value) {
|
||||||
|
if (value.isEmpty)
|
||||||
|
return TranslationBase.of(context)
|
||||||
|
.emptyMessage;
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: spaceBetweenTextFileds),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.all(
|
||||||
|
SizeConfig.widthMultiplier * 5),
|
||||||
|
child: Wrap(
|
||||||
|
alignment: WrapAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
AppButton(
|
||||||
|
title: TranslationBase.of(context)
|
||||||
|
.addMedication,
|
||||||
|
onPressed: () {
|
||||||
|
formKey.currentState.save();
|
||||||
|
|
||||||
|
if (formKey.currentState.validate()) {
|
||||||
|
postPrescription(
|
||||||
|
model: model,
|
||||||
|
duration: durationController.text,
|
||||||
|
dose: doseController.text,
|
||||||
|
frequency:
|
||||||
|
frequencyController.text,
|
||||||
|
route: routeController.text,
|
||||||
|
drugId: drugIdController.text,
|
||||||
|
strength: strengthController.text,
|
||||||
|
indication:
|
||||||
|
indicationController.text,
|
||||||
|
instruction:
|
||||||
|
indicationController.text,
|
||||||
|
);
|
||||||
|
Navigator.pop(context);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
// Navigator.push(
|
||||||
|
// context,
|
||||||
|
// MaterialPageRoute(
|
||||||
|
// builder: (context) =>
|
||||||
|
// NewPrescriptionScreen()),
|
||||||
|
// );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
);
|
||||||
),
|
});
|
||||||
),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
postPrescription(
|
||||||
|
{String duration,
|
||||||
|
String dose,
|
||||||
|
String drugId,
|
||||||
|
String strength,
|
||||||
|
String route,
|
||||||
|
String frequency,
|
||||||
|
String indication,
|
||||||
|
String instruction,
|
||||||
|
PrescriptionViewModel model}) async {
|
||||||
|
PostPrescriptionReqModel postProcedureReqModel =
|
||||||
|
new PostPrescriptionReqModel();
|
||||||
|
List<PrescriptionRequestModel> sss = List();
|
||||||
|
|
||||||
|
postProcedureReqModel.appointmentNo = 2016055159;
|
||||||
|
postProcedureReqModel.clinicID = 17;
|
||||||
|
postProcedureReqModel.episodeID = 200012330;
|
||||||
|
postProcedureReqModel.patientMRN = 3120877;
|
||||||
|
postProcedureReqModel.vidaAuthTokenID =
|
||||||
|
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiOGFjNDRjZGQtOWE0Mi00M2YxLWE2YTQtMWQ4NzBmZmYwNTUyIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTU2NDkiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA4NzM2NjY5LCJleHAiOjE2MDk2MDA2NjksImlhdCI6MTYwODczNjY2OX0.9EDgYrbe5fQA2CvgLdFT4s_PL7hD5R_Qggfpv4lDtUY";
|
||||||
|
sss.add(PrescriptionRequestModel(
|
||||||
|
covered: true,
|
||||||
|
dose: int.parse(dose),
|
||||||
|
itemId: int.parse(drugId),
|
||||||
|
doseUnitId: 1,
|
||||||
|
route: int.parse(route),
|
||||||
|
frequency: int.parse(frequency),
|
||||||
|
remarks: instruction,
|
||||||
|
approvalRequired: true,
|
||||||
|
icdcode10Id: "test2",
|
||||||
|
doseTime: 1,
|
||||||
|
duration: int.parse(duration),
|
||||||
|
doseStartDate: "2020-12-20T13:07:41.769Z"));
|
||||||
|
postProcedureReqModel.prescriptionRequestModel = sss;
|
||||||
|
//postProcedureReqModel.procedures = controlsProcedure;
|
||||||
|
|
||||||
|
await model.postPrescription(postProcedureReqModel);
|
||||||
|
|
||||||
|
if (model.state == ViewState.ErrorLocal) {
|
||||||
|
helpers.showErrorToast(model.error);
|
||||||
|
} else if (model.state == ViewState.Idle) {
|
||||||
|
DrAppToastMsg.showSuccesToast('Medication has been added');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue