Merge branch 'design-updates' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into search_in_soap

 Conflicts:
	lib/screens/patients/patient_search_screen.dart
pull/208/head
Mohammad Aljammal 5 years ago
commit b60b45ab53

@ -136,7 +136,7 @@ const POST_ASSESSMENT =
'Services/DoctorApplication.svc/REST/PostAssessment'; 'Services/DoctorApplication.svc/REST/PostAssessment';
const GET_CATEGORISE_PROCEDURE = const GET_CATEGORISE_PROCEDURE =
'Services/DoctorApplication.svc/REST/GetCategories'; 'Services/DoctorApplication.svc/REST/GetProcedure';
var selectedPatientType = 1; var selectedPatientType = 1;

@ -7,12 +7,11 @@ class PostPrescriptionReqModel {
List<PrescriptionRequestModel> prescriptionRequestModel; List<PrescriptionRequestModel> prescriptionRequestModel;
PostPrescriptionReqModel( PostPrescriptionReqModel(
{this.vidaAuthTokenID = {this.vidaAuthTokenID,
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiYTYxZjAyZjItNzUwZS00MTZkLWEzOTQtZTRjZmViZGVjMDE5IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUzNTIiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODUzMDAyNywiZXhwIjoxNjA5Mzk0MDI3LCJpYXQiOjE2MDg1MzAwMjd9.M1NTREPgz5vQH_GTZ_KGb0xQW5HEDs47AtNR3jbqnms", this.clinicID,
this.clinicID = 1, this.episodeID,
this.episodeID = 200012117, this.appointmentNo,
this.appointmentNo = 2016054573, this.patientMRN,
this.patientMRN = 3120690,
this.prescriptionRequestModel}); this.prescriptionRequestModel});
PostPrescriptionReqModel.fromJson(Map<String, dynamic> json) { PostPrescriptionReqModel.fromJson(Map<String, dynamic> json) {
@ -58,19 +57,20 @@ class PrescriptionRequestModel {
String remarks; String remarks;
String icdcode10Id; String icdcode10Id;
PrescriptionRequestModel( PrescriptionRequestModel({
{this.itemId = 4, this.itemId,
this.doseStartDate = "2020-12-20T13:07:41.769Z", this.doseStartDate,
this.duration = 2, this.duration,
this.dose = 1, this.dose,
this.doseUnitId = 1, this.doseUnitId,
this.route = 1, this.route,
this.frequency = 1, this.frequency,
this.doseTime = 1, this.doseTime,
this.covered = true, this.covered,
this.approvalRequired = true, this.approvalRequired,
this.remarks = "test1", this.remarks,
this.icdcode10Id = "test3"}); this.icdcode10Id,
});
PrescriptionRequestModel.fromJson(Map<String, dynamic> json) { PrescriptionRequestModel.fromJson(Map<String, dynamic> json) {
itemId = json['itemId']; itemId = json['itemId'];

@ -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;
} }
} }

@ -9,7 +9,7 @@ class PrescriptionService extends BaseService {
List<PrescriptionModel> get prescriptionList => _prescriptionList; List<PrescriptionModel> get prescriptionList => _prescriptionList;
PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel( PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel(
patientMRN: 1231755, patientMRN: 3120877,
vidaAuthTokenID: vidaAuthTokenID:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyODA0IiwianRpIjoiNzNiNmUyZDctMjA0ZC00NzAyLTkxMDYtODE3MzI3OTZkYzI5IiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMjgwNCIsIk5hbWUiOiJNVUhBTU1BRCBBWkFNIiwiRW1wbG95ZWVJZCI6IjE0ODUiLCJGYWNpbGl0eUdyb3VwSWQiOiIwMTAyNjYiLCJGYWNpbGl0eUlkIjoiMTUiLCJQaGFyYW1jeUZhY2lsaXR5SWQiOiI1NSIsIklTX1BIQVJNQUNZX0NPTk5FQ1RFRCI6IlRydWUiLCJEb2N0b3JJZCI6IjE0ODUiLCJTRVNTSU9OSUQiOiIyMTU3NjIwOSIsIkNsaW5pY0lkIjoiMyIsInJvbGUiOlsiU0VDVVJJVFkgQURNSU5JU1RSQVRPUlMiLCJTRVRVUCBBRE1JTklTVFJBVE9SUyIsIkNFTydTIiwiRVhFQ1VUSVZFIERJUkVDVE9SUyIsIk1BTkFHRVJTIiwiU1VQRVJWSVNPUlMiLCJDTElFTlQgU0VSVklDRVMgQ09PUkRJTkFUT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIFNVUEVSVklTT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIE1BTkdFUlMiLCJIRUFEIE5VUlNFUyIsIkRPQ1RPUlMiLCJDSElFRiBPRiBNRURJQ0FMIFNUQUZGUyIsIkJJTy1NRURJQ0FMIFRFQ0hOSUNJQU5TIiwiQklPLU1FRElDQUwgRU5HSU5FRVJTIiwiQklPLU1FRElDQUwgREVQQVJUTUVOVCBIRUFEUyIsIklUIEhFTFAgREVTSyIsIkFETUlOSVNUUkFUT1JTIiwiTEFCIEFETUlOSVNUUkFUT1IiLCJMQUIgVEVDSE5JQ0lBTiIsIkJVU0lORVNTIE9GRklDRSBTVEFGRiIsIkZJTkFOQ0UgQUNDT1VOVEFOVFMiLCJQSEFSTUFDWSBTVEFGRiIsIkFDQ09VTlRTIFNUQUZGIiwiTEFCIFJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiSU5QQVRJRU5UIEJJTExJTkcgU1VQRVJWSVNPUiIsIkxEUi1PUiBOVVJTRVMiLCJBRE1JU1NJT04gU1RBRkYiLCJIRUxQIERFU0sgQURNSU4iLCJBUFBST1ZBTCBTVEFGRiIsIklOUEFUSUVOVCBCSUxMSU5HIENPT1JESU5BVE9SIiwiQklMTElORyBTVEFGRiIsIkNPTlNFTlQgIiwiQ29uc2VudCAtIERlbnRhbCIsIldFQkVNUiJdLCJuYmYiOjE2MDgyMzY2MjAsImV4cCI6MTYwOTEwMDYyMCwiaWF0IjoxNjA4MjM2NjIwfQ.z4Lh0dCRr9GWXvaTo7x5GPV7R5z8ONyh3-0uk3PXMu8", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyODA0IiwianRpIjoiNzNiNmUyZDctMjA0ZC00NzAyLTkxMDYtODE3MzI3OTZkYzI5IiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMjgwNCIsIk5hbWUiOiJNVUhBTU1BRCBBWkFNIiwiRW1wbG95ZWVJZCI6IjE0ODUiLCJGYWNpbGl0eUdyb3VwSWQiOiIwMTAyNjYiLCJGYWNpbGl0eUlkIjoiMTUiLCJQaGFyYW1jeUZhY2lsaXR5SWQiOiI1NSIsIklTX1BIQVJNQUNZX0NPTk5FQ1RFRCI6IlRydWUiLCJEb2N0b3JJZCI6IjE0ODUiLCJTRVNTSU9OSUQiOiIyMTU3NjIwOSIsIkNsaW5pY0lkIjoiMyIsInJvbGUiOlsiU0VDVVJJVFkgQURNSU5JU1RSQVRPUlMiLCJTRVRVUCBBRE1JTklTVFJBVE9SUyIsIkNFTydTIiwiRVhFQ1VUSVZFIERJUkVDVE9SUyIsIk1BTkFHRVJTIiwiU1VQRVJWSVNPUlMiLCJDTElFTlQgU0VSVklDRVMgQ09PUkRJTkFUT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIFNVUEVSVklTT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIE1BTkdFUlMiLCJIRUFEIE5VUlNFUyIsIkRPQ1RPUlMiLCJDSElFRiBPRiBNRURJQ0FMIFNUQUZGUyIsIkJJTy1NRURJQ0FMIFRFQ0hOSUNJQU5TIiwiQklPLU1FRElDQUwgRU5HSU5FRVJTIiwiQklPLU1FRElDQUwgREVQQVJUTUVOVCBIRUFEUyIsIklUIEhFTFAgREVTSyIsIkFETUlOSVNUUkFUT1JTIiwiTEFCIEFETUlOSVNUUkFUT1IiLCJMQUIgVEVDSE5JQ0lBTiIsIkJVU0lORVNTIE9GRklDRSBTVEFGRiIsIkZJTkFOQ0UgQUNDT1VOVEFOVFMiLCJQSEFSTUFDWSBTVEFGRiIsIkFDQ09VTlRTIFNUQUZGIiwiTEFCIFJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiSU5QQVRJRU5UIEJJTExJTkcgU1VQRVJWSVNPUiIsIkxEUi1PUiBOVVJTRVMiLCJBRE1JU1NJT04gU1RBRkYiLCJIRUxQIERFU0sgQURNSU4iLCJBUFBST1ZBTCBTVEFGRiIsIklOUEFUSUVOVCBCSUxMSU5HIENPT1JESU5BVE9SIiwiQklMTElORyBTVEFGRiIsIkNPTlNFTlQgIiwiQ29uc2VudCAtIERlbnRhbCIsIldFQkVNUiJdLCJuYmYiOjE2MDgyMzY2MjAsImV4cCI6MTYwOTEwMDYyMCwiaWF0IjoxNjA4MjM2NjIwfQ.z4Lh0dCRr9GWXvaTo7x5GPV7R5z8ONyh3-0uk3PXMu8",
); );
@ -30,19 +30,20 @@ class PrescriptionService extends BaseService {
}, body: _prescriptionReqModel.toJson()); }, body: _prescriptionReqModel.toJson());
} }
Future postPrescription() async { Future postPrescription(
PostPrescriptionReqModel postProcedureReqModel) async {
hasError = false; hasError = false;
//_prescriptionList.clear(); //_prescriptionList.clear();
await baseAppClient.post( await baseAppClient.post(
GET_CATEGORISE_PROCEDURE, POST_PRESCRIPTION_LIST,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_prescriptionList print("Success");
.add(PrescriptionModel.fromJson(response['PrescriptionList']));
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, },
body: postProcedureReqModel.toJson(),
); );
} }
} }

