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

@ -124,7 +124,16 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
thickness: 1.0, thickness: 1.0,
color: Colors.grey, 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), padding: EdgeInsets.all(10.0),
child: Container( child: Container(
child: Column( child: Column(
@ -270,16 +279,20 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Texts( Texts(
'History of present illness' 'History of present illness'
.toUpperCase(), .toUpperCase(),
variant: variant: isHistoryExpand
isHistoryExpand ? "bodyText" : '', ? "bodyText"
bold: isHistoryExpand ? true : false, : '',
bold: isHistoryExpand
? true
: false,
color: Colors.black), color: Colors.black),
], ],
), ),
InkWell( InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
isHistoryExpand = !isHistoryExpand; isHistoryExpand =
!isHistoryExpand;
}); });
}, },
child: Icon(isHistoryExpand child: Icon(isHistoryExpand
@ -299,7 +312,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.consulations[0] .consulations[0]
.lstMedicalHistory .lstMedicalHistory
.length, .length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder:
(BuildContext ctxt, int index) {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Container( child: Container(
@ -312,7 +326,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Expanded( Expanded(
child: AppText( child: AppText(
model model
.medicalFileList[0] .medicalFileList[
0]
.entityList[0] .entityList[0]
.timelines[ .timelines[
encounterNumber] encounterNumber]
@ -365,8 +380,9 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
variant: isAssessmentExpand variant: isAssessmentExpand
? "bodyText" ? "bodyText"
: '', : '',
bold: bold: isAssessmentExpand
isAssessmentExpand ? true : false, ? true
: false,
color: Colors.black), color: Colors.black),
], ],
), ),
@ -394,7 +410,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.consulations[0] .consulations[0]
.lstAssessments .lstAssessments
.length, .length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder:
(BuildContext ctxt, int index) {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Container( child: Container(
@ -406,7 +423,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
AppText( AppText(
'ICD', 'ICD',
fontWeight: FontWeight.w700, fontWeight:
FontWeight.w700,
), ),
AppText( AppText(
model model
@ -416,14 +434,16 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
encounterNumber] encounterNumber]
.timeLineEvents[0] .timeLineEvents[0]
.consulations[0] .consulations[0]
.lstAssessments[index] .lstAssessments[
index]
.iCD10 .iCD10
.trim(), .trim(),
), ),
SizedBox(width: 35.0), SizedBox(width: 35.0),
AppText( AppText(
'Condition: ', 'Condition: ',
fontWeight: FontWeight.w700, fontWeight:
FontWeight.w700,
), ),
AppText( AppText(
model model
@ -433,7 +453,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
encounterNumber] encounterNumber]
.timeLineEvents[0] .timeLineEvents[0]
.consulations[0] .consulations[0]
.lstAssessments[index] .lstAssessments[
index]
.condition .condition
.trim(), .trim(),
), ),
@ -449,9 +470,11 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
encounterNumber] encounterNumber]
.timeLineEvents[0] .timeLineEvents[0]
.consulations[0] .consulations[0]
.lstAssessments[index] .lstAssessments[
index]
.description, .description,
fontWeight: FontWeight.w700, fontWeight:
FontWeight.w700,
) )
], ],
), ),
@ -459,12 +482,14 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
AppText( AppText(
'Type: ', 'Type: ',
fontWeight: FontWeight.w700, fontWeight:
FontWeight.w700,
), ),
AppText(model AppText(model
.medicalFileList[0] .medicalFileList[0]
.entityList[0] .entityList[0]
.timelines[encounterNumber] .timelines[
encounterNumber]
.timeLineEvents[0] .timeLineEvents[0]
.consulations[0] .consulations[0]
.lstAssessments[index] .lstAssessments[index]
@ -478,7 +503,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
model model
.medicalFileList[0] .medicalFileList[0]
.entityList[0] .entityList[0]
.timelines[encounterNumber] .timelines[
encounterNumber]
.timeLineEvents[0] .timeLineEvents[0]
.consulations[0] .consulations[0]
.lstAssessments[index] .lstAssessments[index]
@ -527,12 +553,15 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
Row( Row(
children: [ children: [
Texts('Test / procedures'.toUpperCase(), Texts(
'Test / procedures'
.toUpperCase(),
variant: isProcedureExpand variant: isProcedureExpand
? "bodyText" ? "bodyText"
: '', : '',
bold: bold: isProcedureExpand
isProcedureExpand ? true : false, ? true
: false,
color: Colors.black), color: Colors.black),
], ],
), ),
@ -560,7 +589,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.consulations[0] .consulations[0]
.lstProcedure .lstProcedure
.length, .length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder:
(BuildContext ctxt, int index) {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Container( child: Container(
@ -572,7 +602,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
AppText( AppText(
'Procedure ID: ', 'Procedure ID: ',
fontWeight: FontWeight.w700, fontWeight:
FontWeight.w700,
), ),
AppText( AppText(
model model
@ -589,7 +620,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
SizedBox(width: 35.0), SizedBox(width: 35.0),
AppText( AppText(
'Order Date: ', 'Order Date: ',
fontWeight: FontWeight.w700, fontWeight:
FontWeight.w700,
), ),
// AppText( // AppText(
// model // model
@ -616,7 +648,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.consulations[0] .consulations[0]
.lstProcedure[index] .lstProcedure[index]
.procName, .procName,
fontWeight: FontWeight.w700, fontWeight:
FontWeight.w700,
) )
], ],
), ),
@ -624,12 +657,14 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
AppText( AppText(
'CPT Code : ', 'CPT Code : ',
fontWeight: FontWeight.w700, fontWeight:
FontWeight.w700,
), ),
AppText(model AppText(model
.medicalFileList[0] .medicalFileList[0]
.entityList[0] .entityList[0]
.timelines[encounterNumber] .timelines[
encounterNumber]
.timeLineEvents[0] .timeLineEvents[0]
.consulations[0] .consulations[0]
.lstProcedure[index] .lstProcedure[index]
@ -683,16 +718,20 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Row( Row(
children: [ children: [
Texts('physical exam'.toUpperCase(), Texts('physical exam'.toUpperCase(),
variant: variant: isPhysicalExam
isPhysicalExam ? "bodyText" : '', ? "bodyText"
bold: isPhysicalExam ? true : false, : '',
bold: isPhysicalExam
? true
: false,
color: Colors.black), color: Colors.black),
], ],
), ),
InkWell( InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
isPhysicalExam = !isPhysicalExam; isPhysicalExam =
!isPhysicalExam;
}); });
}, },
child: Icon(isPhysicalExam child: Icon(isPhysicalExam
@ -712,7 +751,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.consulations[0] .consulations[0]
.lstPhysicalExam .lstPhysicalExam
.length, .length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder:
(BuildContext ctxt, int index) {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Container( child: Container(
@ -722,15 +762,18 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
AppText( AppText(
'Exam Type: ', 'Exam Type: ',
fontWeight: FontWeight.w700, fontWeight:
FontWeight.w700,
), ),
AppText(model AppText(model
.medicalFileList[0] .medicalFileList[0]
.entityList[0] .entityList[0]
.timelines[encounterNumber] .timelines[
encounterNumber]
.timeLineEvents[0] .timeLineEvents[0]
.consulations[0] .consulations[0]
.lstPhysicalExam[index] .lstPhysicalExam[
index]
.examType), .examType),
], ],
), ),
@ -744,9 +787,11 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
encounterNumber] encounterNumber]
.timeLineEvents[0] .timeLineEvents[0]
.consulations[0] .consulations[0]
.lstPhysicalExam[index] .lstPhysicalExam[
index]
.examDesc, .examDesc,
fontWeight: FontWeight.w700, fontWeight:
FontWeight.w700,
) )
], ],
), ),
@ -754,15 +799,18 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
AppText( AppText(
'Abnormal: ', 'Abnormal: ',
fontWeight: FontWeight.w700, fontWeight:
FontWeight.w700,
), ),
AppText(model AppText(model
.medicalFileList[0] .medicalFileList[0]
.entityList[0] .entityList[0]
.timelines[encounterNumber] .timelines[
encounterNumber]
.timeLineEvents[0] .timeLineEvents[0]
.consulations[0] .consulations[0]
.lstPhysicalExam[index] .lstPhysicalExam[
index]
.abnormal), .abnormal),
], ],
), ),
@ -773,7 +821,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
model model
.medicalFileList[0] .medicalFileList[0]
.entityList[0] .entityList[0]
.timelines[encounterNumber] .timelines[
encounterNumber]
.timeLineEvents[0] .timeLineEvents[0]
.consulations[0] .consulations[0]
.lstPhysicalExam[index] .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(); new PostPrescriptionReqModel();
List<PrescriptionRequestModel> sss = List(); List<PrescriptionRequestModel> sss = List();
postProcedureReqModel.appointmentNo = 2016055159; postProcedureReqModel.appointmentNo = patient.appointmentNo;
postProcedureReqModel.clinicID = 17; postProcedureReqModel.clinicID = patient.clinicId;
postProcedureReqModel.episodeID = 200012330; postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = 3120877; postProcedureReqModel.patientMRN = patient.patientMRN;
postProcedureReqModel.vidaAuthTokenID = postProcedureReqModel.vidaAuthTok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lSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTU2NDkiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA4NzM2NjY5LCJleHAiOjE2MDk2MDA2NjksImlhdCI6MTYwODczNjY2OX0.9EDgYrbe5fQA2CvgLdFT4s_PL7hD5R_Qggfpv4lDtUY";
sss.add(PrescriptionRequestModel( sss.add(PrescriptionRequestModel(
covered: true, covered: true,
dose: 1, dose: 1,
itemId: int.parse(drugId), itemId: drugId.isEmpty ? 1 : int.parse(drugId),
doseUnitId: 1, doseUnitId: 1,
route: int.parse(route), route: route.isEmpty ? 1 : int.parse(route),
frequency: int.parse(frequency), frequency: frequency.isEmpty ? 1 : int.parse(frequency),
remarks: instruction, remarks: instruction,
approvalRequired: true, approvalRequired: true,
icdcode10Id: "test2", icdcode10Id: "test2",
doseTime: int.parse(doseTimeIn), doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn),
duration: int.parse(duration), duration: duration.isEmpty ? 1 : int.parse(duration),
doseStartDate: doseTime.toIso8601String())); doseStartDate: doseTime.toIso8601String()));
postProcedureReqModel.prescriptionRequestModel = sss; postProcedureReqModel.prescriptionRequestModel = sss;
//postProcedureReqModel.procedures = controlsProcedure; //postProcedureReqModel.procedures = controlsProcedure;
@ -120,10 +120,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
List<dynamic> durationList; List<dynamic> durationList;
List<dynamic> doseTimeList; List<dynamic> doseTimeList;
List<dynamic> indicationList; List<dynamic> indicationList;
String routeInatial = 'By Mouth';
//PatiantInformtion patient; //PatiantInformtion patient;
dynamic _strength;
dynamic _selectedBranch;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -260,20 +259,21 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
return BaseView<PrescriptionViewModel>( return BaseView<PrescriptionViewModel>(
onModelReady: (model) => model.getDrugs(), onModelReady: (model) => model.getDrugs(),
builder: (BuildContext context, PrescriptionViewModel model, builder:
Widget child) => (BuildContext context, PrescriptionViewModel model, Widget child) =>
DraggableScrollableSheet( NetworkBaseView(
baseViewModel: model,
child: DraggableScrollableSheet(
initialChildSize: 0.90, initialChildSize: 0.90,
maxChildSize: 0.90, maxChildSize: 0.90,
minChildSize: 0.9, minChildSize: 0.9,
builder: builder: (BuildContext context, ScrollController scrollController) {
(BuildContext context, ScrollController scrollController) {
return SingleChildScrollView( return SingleChildScrollView(
child: Container( child: Container(
height: 980, height: 980,
child: Padding( child: Padding(
padding: EdgeInsets.symmetric( padding:
horizontal: 12.0, vertical: 10.0), EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
//mainAxisAlignment: MainAxisAlignment.spaceEvenly, //mainAxisAlignment: MainAxisAlignment.spaceEvenly,
@ -307,16 +307,14 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
.ok, .ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
selectedDrug = selectedDrug = selectedValue;
selectedValue;
}); });
}, },
); );
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: builder: (BuildContext context) {
(BuildContext context) {
return dialog; return dialog;
}, },
); );
@ -324,11 +322,16 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context).search, TranslationBase.of(context)
.searchMedicine,
selectedDrug != null selectedDrug != null
? selectedDrug['GenericName'] ? selectedDrug['GenericName']
: null, : null,
true), true,
suffixIcon: Icon(
Icons.search,
color: Colors.black,
)),
enabled: false, enabled: false,
), ),
), ),
@ -337,45 +340,58 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
height: spaceBetweenTextFileds, height: spaceBetweenTextFileds,
), ),
Container( Container(
height: screenSize.height * 0.070, child: Row(
child: InkWell( children: [
onTap: referToList != null AppText('Order Type'),
? () { Radio(),
ListSelectDialog dialog = Text('Regular'),
ListSelectDialog( Radio(
list: referToList, value: 1,
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,
), ),
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), SizedBox(height: spaceBetweenTextFileds),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
@ -393,15 +409,13 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
strength = selectedValue; strength = selectedValue;
_selectedBranch = null;
}); });
}, },
); );
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: builder: (BuildContext context) {
(BuildContext context) {
return dialog; return dialog;
}, },
); );
@ -409,8 +423,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context) TranslationBase.of(context).strength,
.strength,
strength != null strength != null
? strength['name'] ? strength['name']
: null, : null,
@ -436,15 +449,17 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
route = selectedValue; route = selectedValue;
_selectedBranch = null;
}); });
if (route == null) {
helpers.showErrorToast(
'plase fill');
}
}, },
); );
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: builder: (BuildContext context) {
(BuildContext context) {
return dialog; return dialog;
}, },
); );
@ -453,9 +468,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context).route, TranslationBase.of(context).route,
route != null route != null ? route['name'] : null,
? route['name']
: null,
true), true),
enabled: false, enabled: false,
), ),
@ -478,15 +491,13 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
frequency = selectedValue; frequency = selectedValue;
_selectedBranch = null;
}); });
}, },
); );
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: builder: (BuildContext context) {
(BuildContext context) {
return dialog; return dialog;
}, },
); );
@ -494,8 +505,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context) TranslationBase.of(context).frequency,
.frequency,
frequency != null frequency != null
? frequency['name'] ? frequency['name']
: null, : null,
@ -521,15 +531,13 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
doseTime = selectedValue; doseTime = selectedValue;
_selectedBranch = null;
}); });
}, },
); );
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: builder: (BuildContext context) {
(BuildContext context) {
return dialog; return dialog;
}, },
); );
@ -537,8 +545,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context) TranslationBase.of(context).doseTime,
.doseTime,
doseTime != null doseTime != null
? doseTime['name'] ? doseTime['name']
: null, : null,
@ -563,17 +570,14 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
.ok, .ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
indicationList = indication = selectedValue;
selectedValue;
_selectedBranch = null;
}); });
}, },
); );
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: builder: (BuildContext context) {
(BuildContext context) {
return dialog; return dialog;
}, },
); );
@ -600,8 +604,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: TextField( child: TextField(
decoration: decoration:
Helpers.textFieldSelectorDecoration( Helpers.textFieldSelectorDecoration(
TranslationBase.of(context) TranslationBase.of(context).date,
.date,
selectedDate != null selectedDate != null
? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
: null, : null,
@ -631,15 +634,13 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
duration = selectedValue; duration = selectedValue;
_selectedBranch = null;
}); });
}, },
); );
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: builder: (BuildContext context) {
(BuildContext context) {
return dialog; return dialog;
}, },
); );
@ -647,8 +648,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context) TranslationBase.of(context).duration,
.duration,
duration != null duration != null
? duration['name'] ? duration['name']
: null, : null,
@ -668,8 +668,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: TextFields( child: TextFields(
maxLines: 6, maxLines: 6,
minLines: 4, minLines: 4,
hintText: TranslationBase.of(context) hintText:
.instruction, TranslationBase.of(context).instruction,
controller: instructionController, controller: instructionController,
//keyboardType: TextInputType.number, //keyboardType: TextInputType.number,
validator: (value) { validator: (value) {
@ -694,8 +694,20 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
onPressed: () { onPressed: () {
formKey.currentState.save(); formKey.currentState.save();
if (formKey.currentState if (strength == null ||
.validate()) { 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( postProcedure(
patient: widget.patient, patient: widget.patient,
doseTimeIn: doseTimeIn:
@ -703,8 +715,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
model: widget.model, model: widget.model,
duration: duration:
duration['id'].toString(), duration['id'].toString(),
frequency: frequency['id'] frequency:
.toString(), frequency['id'].toString(),
route: route['id'].toString(), route: route['id'].toString(),
drugId: selectedDrug['ItemId'] drugId: selectedDrug['ItemId']
.toString(), .toString(),
@ -713,8 +725,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
indication: indication:
indicationController.text, indicationController.text,
instruction: instruction:
instructionController instructionController.text,
.text,
doseTime: selectedDate); doseTime: selectedDate);
Navigator.pop(context); Navigator.pop(context);
} }
@ -741,6 +752,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
), ),
); );
}), }),
),
); );
} }

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