Merge branch 'feature-ucaf' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into feature-ucaf

# Conflicts:
#	lib/config/localized_values.dart
#	lib/util/translations_delegate_base.dart
merge-requests/246/head
mosazaid 5 years ago
commit 421cee49c7

@ -15,12 +15,11 @@ class PrescriptionService extends BaseService {
List<dynamic> specialityList = [];
PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel(
patientMRN: 3120877,
vidaAuthTokenID:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyODA0IiwianRpIjoiNzNiNmUyZDctMjA0ZC00NzAyLTkxMDYtODE3MzI3OTZkYzI5IiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMjgwNCIsIk5hbWUiOiJNVUhBTU1BRCBBWkFNIiwiRW1wbG95ZWVJZCI6IjE0ODUiLCJGYWNpbGl0eUdyb3VwSWQiOiIwMTAyNjYiLCJGYWNpbGl0eUlkIjoiMTUiLCJQaGFyYW1jeUZhY2lsaXR5SWQiOiI1NSIsIklTX1BIQVJNQUNZX0NPTk5FQ1RFRCI6IlRydWUiLCJEb2N0b3JJZCI6IjE0ODUiLCJTRVNTSU9OSUQiOiIyMTU3NjIwOSIsIkNsaW5pY0lkIjoiMyIsInJvbGUiOlsiU0VDVVJJVFkgQURNSU5JU1RSQVRPUlMiLCJTRVRVUCBBRE1JTklTVFJBVE9SUyIsIkNFTydTIiwiRVhFQ1VUSVZFIERJUkVDVE9SUyIsIk1BTkFHRVJTIiwiU1VQRVJWSVNPUlMiLCJDTElFTlQgU0VSVklDRVMgQ09PUkRJTkFUT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIFNVUEVSVklTT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIE1BTkdFUlMiLCJIRUFEIE5VUlNFUyIsIkRPQ1RPUlMiLCJDSElFRiBPRiBNRURJQ0FMIFNUQUZGUyIsIkJJTy1NRURJQ0FMIFRFQ0hOSUNJQU5TIiwiQklPLU1FRElDQUwgRU5HSU5FRVJTIiwiQklPLU1FRElDQUwgREVQQVJUTUVOVCBIRUFEUyIsIklUIEhFTFAgREVTSyIsIkFETUlOSVNUUkFUT1JTIiwiTEFCIEFETUlOSVNUUkFUT1IiLCJMQUIgVEVDSE5JQ0lBTiIsIkJVU0lORVNTIE9GRklDRSBTVEFGRiIsIkZJTkFOQ0UgQUNDT1VOVEFOVFMiLCJQSEFSTUFDWSBTVEFGRiIsIkFDQ09VTlRTIFNUQUZGIiwiTEFCIFJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiSU5QQVRJRU5UIEJJTExJTkcgU1VQRVJWSVNPUiIsIkxEUi1PUiBOVVJTRVMiLCJBRE1JU1NJT04gU1RBRkYiLCJIRUxQIERFU0sgQURNSU4iLCJBUFBST1ZBTCBTVEFGRiIsIklOUEFUSUVOVCBCSUxMSU5HIENPT1JESU5BVE9SIiwiQklMTElORyBTVEFGRiIsIkNPTlNFTlQgIiwiQ29uc2VudCAtIERlbnRhbCIsIldFQkVNUiJdLCJuYmYiOjE2MDgyMzY2MjAsImV4cCI6MTYwOTEwMDYyMCwiaWF0IjoxNjA4MjM2NjIwfQ.z4Lh0dCRr9GWXvaTo7x5GPV7R5z8ONyh3-0uk3PXMu8",
//patientMRN: 3120877,
);
SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel(
search: ["panadol"],
search: ["Acetaminophen"],
vidaAuthTokenID:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiY2QwOWU3MTEtZDEwYy00NjZhLWEwNDctMjc4MDBmNmRkMTYxIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYyMDMiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkhFQUQgTlVSU0VTIiwiRE9DVE9SUyIsIkhFQUQgRE9DVE9SUyIsIkFETUlOSVNUUkFUT1JTIiwiUkVDRVBUSU9OSVNUIiwiRVIgTlVSU0UiLCJJVkYgUkVDRVBUSU9OSVNUIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIklWRiBET0NUT1IiLCJJVkYgTlVSU0UiLCJJVkYgQ09PUkRJTkFUT1IiLCJJVkYgTEFCIFNUQUZGIiwiQ09OU0VOVCAiLCJNRURJQ0FMIFJFUE9SVCAtIFNJQ0sgTEVBVkUgTUFOQUdFUiJdLCJuYmYiOjE2MDkyNjQ2MTQsImV4cCI6MTYxMDEyODYxNCwiaWF0IjoxNjA5MjY0NjE0fQ.xCJ0jGtSFf36G8uZpdmHVoLfXDyP6e9mBpuOPSlzuio",
);
@ -29,7 +28,7 @@ class PrescriptionService extends BaseService {
PostPrescriptionReqModel();
Future getPrescription({int mrn}) async {
_prescriptionReqModel = PrescriptionReqModel(patientMRN: 3120877);
_prescriptionReqModel = PrescriptionReqModel(patientMRN: mrn);
hasError = false;
_prescriptionList.clear();
await baseAppClient.post(GET_PRESCRIPTION_LIST,

@ -124,7 +124,16 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
thickness: 1.0,
color: Colors.grey,
),
Padding(
model.medicalFileList.length != 0 &&
model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations
.length !=
0
? Padding(
padding: EdgeInsets.all(10.0),
child: Container(
child: Column(
@ -270,16 +279,20 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Texts(
'History of present illness'
.toUpperCase(),
variant:
isHistoryExpand ? "bodyText" : '',
bold: isHistoryExpand ? true : false,
variant: isHistoryExpand
? "bodyText"
: '',
bold: isHistoryExpand
? true
: false,
color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isHistoryExpand = !isHistoryExpand;
isHistoryExpand =
!isHistoryExpand;
});
},
child: Icon(isHistoryExpand
@ -299,7 +312,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.consulations[0]
.lstMedicalHistory
.length,
itemBuilder: (BuildContext ctxt, int index) {
itemBuilder:
(BuildContext ctxt, int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Container(
@ -312,7 +326,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Expanded(
child: AppText(
model
.medicalFileList[0]
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
@ -365,8 +380,9 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
variant: isAssessmentExpand
? "bodyText"
: '',
bold:
isAssessmentExpand ? true : false,
bold: isAssessmentExpand
? true
: false,
color: Colors.black),
],
),
@ -394,7 +410,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.consulations[0]
.lstAssessments
.length,
itemBuilder: (BuildContext ctxt, int index) {
itemBuilder:
(BuildContext ctxt, int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Container(
@ -406,7 +423,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [
AppText(
'ICD',
fontWeight: FontWeight.w700,
fontWeight:
FontWeight.w700,
),
AppText(
model
@ -416,14 +434,16 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstAssessments[index]
.lstAssessments[
index]
.iCD10
.trim(),
),
SizedBox(width: 35.0),
AppText(
'Condition: ',
fontWeight: FontWeight.w700,
fontWeight:
FontWeight.w700,
),
AppText(
model
@ -433,7 +453,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstAssessments[index]
.lstAssessments[
index]
.condition
.trim(),
),
@ -449,9 +470,11 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstAssessments[index]
.lstAssessments[
index]
.description,
fontWeight: FontWeight.w700,
fontWeight:
FontWeight.w700,
)
],
),
@ -459,12 +482,14 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [
AppText(
'Type: ',
fontWeight: FontWeight.w700,
fontWeight:
FontWeight.w700,
),
AppText(model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timelines[
encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstAssessments[index]
@ -478,7 +503,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timelines[
encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstAssessments[index]
@ -527,12 +553,15 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [
Row(
children: [
Texts('Test / procedures'.toUpperCase(),
Texts(
'Test / procedures'
.toUpperCase(),
variant: isProcedureExpand
? "bodyText"
: '',
bold:
isProcedureExpand ? true : false,
bold: isProcedureExpand
? true
: false,
color: Colors.black),
],
),
@ -560,7 +589,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.consulations[0]
.lstProcedure
.length,
itemBuilder: (BuildContext ctxt, int index) {
itemBuilder:
(BuildContext ctxt, int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Container(
@ -572,7 +602,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [
AppText(
'Procedure ID: ',
fontWeight: FontWeight.w700,
fontWeight:
FontWeight.w700,
),
AppText(
model
@ -589,7 +620,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
SizedBox(width: 35.0),
AppText(
'Order Date: ',
fontWeight: FontWeight.w700,
fontWeight:
FontWeight.w700,
),
// AppText(
// model
@ -616,7 +648,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.consulations[0]
.lstProcedure[index]
.procName,
fontWeight: FontWeight.w700,
fontWeight:
FontWeight.w700,
)
],
),
@ -624,12 +657,14 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [
AppText(
'CPT Code : ',
fontWeight: FontWeight.w700,
fontWeight:
FontWeight.w700,
),
AppText(model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timelines[
encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstProcedure[index]
@ -683,16 +718,20 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Row(
children: [
Texts('physical exam'.toUpperCase(),
variant:
isPhysicalExam ? "bodyText" : '',
bold: isPhysicalExam ? true : false,
variant: isPhysicalExam
? "bodyText"
: '',
bold: isPhysicalExam
? true
: false,
color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isPhysicalExam = !isPhysicalExam;
isPhysicalExam =
!isPhysicalExam;
});
},
child: Icon(isPhysicalExam
@ -712,7 +751,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.consulations[0]
.lstPhysicalExam
.length,
itemBuilder: (BuildContext ctxt, int index) {
itemBuilder:
(BuildContext ctxt, int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Container(
@ -722,15 +762,18 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [
AppText(
'Exam Type: ',
fontWeight: FontWeight.w700,
fontWeight:
FontWeight.w700,
),
AppText(model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timelines[
encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstPhysicalExam[index]
.lstPhysicalExam[
index]
.examType),
],
),
@ -744,9 +787,11 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstPhysicalExam[index]
.lstPhysicalExam[
index]
.examDesc,
fontWeight: FontWeight.w700,
fontWeight:
FontWeight.w700,
)
],
),
@ -754,15 +799,18 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [
AppText(
'Abnormal: ',
fontWeight: FontWeight.w700,
fontWeight:
FontWeight.w700,
),
AppText(model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timelines[
encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstPhysicalExam[index]
.lstPhysicalExam[
index]
.abnormal),
],
),
@ -773,7 +821,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timelines[
encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstPhysicalExam[index]
@ -805,7 +854,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
],
),
),
),
)
: Text("There's no medical file for this patient")
],
),
),

@ -51,24 +51,24 @@ postProcedure(
new PostPrescriptionReqModel();
List<PrescriptionRequestModel> sss = List();
postProcedureReqModel.appointmentNo = 2016055159;
postProcedureReqModel.clinicID = 17;
postProcedureReqModel.episodeID = 200012330;
postProcedureReqModel.patientMRN = 3120877;
postProcedureReqModel.appointmentNo = patient.appointmentNo;
postProcedureReqModel.clinicID = patient.clinicId;
postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = patient.patientMRN;
postProcedureReqModel.vidaAuthTokenID =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiOGFjNDRjZGQtOWE0Mi00M2YxLWE2YTQtMWQ4NzBmZmYwNTUyIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTU2NDkiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA4NzM2NjY5LCJleHAiOjE2MDk2MDA2NjksImlhdCI6MTYwODczNjY2OX0.9EDgYrbe5fQA2CvgLdFT4s_PL7hD5R_Qggfpv4lDtUY";
sss.add(PrescriptionRequestModel(
covered: true,
dose: 1,
itemId: int.parse(drugId),
itemId: drugId.isEmpty ? 1 : int.parse(drugId),
doseUnitId: 1,
route: int.parse(route),
frequency: int.parse(frequency),
route: route.isEmpty ? 1 : int.parse(route),
frequency: frequency.isEmpty ? 1 : int.parse(frequency),
remarks: instruction,
approvalRequired: true,
icdcode10Id: "test2",
doseTime: int.parse(doseTimeIn),
duration: int.parse(duration),
doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn),
duration: duration.isEmpty ? 1 : int.parse(duration),
doseStartDate: doseTime.toIso8601String()));
postProcedureReqModel.prescriptionRequestModel = sss;
//postProcedureReqModel.procedures = controlsProcedure;
@ -120,10 +120,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
List<dynamic> durationList;
List<dynamic> doseTimeList;
List<dynamic> indicationList;
String routeInatial = 'By Mouth';
//PatiantInformtion patient;
dynamic _strength;
dynamic _selectedBranch;
@override
void initState() {
super.initState();
@ -260,20 +259,21 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
return BaseView<PrescriptionViewModel>(
onModelReady: (model) => model.getDrugs(),
builder: (BuildContext context, PrescriptionViewModel model,
Widget child) =>
DraggableScrollableSheet(
builder:
(BuildContext context, PrescriptionViewModel model, Widget child) =>
NetworkBaseView(
baseViewModel: model,
child: DraggableScrollableSheet(
initialChildSize: 0.90,
maxChildSize: 0.90,
minChildSize: 0.9,
builder:
(BuildContext context, ScrollController scrollController) {
builder: (BuildContext context, ScrollController scrollController) {
return SingleChildScrollView(
child: Container(
height: 980,
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 12.0, vertical: 10.0),
padding:
EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
//mainAxisAlignment: MainAxisAlignment.spaceEvenly,
@ -307,16 +307,14 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
.ok,
okFunction: (selectedValue) {
setState(() {
selectedDrug =
selectedValue;
selectedDrug = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder:
(BuildContext context) {
builder: (BuildContext context) {
return dialog;
},
);
@ -324,11 +322,16 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).search,
TranslationBase.of(context)
.searchMedicine,
selectedDrug != null
? selectedDrug['GenericName']
: null,
true),
true,
suffixIcon: Icon(
Icons.search,
color: Colors.black,
)),
enabled: false,
),
),
@ -337,45 +340,58 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
height: spaceBetweenTextFileds,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: referToList != null
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: referToList,
attributeName: 'name',
attributeValueId: 'id',
okText:
TranslationBase.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
type = selectedValue;
_selectedBranch = null;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder:
(BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.orderType,
type != null ? type['name'] : null,
true),
enabled: false,
child: Row(
children: [
AppText('Order Type'),
Radio(),
Text('Regular'),
Radio(
value: 1,
),
Text('Urgent'),
],
),
),
// Container(
// height: screenSize.height * 0.070,
// child: InkWell(
// onTap: referToList != null
// ? () {
// ListSelectDialog dialog =
// ListSelectDialog(
// list: referToList,
// attributeName: 'name',
// attributeValueId: 'id',
// okText:
// TranslationBase.of(context)
// .ok,
// okFunction: (selectedValue) {
// setState(() {
// type = selectedValue;
// _selectedBranch = null;
// });
// },
// );
// showDialog(
// barrierDismissible: false,
// context: context,
// builder:
// (BuildContext context) {
// return dialog;
// },
// );
// }
// : null,
// child: TextField(
// decoration: textFieldSelectorDecoration(
// TranslationBase.of(context)
// .orderType,
// type != null ? type['name'] : null,
// true),
// enabled: false,
// ),
// ),
// ),
SizedBox(height: spaceBetweenTextFileds),
Container(
height: screenSize.height * 0.070,
@ -393,15 +409,13 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
okFunction: (selectedValue) {
setState(() {
strength = selectedValue;
_selectedBranch = null;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder:
(BuildContext context) {
builder: (BuildContext context) {
return dialog;
},
);
@ -409,8 +423,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.strength,
TranslationBase.of(context).strength,
strength != null
? strength['name']
: null,
@ -436,15 +449,17 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
okFunction: (selectedValue) {
setState(() {
route = selectedValue;
_selectedBranch = null;
});
if (route == null) {
helpers.showErrorToast(
'plase fill');
}
},
);
showDialog(
barrierDismissible: false,
context: context,
builder:
(BuildContext context) {
builder: (BuildContext context) {
return dialog;
},
);
@ -453,9 +468,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).route,
route != null
? route['name']
: null,
route != null ? route['name'] : null,
true),
enabled: false,
),
@ -478,15 +491,13 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
okFunction: (selectedValue) {
setState(() {
frequency = selectedValue;
_selectedBranch = null;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder:
(BuildContext context) {
builder: (BuildContext context) {
return dialog;
},
);
@ -494,8 +505,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.frequency,
TranslationBase.of(context).frequency,
frequency != null
? frequency['name']
: null,
@ -521,15 +531,13 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
okFunction: (selectedValue) {
setState(() {
doseTime = selectedValue;
_selectedBranch = null;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder:
(BuildContext context) {
builder: (BuildContext context) {
return dialog;
},
);
@ -537,8 +545,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.doseTime,
TranslationBase.of(context).doseTime,
doseTime != null
? doseTime['name']
: null,
@ -563,17 +570,14 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
.ok,
okFunction: (selectedValue) {
setState(() {
indicationList =
selectedValue;
_selectedBranch = null;
indication = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder:
(BuildContext context) {
builder: (BuildContext context) {
return dialog;
},
);
@ -600,8 +604,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.date,
TranslationBase.of(context).date,
selectedDate != null
? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
: null,
@ -631,15 +634,13 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
okFunction: (selectedValue) {
setState(() {
duration = selectedValue;
_selectedBranch = null;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder:
(BuildContext context) {
builder: (BuildContext context) {
return dialog;
},
);
@ -647,8 +648,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.duration,
TranslationBase.of(context).duration,
duration != null
? duration['name']
: null,
@ -668,8 +668,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: TextFields(
maxLines: 6,
minLines: 4,
hintText: TranslationBase.of(context)
.instruction,
hintText:
TranslationBase.of(context).instruction,
controller: instructionController,
//keyboardType: TextInputType.number,
validator: (value) {
@ -694,8 +694,20 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
onPressed: () {
formKey.currentState.save();
if (formKey.currentState
.validate()) {
if (strength == null ||
route == null ||
frequency == null ||
indication == null ||
doseTime == null ||
duration == null ||
selectedDrug == null ||
selectedDate == null) {
DrAppToastMsg.showErrorToast(
"Please Fill All Fields");
return;
}
if (formKey.currentState.validate()) {
postProcedure(
patient: widget.patient,
doseTimeIn:
@ -703,8 +715,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
model: widget.model,
duration:
duration['id'].toString(),
frequency: frequency['id']
.toString(),
frequency:
frequency['id'].toString(),
route: route['id'].toString(),
drugId: selectedDrug['ItemId']
.toString(),
@ -713,8 +725,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
indication:
indicationController.text,
instruction:
instructionController
.text,
instructionController.text,
doseTime: selectedDate);
Navigator.pop(context);
}
@ -741,6 +752,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
),
);
}),
),
);
}

@ -453,21 +453,30 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
.edit),
onTap: () {
updatePrescriptionForm(
context,
model
patient:
patient,
drugId: model
.prescriptionList[
0]
.entityList[
index]
.medicineCode,
drugName: model
.prescriptionList[
0]
.entityList[
index]
.medicationName,
model
remarks: model
.prescriptionList[
0]
.entityList[
index]
.medicineCode,
.remarks,
model:
model,
);
context:
context);
//model.postPrescription();
},
),
@ -563,7 +572,12 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
}
void updatePrescriptionForm(
context, String drugName, int drugId, PrescriptionViewModel model) {
{context,
String drugName,
int drugId,
String remarks,
PrescriptionViewModel model,
PatiantInformtion patient}) {
TextEditingController remarksController = TextEditingController();
TextEditingController doseController = TextEditingController();
TextEditingController frequencyController = TextEditingController();
@ -635,6 +649,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
SizedBox(
height: 12.0,
),
AppText('Remarks'),
Container(
decoration: BoxDecoration(
borderRadius:
@ -642,7 +657,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: TextFields(
hintText: 'Remarks',
hintText: remarks,
controller: remarksController,
maxLines: 7,
minLines: 4,
@ -664,6 +679,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
title: 'update prescription'.toUpperCase(),
onPressed: () {
updatePrescription(
patient: patient,
model: model,
drugId: drugId,
remarks: remarksController.text,
@ -685,23 +701,23 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
});
}
updatePrescription({
PrescriptionViewModel model,
updatePrescription(
{PrescriptionViewModel model,
int drugId,
String remarks,
String dose,
String frequency,
String route,
}) async {
PatiantInformtion patient}) async {
//PrescriptionViewModel model = PrescriptionViewModel();
PostPrescriptionReqModel updatePrescriptionReqModel =
new PostPrescriptionReqModel();
List<PrescriptionRequestModel> sss = List();
updatePrescriptionReqModel.appointmentNo = 2016055159;
updatePrescriptionReqModel.clinicID = 17;
updatePrescriptionReqModel.episodeID = 200012330;
updatePrescriptionReqModel.patientMRN = 3120877;
updatePrescriptionReqModel.appointmentNo = patient.appointmentNo;
updatePrescriptionReqModel.clinicID = patient.clinicId;
updatePrescriptionReqModel.episodeID = patient.episodeNo;
updatePrescriptionReqModel.patientMRN = patient.patientMRN;
updatePrescriptionReqModel.vidaAuthTokenID =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiOGFjNDRjZGQtOWE0Mi00M2YxLWE2YTQtMWQ4NzBmZmYwNTUyIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTU2NDkiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA4NzM2NjY5LCJleHAiOjE2MDk2MDA2NjksImlhdCI6MTYwODczNjY2OX0.9EDgYrbe5fQA2CvgLdFT4s_PL7hD5R_Qggfpv4lDtUY";
sss.add(PrescriptionRequestModel(

Loading…
Cancel
Save