@ -13,11 +13,6 @@ class ProcedureService extends BaseService {
List<CategoriseProcedureModel> get categoriesList => _categoriesList; List<CategoriseProcedureModel> get categoriesList => _categoriesList;
List<Procedures> procedureslist = List(); List<Procedures> procedureslist = List();
Procedures t1 = Procedures(
category: '02',
procedure: '02011002',
);
GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel( GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel(
clinicId: 0, clinicId: 0,
pageSize: 10, pageSize: 10,
@ -29,8 +24,17 @@ class ProcedureService extends BaseService {
search: ["lab"], search: ["lab"],
); );
GetProcedureReqModel _getProcedureCategoriseReqModel = GetProcedureReqModel(
clinicId: 0,
pageSize: 100,
pageIndex: 1,
patientMRN: 0,
//categoryId: null,
vidaAuthTokenID:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI",
PostProcedureReqModel _postProcedureReqModel = PostProcedureReqModel(); search: ["lab"],
);
Future getProcedure() async { Future getProcedure() async {
hasError = false; hasError = false;
@ -47,17 +51,14 @@ class ProcedureService extends BaseService {
Future getCategories() async { Future getCategories() async {
hasError = false; hasError = false;
_categoriesList.clear(); _categoriesList.clear();
await baseAppClient.post( await baseAppClient.post(GET_CATEGORISE_PROCEDURE,
GET_CATEGORISE_PROCEDURE,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_categoriesList _categoriesList
.add(CategoriseProcedureModel.fromJson(response['listCategories'])); .add(CategoriseProcedureModel.fromJson(response['ProcedureList']));
}, }, onFailure: (String error, int statusCode) {
onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, }, body: _getProcedureCategoriseReqModel.toJson());
);
} }
Future postProcedure(PostProcedureReqModel postProcedureReqModel) async { Future postProcedure(PostProcedureReqModel postProcedureReqModel) async {

@ -24,15 +24,18 @@ class PrescriptionViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future postPrescription() async { Future postPrescription(
PostPrescriptionReqModel postProcedureReqModel) async {
hasError = false; hasError = false;
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionService.postPrescription(); await _prescriptionService.postPrescription(postProcedureReqModel);
if (_prescriptionService.hasError) { if (_prescriptionService.hasError) {
error = _prescriptionService.error; error = _prescriptionService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else {
await getPrescription();
setState(ViewState.Idle); setState(ViewState.Idle);
} }
}
} }

@ -45,7 +45,9 @@ class ProcedureViewModel extends BaseViewModel {
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else {
await getProcedure();
setState(ViewState.Idle); setState(ViewState.Idle);
} }
}
} }

@ -1,26 +1,49 @@
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 DraggableScrollableSheet(
initialChildSize: 0.90,
maxChildSize: 0.90,
minChildSize: 0.9,
builder: (BuildContext context, ScrollController scrollController) {
return SingleChildScrollView( return SingleChildScrollView(
child: Container( child: Container(
height: 700, height: 980,
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), padding:
EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
//mainAxisAlignment: MainAxisAlignment.spaceEvenly, //mainAxisAlignment: MainAxisAlignment.spaceEvenly,
@ -34,166 +57,257 @@ void addPrescriptionForm(context) {
), ),
Container( Container(
child: Form( child: Form(
key: _formKey, key: formKey,
child: Column( child: Column(
//mainAxisAlignment: MainAxisAlignment.end, //mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
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).searchMedicine, hintText: TranslationBase.of(context)
borderColor: Colors.white, .searchMedicine,
textInputType: TextInputType.text, controller: drugIdController,
inputFormatter: ONLY_LETTERS, keyboardType: TextInputType.number,
), validator: (value) {
if (value.isEmpty)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
}),
), ),
SizedBox( SizedBox(
height: spaceBetweenTextFileds, 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: TranslationBase.of(context).orderType, child: TextFields(
borderColor: Colors.white, hintText:
textInputType: TextInputType.number, TranslationBase.of(context).orderType,
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: TranslationBase.of(context).strength, child: TextFields(
borderColor: Colors.white, hintText:
textInputType: TextInputType.number, TranslationBase.of(context).strength,
inputFormatter: ONLY_NUMBERS, keyboardType: TextInputType.number,
controller: strengthController,
validator: (value) {
if (value.isEmpty)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
},
), ),
), ),
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: TranslationBase.of(context).route, child: TextFields(
borderColor: Colors.white, hintText: TranslationBase.of(context).route,
textInputType: TextInputType.number, controller: routeController,
inputFormatter: ONLY_NUMBERS, keyboardType: TextInputType.number,
validator: (value) {
if (value.isEmpty)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
},
), ),
), ),
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: TranslationBase.of(context).frequency, child: TextFields(
borderColor: Colors.white, hintText:
textInputType: TextInputType.number, TranslationBase.of(context).frequency,
inputFormatter: ONLY_NUMBERS, controller: frequencyController,
keyboardType: TextInputType.number,
validator: (value) {
if (value.isEmpty)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
},
), ),
), ),
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: TranslationBase.of(context).doseTime, child: TextFields(
borderColor: Colors.white, hintText:
textInputType: TextInputType.number, TranslationBase.of(context).doseTime,
inputFormatter: ONLY_NUMBERS, controller: doseController,
keyboardType: TextInputType.number,
validator: (value) {
if (value.isEmpty)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
},
), ),
), ),
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: TranslationBase.of(context).indication, child: TextFields(
borderColor: Colors.white, hintText:
textInputType: TextInputType.number, TranslationBase.of(context).indication,
inputFormatter: ONLY_NUMBERS, controller: indicationController,
keyboardType: TextInputType.number,
validator: (value) {
if (value.isEmpty)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
},
), ),
), ),
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: TranslationBase.of(context).fromDate, child: TextFields(
borderColor: Colors.white, hintText:
textInputType: TextInputType.number, TranslationBase.of(context).fromDate,
inputFormatter: ONLY_NUMBERS, keyboardType: TextInputType.datetime,
validator: (value) {
if (value.isEmpty)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
},
), ),
), ),
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: TranslationBase.of(context).duration, child: TextFields(
borderColor: Colors.white, hintText:
textInputType: TextInputType.number, TranslationBase.of(context).duration,
inputFormatter: ONLY_NUMBERS, // borderColor: Colors.white,
), keyboardType: TextInputType.number,
controller: durationController,
validator: (value) {
if (value.isEmpty)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
}),
), ),
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(
hintText:
TranslationBase.of(context).instruction, TranslationBase.of(context).instruction,
borderColor: Colors.white, controller: indicationController,
textInputType: TextInputType.number, keyboardType: TextInputType.number,
inputFormatter: ONLY_NUMBERS, validator: (value) {
if (value.isEmpty)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
},
), ),
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFileds),
Container( Container(
margin: margin: EdgeInsets.all(
EdgeInsets.all(SizeConfig.widthMultiplier * 5), SizeConfig.widthMultiplier * 5),
child: Wrap( child: Wrap(
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
AppButton( AppButton(
title: title: TranslationBase.of(context)
TranslationBase.of(context).addMedication, .addMedication,
onPressed: () { 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.pop(context);
prescriptionWarning(context); }
{
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) =>
// NewPrescriptionScreen()),
// );
}
}, },
), ),
], ],
@ -209,4 +323,50 @@ void addPrescriptionForm(context) {
), ),
); );
}); });
});
}
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');
}
} }

@ -110,8 +110,8 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
addPrescriptionForm(context); addPrescriptionForm(context, model);
model.postPrescription(); //model.postPrescription();
}, },
child: CircleAvatar( child: CircleAvatar(
radius: 65, radius: 65,
@ -156,7 +156,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
], ],
) )
: Padding( : Padding(
padding: EdgeInsets.all(12.0), padding: EdgeInsets.all(14.0),
child: NetworkBaseView( child: NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: Column( child: Column(
@ -194,8 +194,8 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
), ),
), ),
onTap: () { onTap: () {
addPrescriptionForm(context); addPrescriptionForm(context, model);
model.postPrescription(); //model.postPrescription();
}, },
), ),
SizedBox( SizedBox(
@ -204,19 +204,22 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
...List.generate( ...List.generate(
model.prescriptionList[0].rowcount, model.prescriptionList[0].rowcount,
(index) => Container( (index) => Container(
//height: 240,
child: Column( child: Column(
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment MainAxisAlignment
.spaceBetween, .spaceBetween,
// crossAxisAlignment:
// CrossAxisAlignment.start,
children: [ children: [
Container( Container(
height: height:
MediaQuery.of(context) MediaQuery.of(context)
.size .size
.height * .height *
0.2, 0.23,
width: width:
MediaQuery.of(context) MediaQuery.of(context)
.size .size
@ -236,12 +239,12 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
MediaQuery.of(context) MediaQuery.of(context)
.size .size
.height * .height *
0.24, 0.282,
width: width:
MediaQuery.of(context) MediaQuery.of(context)
.size .size
.width * .width *
0.81, 0.77,
child: Column( child: Column(
children: [ children: [
Row( Row(
@ -250,17 +253,20 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
'Start Date:', 'Start Date:',
fontWeight: fontWeight:
FontWeight FontWeight
.w900, .w700,
fontSize: 15.0, fontSize: 14.0,
), ),
AppText( Expanded(
child: AppText(
model model
.prescriptionList[ .prescriptionList[
0] 0]
.entityList[ .entityList[
index] index]
.startDate, .startDate,
fontSize: 11.0, fontSize:
12.0,
),
), ),
SizedBox( SizedBox(
width: 6.0, width: 6.0,
@ -269,22 +275,25 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
'Order Type:', 'Order Type:',
fontWeight: fontWeight:
FontWeight FontWeight
.w900, .w700,
fontSize: 15.0, fontSize: 14.0,
), ),
AppText( Expanded(
child: AppText(
model model
.prescriptionList[ .prescriptionList[
0] 0]
.entityList[ .entityList[
index] index]
.orderTypeDescription, .orderTypeDescription,
fontSize: 13.0, fontSize:
13.0,
),
), ),
], ],
), ),
SizedBox( SizedBox(
height: 2.5, height: 5.5,
), ),
Row( Row(
children: [ children: [
@ -298,11 +307,19 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
.entityList[ .entityList[
index] index]
.medicationName, .medicationName,
fontWeight:
FontWeight
.w700,
fontSize:
15.0,
), ),
), ),
) )
], ],
), ),
SizedBox(
height: 5.5,
),
Row( Row(
children: [ children: [
Expanded( Expanded(
@ -314,7 +331,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
index] index]
.doseDetail, .doseDetail,
fontSize: fontSize:
13.0, 15.0,
), ),
) )
], ],
@ -328,7 +345,8 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
'Indication: ', 'Indication: ',
fontWeight: fontWeight:
FontWeight FontWeight
.w900, .w700,
fontSize: 17.0,
), ),
Expanded( Expanded(
child: AppText( child: AppText(
@ -339,16 +357,17 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
index] index]
.indication, .indication,
fontSize: fontSize:
12.9), 15.0),
) )
], ],
), ),
SizedBox( SizedBox(
height: 15.0, height: 18.0,
), ),
Row( Row(
children: [ children: [
AppText( Expanded(
child: AppText(
model model
.prescriptionList[ .prescriptionList[
0] 0]
@ -357,22 +376,29 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
.doctorName, .doctorName,
fontWeight: fontWeight:
FontWeight FontWeight
.w900, .w700,
),
) )
], ],
), ),
Row( Row(
children: [ children: [
AppText(model Expanded(
child: AppText(
model
.prescriptionList[ .prescriptionList[
0] 0]
.entityList[ .entityList[
index] index]
.remarks), .remarks,
fontSize:
14.0,
),
),
], ],
), ),
SizedBox( SizedBox(
height: 15.0, height: 10.0,
), ),
Divider( Divider(
@ -386,6 +412,23 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
], ],
), ),
), ),
Container(
height:
MediaQuery.of(context)
.size
.height *
0.05,
width:
MediaQuery.of(context)
.size
.width *
0.06,
child: Column(
children: [
Icon(Icons.edit)
],
),
),
], ],
), ),
], ],

@ -111,7 +111,10 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
addSelectedProcedure(context); model.getCategories().then((value) {
addSelectedProcedure(context, model);
});
//model.postPrescription(); //model.postPrescription();
}, },
child: CircleAvatar( child: CircleAvatar(
@ -149,7 +152,7 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
AppText( AppText(
TranslationBase.of(context).addNow, TranslationBase.of(context).addNow,
color: Color(0XFFB8382C), color: Color(0XFFB8382C),
fontWeight: FontWeight.w900, fontWeight: FontWeight.w700,
), ),
], ],
), ),
@ -194,7 +197,12 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
), ),
), ),
onTap: () { onTap: () {
addSelectedProcedure(context); model.getCategories().then((value) {
addSelectedProcedure(
context, model);
});
//model.postPrescription();
}, },
), ),
// Container( // Container(
@ -252,7 +260,7 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
'Code #: ', 'Code #: ',
fontWeight: fontWeight:
FontWeight FontWeight
.w900, .w700,
fontSize: 15.0, fontSize: 15.0,
), ),
AppText( AppText(
@ -272,7 +280,7 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
'Order Type: ', 'Order Type: ',
fontWeight: fontWeight:
FontWeight FontWeight
.w900, .w700,
fontSize: 15.0, fontSize: 15.0,
), ),
AppText( AppText(
@ -310,7 +318,7 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
'Price: ', 'Price: ',
fontWeight: fontWeight:
FontWeight FontWeight
.w900, .w700,
), ),
Expanded( Expanded(
child: AppText( child: AppText(
@ -382,7 +390,6 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
} }
postProcedure({ProcedureViewModel model}) async { postProcedure({ProcedureViewModel model}) async {
model = new ProcedureViewModel();
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
List<Controls> controls = List(); List<Controls> controls = List();
List<Procedures> controlsProcedure = List(); List<Procedures> controlsProcedure = List();
@ -402,22 +409,40 @@ postProcedure({ProcedureViewModel model}) async {
postProcedureReqModel.procedures = controlsProcedure; postProcedureReqModel.procedures = controlsProcedure;
await model.postProcedure(postProcedureReqModel); await model.postProcedure(postProcedureReqModel);
DrAppToastMsg.showSuccesToast('Procedure had been added');
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); helpers.showErrorToast(model.error);
} else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been added');
} }
} }
void addSelectedProcedure(context) { void addSelectedProcedure(context, ProcedureViewModel model) {
TextEditingController procedureController = TextEditingController();
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
builder: (BuildContext bc) { builder: (BuildContext bc) {
return BaseView( return AddSelectedProcedure(
//onModelReady: (model) => model.getCategories(), model: model,
builder: );
(BuildContext context, ProcedureViewModel model, Widget child) => });
SingleChildScrollView( }
class AddSelectedProcedure extends StatefulWidget {
final ProcedureViewModel model;
const AddSelectedProcedure({Key key, this.model}) : super(key: key);
@override
_AddSelectedProcedureState createState() => _AddSelectedProcedureState();
}
class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
TextEditingController procedureController = TextEditingController();
@override
Widget build(BuildContext context) {
return NetworkBaseView(
baseViewModel: widget.model,
child: SingleChildScrollView(
child: Container( child: Container(
height: 490, height: 490,
child: Padding( child: Padding(
@ -429,17 +454,86 @@ void addSelectedProcedure(context) {
'Select Procedure'.toUpperCase(), 'Select Procedure'.toUpperCase(),
fontWeight: FontWeight.w900, fontWeight: FontWeight.w900,
), ),
// Text(model.categoriesList[0].categoryName), if (widget.model.categoriesList.length != 0)
Container(
// child: ListView(
// children: [
// Column(
// children: model.historyFamilyList
// .map((historyInfo) {
// return Column(
// children: [
// Row(
// children: [
// Checkbox(
// value: isServiceSelected(
// historyInfo),
// activeColor:
// Colors.red[800],
// onChanged:
// (bool newValue) {
// setState(() {
// if (isServiceSelected(
// historyInfo
// )) {
// widget
// .removeHistory(
// historyInfo
// );
// }
// else {
// widget
// .myHistoryList
// .add(
// historyInfo);
// }
// });
// }),
// Expanded(
// child: Padding(
// padding:
// const EdgeInsets
// .symmetric(
// horizontal: 10,
// vertical: 0),
// child: Texts(
// historyInfo.nameEn,
// variant: "bodyText",
// bold: true,
// color:
// Colors.black),
// ),
// ),
// ],
// ),
// DividerWithSpacesAround(),
// ],
// );
// }).toList(),
// ),
// ],
// ),
height: 120.0,
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: widget.model.categoriesList[0].rowcount,
itemBuilder: (BuildContext ctxt, int index) {
return Container(
child: AppText(widget.model.categoriesList[0]
.entityList[index].procedureName),
);
}),
),
SizedBox( SizedBox(
height: 9.0, height: 0.0,
), ),
Column( Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.all(Radius.circular(6.0)),
BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))), width: 1.0, color: HexColor("#CCCCCC"))),
child: AppTextFormField( child: AppTextFormField(
@ -451,20 +545,18 @@ void addSelectedProcedure(context) {
), ),
), ),
SizedBox( SizedBox(
height: 280.0, height: 80.0,
), ),
Container( Container(
margin: margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap( child: Wrap(
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
AppButton( AppButton(
title: title: TranslationBase.of(context).addMedication,
TranslationBase.of(context).addMedication,
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
postProcedure(); postProcedure(model: widget.model);
}, },
), ),
], ],
@ -478,5 +570,87 @@ void addSelectedProcedure(context) {
), ),
), ),
); );
}
}
// isServiceSelected(ProcedureViewModel masterKey) {
// Iterable<MasterKeyModel> history = widget.myHistoryList.where((element) =>
// masterKey.id == element.id && masterKey.typeId == element.typeId);
// if (history.length > 0) {
// return true;
// }
// return false;
// }
void updateProcedureForm(context) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext bc) {
return Container(
height: 500,
child: Form(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
'Procedure Name'.toUpperCase(),
fontWeight: FontWeight.w900,
),
SizedBox(
height: 30.0,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: AppTextFormField(
labelText: 'Order ',
borderColor: Colors.white,
textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS,
),
),
SizedBox(
height: 12.0,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: AppTextFormField(
labelText: 'Password',
borderColor: Colors.white,
textInputType: TextInputType.text,
inputFormatter: ONLY_LETTERS,
obscureText: true,
),
),
SizedBox(
height: 190.0,
),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: 'CONTINUE',
onPressed: () {
Navigator.pop(context);
// authorizationForm(context);
},
),
],
),
),
],
),
),
));
}); });
} }

@ -24,9 +24,13 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class SubjectivePage extends StatefulWidget { class SubjectivePage extends StatefulWidget {
final Function changePageViewIndex; final Function changePageViewIndex;
final List<MySelectedAllergy> myAllergiesList; final List<MySelectedAllergy> myAllergiesList;
final List<MasterKeyModel> myHistoryList ; final List<MasterKeyModel> myHistoryList;
SubjectivePage({Key key, this.changePageViewIndex, this.myAllergiesList, this.myHistoryList}); SubjectivePage(
{Key key,
this.changePageViewIndex,
this.myAllergiesList,
this.myHistoryList});
@override @override
_SubjectivePageState createState() => _SubjectivePageState(); _SubjectivePageState createState() => _SubjectivePageState();
@ -102,13 +106,11 @@ class _SubjectivePageState extends State<SubjectivePage> {
minLines: 13, minLines: 13,
controller: complaintsController, controller: complaintsController,
validator: (value) { validator: (value) {
if (value == null || value =="") if (value == null || value == "")
return TranslationBase return TranslationBase.of(context)
.of(context)
.emptyMessage; .emptyMessage;
else if (value.length < 25) else if (value.length < 25)
return TranslationBase return TranslationBase.of(context)
.of(context)
.chiefComplaintLength; .chiefComplaintLength;
//""; //"";
else else
@ -129,9 +131,8 @@ class _SubjectivePageState extends State<SubjectivePage> {
minLines: 13, minLines: 13,
controller: illnessController, controller: illnessController,
validator: (value) { validator: (value) {
if (value == null || value =="") if (value == null || value == "")
return TranslationBase return TranslationBase.of(context)
.of(context)
.emptyMessage; .emptyMessage;
else else
return null; return null;
@ -146,7 +147,6 @@ class _SubjectivePageState extends State<SubjectivePage> {
), ),
isExpand: isChiefExpand, isExpand: isChiefExpand,
), ),
SizedBox( SizedBox(
height: 30, height: 30,
), ),
@ -222,15 +222,16 @@ class _SubjectivePageState extends State<SubjectivePage> {
: EvaIcons.plus)) : EvaIcons.plus))
], ],
), ),
bodyWidget:Column( bodyWidget: Column(
children: [ children: [
AddAllergiesWidget(myAllergiesList: widget.myAllergiesList,), AddAllergiesWidget(
myAllergiesList: widget.myAllergiesList,
),
SizedBox( SizedBox(
height: 30, height: 30,
), ),
], ],
) ),
,
isExpand: isAllergiesExpand, isExpand: isAllergiesExpand,
), ),
SizedBox( SizedBox(
@ -308,7 +309,6 @@ class _SubjectivePageState extends State<SubjectivePage> {
// } else { // } else {
// helpers.showErrorToast('Please add required field correctly'); // helpers.showErrorToast('Please add required field correctly');
// } // }
} }
postAllergy( postAllergy(
@ -320,8 +320,8 @@ class _SubjectivePageState extends State<SubjectivePage> {
null) null)
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
//TODO: make static value dynamic //TODO: make static value dynamic
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(
.add(ListHisProgNotePatientAllergyDiseaseVM( ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id, allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.typeId, allergyDiseaseType: allergy.selectedAllergy.typeId,
patientMRN: 3120690, patientMRN: 3120690,
@ -331,9 +331,11 @@ class _SubjectivePageState extends State<SubjectivePage> {
remarks: allergy.remark, remarks: allergy.remark,
createdBy: 1485, createdBy: 1485,
// //
createdOn: DateTime.now().toIso8601String(),//"2020-08-14T20:37:22.780Z", createdOn: DateTime.now()
.toIso8601String(), //"2020-08-14T20:37:22.780Z",
editedBy: 1485, editedBy: 1485,
editedOn: DateTime.now().toIso8601String(),//"2020-08-14T20:37:22.780Z", editedOn: DateTime.now()
.toIso8601String(), //"2020-08-14T20:37:22.780Z",
isChecked: false, isChecked: false,
isUpdatedByNurse: false)); isUpdatedByNurse: false));
}); });
@ -371,7 +373,7 @@ class _SubjectivePageState extends State<SubjectivePage> {
postChiefComplaint({SOAPViewModel model}) async { postChiefComplaint({SOAPViewModel model}) async {
formKey.currentState.save(); formKey.currentState.save();
if(formKey.currentState.validate()){ if (formKey.currentState.validate()) {
PostChiefComplaintRequestModel postChiefComplaintRequestModel = PostChiefComplaintRequestModel postChiefComplaintRequestModel =
//TODO: make static value dynamic //TODO: make static value dynamic
new PostChiefComplaintRequestModel( new PostChiefComplaintRequestModel(
@ -386,8 +388,6 @@ class _SubjectivePageState extends State<SubjectivePage> {
numberOfWeeks: 22); numberOfWeeks: 22);
await model.postChiefComplaint(postChiefComplaintRequestModel); await model.postChiefComplaint(postChiefComplaintRequestModel);
} }
} }
} }

Loading…
Cancel
Save