merge-requests/315/head
Sultan Khan 5 years ago
commit 388c095d7f

@ -27,7 +27,8 @@ const PATIENT_GET_CLINIC_BY_PROJECT_URL =
const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo"; const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo";
const GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics"; const GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics";
//const GET_PROJECTS = 'Services/Lists.svc/REST/GetProjectForDoctorAPP'; const GET_REFERRAL_FACILITIES = 'Services/DoctorApplication.svc/REST/GetReferralFacilities';
const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo'; const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo';
const GET_PATIENT_VITAL_SIGN = const GET_PATIENT_VITAL_SIGN =

@ -732,4 +732,6 @@ const Map<String, Map<String, String>> localizedValues = {
}, },
// 'icd': {'en': "ICD", 'ar': " "}, // 'icd': {'en': "ICD", 'ar': " "},
'orderNo': {'en': "Order No : ", 'ar': "رقم الطلب"}, 'orderNo': {'en': "Order No : ", 'ar': "رقم الطلب"},
'infoStatus': {'en': "Info Status", 'ar': "حالة المعلومات"},
'doctorResponse': {'en': "Doctor Response", 'ar': "استجابة الطبيب"},
}; };

@ -41,6 +41,8 @@ class EntityList {
String specialPermission; String specialPermission;
String subGroup; String subGroup;
String template; String template;
String remarks;
String type;
EntityList( EntityList(
{this.allowedClinic, {this.allowedClinic,
@ -54,7 +56,9 @@ class EntityList {
this.procedureName, this.procedureName,
this.specialPermission, this.specialPermission,
this.subGroup, this.subGroup,
this.template}); this.template,
this.remarks,
this.type});
EntityList.fromJson(Map<String, dynamic> json) { EntityList.fromJson(Map<String, dynamic> json) {
allowedClinic = json['allowedClinic']; allowedClinic = json['allowedClinic'];

@ -49,6 +49,20 @@ class PatientReferralService extends LookupService {
}, body: info); }, body: info);
} }
Future getReferralFacilities() async {
hasError = false;
Map<String, dynamic> body = Map();
body['isSameBranch'] = false;
await baseAppClient.post(GET_REFERRAL_FACILITIES, onSuccess: (response, statusCode) async {
projectsList = response['ProjectInfo'];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getProjectInfo(int projectId) async { Future getProjectInfo(int projectId) async {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['ProjectID'] = projectId; body['ProjectID'] = projectId;

@ -75,7 +75,7 @@ class ProcedureService extends BaseService {
Future getProcedureCategory({String categoryName, String categoryID}) async { Future getProcedureCategory({String categoryName, String categoryID}) async {
_getProcedureCategoriseReqModel = GetProcedureReqModel( _getProcedureCategoriseReqModel = GetProcedureReqModel(
search: [""], search: [categoryName],
patientMRN: 0, patientMRN: 0,
pageIndex: 0, pageIndex: 0,
clinicId: 0, clinicId: 0,

@ -62,7 +62,7 @@ class PatientReferralViewModel extends BaseViewModel {
Future getBranches() async { Future getBranches() async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _referralPatientService.getProjectsList(); await _referralPatientService.getReferralFacilities();
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
error = _referralPatientService.error; error = _referralPatientService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -77,7 +77,7 @@ class PatientReferralViewModel extends BaseViewModel {
await _referralPatientService.getProjectInfo(projectId); await _referralPatientService.getProjectInfo(projectId);
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
error = _referralPatientService.error; error = _referralPatientService.error;
setState(ViewState.Error); setState(ViewState.ErrorLocal);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
@ -87,7 +87,7 @@ class PatientReferralViewModel extends BaseViewModel {
await _referralPatientService.getDoctorsList(clinicId); await _referralPatientService.getDoctorsList(clinicId);
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
error = _referralPatientService.error; error = _referralPatientService.error;
setState(ViewState.Error); setState(ViewState.ErrorLocal);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }

@ -1,5 +1,7 @@
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
class ListGtMyPatientsQuestions { class ListGtMyPatientsQuestions {
String setupID; String setupID;
int projectID; int projectID;
@ -17,11 +19,14 @@ class ListGtMyPatientsQuestions {
int editedBy; int editedBy;
String editedOn; String editedOn;
String patientName; String patientName;
String patientNameN; Null patientNameN;
int gender; int gender;
String dateofBirth; String dateofBirth;
String mobileNumber; String mobileNumber;
String emailAddress; String emailAddress;
String doctorResponse;
String infoStatus;
Null clinicID;
String age; String age;
String genderDescription; String genderDescription;
bool isVidaCall; bool isVidaCall;
@ -48,6 +53,9 @@ class ListGtMyPatientsQuestions {
this.dateofBirth, this.dateofBirth,
this.mobileNumber, this.mobileNumber,
this.emailAddress, this.emailAddress,
this.doctorResponse,
this.infoStatus,
this.clinicID,
this.age, this.age,
this.genderDescription, this.genderDescription,
this.isVidaCall}); this.isVidaCall});
@ -61,6 +69,7 @@ class ListGtMyPatientsQuestions {
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
requestType = json['RequestType']; requestType = json['RequestType'];
requestDate = Helpers.convertStringToDate(json['RequestDate']) ; requestDate = Helpers.convertStringToDate(json['RequestDate']) ;
requestTime = json['RequestTime']; requestTime = json['RequestTime'];
remarks = json['Remarks']; remarks = json['Remarks'];
status = json['Status']; status = json['Status'];
@ -74,6 +83,9 @@ class ListGtMyPatientsQuestions {
dateofBirth = json['DateofBirth']; dateofBirth = json['DateofBirth'];
mobileNumber = json['MobileNumber']; mobileNumber = json['MobileNumber'];
emailAddress = json['EmailAddress']; emailAddress = json['EmailAddress'];
doctorResponse = json['DoctorResponse'];
infoStatus = json['InfoStatus'];
clinicID = json['ClinicID'];
age = json['Age']; age = json['Age'];
genderDescription = json['GenderDescription']; genderDescription = json['GenderDescription'];
isVidaCall = json['IsVidaCall']; isVidaCall = json['IsVidaCall'];
@ -102,6 +114,9 @@ class ListGtMyPatientsQuestions {
data['DateofBirth'] = this.dateofBirth; data['DateofBirth'] = this.dateofBirth;
data['MobileNumber'] = this.mobileNumber; data['MobileNumber'] = this.mobileNumber;
data['EmailAddress'] = this.emailAddress; data['EmailAddress'] = this.emailAddress;
data['DoctorResponse'] = this.doctorResponse;
data['InfoStatus'] = this.infoStatus;
data['ClinicID'] = this.clinicID;
data['Age'] = this.age; data['Age'] = this.age;
data['GenderDescription'] = this.genderDescription; data['GenderDescription'] = this.genderDescription;
data['IsVidaCall'] = this.isVidaCall; data['IsVidaCall'] = this.isVidaCall;

@ -209,7 +209,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
setState(() { setState(() {
isLoading = false; isLoading = false;
}); });
helpers.showErrorToast(error); helpers.showErrorToast(error.message);
//DrAppToastMsg.showErrorToast(error); //DrAppToastMsg.showErrorToast(error);
}); });
} }

@ -589,7 +589,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
], ],
), ),
bodyWidget: ListView.builder( bodyWidget: ListView.builder(
//physics: , physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model itemCount: model
@ -763,7 +763,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
], ],
), ),
bodyWidget: ListView.builder( bodyWidget: ListView.builder(
//physics: , physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model itemCount: model

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
@ -177,15 +178,18 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
_selectedBranch = null; _selectedBranch = null;
_selectedClinic = null; _selectedClinic = null;
_selectedDoctor = null; _selectedDoctor = null;
model.getDoctorBranch().then((value) { model.getDoctorBranch().then((value) async {
_selectedBranch = value; _selectedBranch = value;
if (_referTo['id'] == 1) { if (_referTo['id'] == 1) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model await model
.getClinics(_selectedBranch['facilityId']) .getClinics(_selectedBranch['facilityId'])
.then((_) => .then((_) =>
GifLoaderDialogUtils.hideDialog( GifLoaderDialogUtils.hideDialog(
context)); context));
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
} }
}); });
}); });
@ -226,15 +230,18 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
attributeValueId: 'facilityId', attributeValueId: 'facilityId',
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() async {
_selectedBranch = selectedValue; _selectedBranch = selectedValue;
_selectedClinic = null; _selectedClinic = null;
_selectedDoctor = null; _selectedDoctor = null;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model await model
.getClinics(_selectedBranch['facilityId']) .getClinics(_selectedBranch['facilityId'])
.then((_) => .then((_) =>
GifLoaderDialogUtils.hideDialog(context)); GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
}); });
}, },
); );
@ -277,15 +284,18 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
TranslationBase.of(context).clinicSearch, TranslationBase.of(context).clinicSearch,
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() async {
_selectedDoctor = null; _selectedDoctor = null;
_selectedClinic = selectedValue; _selectedClinic = selectedValue;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model await model
.getClinicDoctors( .getClinicDoctors(
_selectedClinic['ClinicID'].toString()) _selectedClinic['ClinicID'].toString())
.then((_) => .then((_) =>
GifLoaderDialogUtils.hideDialog(context)); GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
}); });
}, },
); );

@ -217,13 +217,14 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
initialChildSize: 0.90, initialChildSize: 0.90,
maxChildSize: 0.90, maxChildSize: 0.90,
minChildSize: 0.9, minChildSize: 0.9,
builder: (BuildContext context, ScrollController scrollController) { builder:
(BuildContext context, ScrollController scrollController) {
return SingleChildScrollView( return SingleChildScrollView(
child: Container( child: Container(
height: 1010, height: 1010,
child: Padding( child: Padding(
padding: padding: EdgeInsets.symmetric(
EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), horizontal: 12.0, vertical: 10.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
//mainAxisAlignment: MainAxisAlignment.spaceEvenly, //mainAxisAlignment: MainAxisAlignment.spaceEvenly,
@ -267,8 +268,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
true, true,
), ),
itemSubmitted: (item) => setState( itemSubmitted: (item) => setState(
() => () => _selectedMedication =
_selectedMedication = item), item),
key: key, key: key,
suggestions: suggestions:
model.allMedicationList, model.allMedicationList,
@ -278,19 +279,18 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Texts(suggestion child: Texts(suggestion
.description + .description +
'/' + '/' +
suggestion.genericName), suggestion
.genericName),
padding: padding:
EdgeInsets.all(8.0)), EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1, itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) => itemFilter: (suggestion, input) =>
suggestion.genericName suggestion.genericName.toLowerCase().startsWith(
.toLowerCase()
.startsWith(
input.toLowerCase()) || input.toLowerCase()) ||
suggestion.description suggestion.description
.toLowerCase() .toLowerCase()
.startsWith( .startsWith(input
input.toLowerCase()) || .toLowerCase()) ||
suggestion.keywords suggestion.keywords
.toLowerCase() .toLowerCase()
.startsWith( .startsWith(
@ -338,19 +338,22 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Row( child: Row(
children: [ children: [
Container( Container(
width: width: MediaQuery.of(context)
MediaQuery.of(context).size.width * .size
.width *
0.550, 0.550,
child: TextFields( child: TextFields(
inputFormatters: [ // inputFormatters: [
LengthLimitingTextInputFormatter(4), // LengthLimitingTextInputFormatter(
WhitelistingTextInputFormatter // 4),
.digitsOnly // WhitelistingTextInputFormatter
], // .digitsOnly
hintText: TranslationBase.of(context) // ],
hintText:
TranslationBase.of(context)
.strength, .strength,
controller: strengthController, controller: strengthController,
keyboardType: TextInputType.number, keyboardType: TextInputType.numberWithOptions(decimal: true,),
onChanged: (String value) { onChanged: (String value) {
setState(() { setState(() {
strengthChar = value.length; strengthChar = value.length;
@ -375,35 +378,44 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
width: 10.0, width: 10.0,
), ),
Container( Container(
width: width: MediaQuery.of(context)
MediaQuery.of(context).size.width * .size
.width *
0.350, 0.350,
child: InkWell( child: InkWell(
onTap: model.medicationStrengthList != onTap:
model.medicationStrengthList !=
null null
? () { ? () {
Helpers.hideKeyboard(context); Helpers.hideKeyboard(
ListSelectDialog dialog = context);
ListSelectDialog
dialog =
ListSelectDialog( ListSelectDialog(
list: model list: model
.medicationStrengthList, .medicationStrengthList,
attributeName: 'nameEn', attributeName:
attributeValueId: 'id', 'nameEn',
okText: TranslationBase.of( attributeValueId:
'id',
okText:
TranslationBase.of(
context) context)
.ok, .ok,
okFunction: okFunction:
(selectedValue) { (selectedValue) {
setState(() { setState(() {
units = selectedValue; units =
selectedValue;
}); });
}, },
); );
showDialog( showDialog(
barrierDismissible: false, barrierDismissible:
false,
context: context, context: context,
builder: builder: (BuildContext
(BuildContext context) { context) {
return dialog; return dialog;
}, },
); );
@ -452,7 +464,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: (BuildContext context) { builder:
(BuildContext context) {
return dialog; return dialog;
}, },
); );
@ -473,13 +486,14 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: model.medicationFrequencyList != null onTap: model.medicationFrequencyList !=
null
? () { ? () {
Helpers.hideKeyboard(context); Helpers.hideKeyboard(context);
ListSelectDialog dialog = ListSelectDialog dialog =
ListSelectDialog( ListSelectDialog(
list: list: model
model.medicationFrequencyList, .medicationFrequencyList,
attributeName: 'nameEn', attributeName: 'nameEn',
attributeValueId: 'id', attributeValueId: 'id',
okText: okText:
@ -494,7 +508,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: (BuildContext context) { builder:
(BuildContext context) {
return dialog; return dialog;
}, },
); );
@ -502,7 +517,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context).frequency, TranslationBase.of(context)
.frequency,
frequency != null frequency != null
? frequency['nameEn'] ? frequency['nameEn']
: null, : null,
@ -515,13 +531,14 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: model.medicationDoseTimeList != null onTap: model.medicationDoseTimeList !=
null
? () { ? () {
Helpers.hideKeyboard(context); Helpers.hideKeyboard(context);
ListSelectDialog dialog = ListSelectDialog dialog =
ListSelectDialog( ListSelectDialog(
list: list: model
model.medicationDoseTimeList, .medicationDoseTimeList,
attributeName: 'nameEn', attributeName: 'nameEn',
attributeValueId: 'id', attributeValueId: 'id',
okText: okText:
@ -536,7 +553,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: (BuildContext context) { builder:
(BuildContext context) {
return dialog; return dialog;
}, },
); );
@ -544,7 +562,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context).doseTime, TranslationBase.of(context)
.doseTime,
doseTime != null doseTime != null
? doseTime['nameEn'] ? doseTime['nameEn']
: null, : null,
@ -554,41 +573,30 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
), ),
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFileds),
if (model.patientAssessmentList.isNotEmpty) if (model.patientAssessmentList.isNotEmpty)
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
width: double.infinity,
child: Row(
children: [
Container(
width: MediaQuery.of(context)
.size
.width *
0.29,
child: InkWell( child: InkWell(
onTap: indicationList != null onTap: indicationList != null
? () { ? () {
Helpers.hideKeyboard(context); Helpers.hideKeyboard(
ListSelectDialog dialog = context);
ListSelectDialog(
list: indicationList,
attributeName: 'name',
attributeValueId: 'id',
okText:
TranslationBase.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
indication = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder:
(BuildContext context) {
return dialog;
},
);
} }
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration:
model.patientAssessmentList[0] textFieldSelectorDecoration(
model
.patientAssessmentList[
0]
.icdCode10ID .icdCode10ID
.toString(), .toString(),
indication != null indication != null
@ -600,57 +608,39 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
), ),
), ),
), ),
//model.patientAssessmentList.forEach((element) { }). Container(
// Column( width: MediaQuery.of(context)
// children: model.patientAssessmentList .size
// .map((element) { .width *
// return Container( 0.65,
// height: screenSize.height * 0.070, child: InkWell(
// child: InkWell( onTap: indicationList != null
// onTap: indicationList != null ? () {
// ? () { Helpers.hideKeyboard(
// ListSelectDialog dialog = context);
// ListSelectDialog( }
// list: indicationList, : null,
// attributeName: 'name', child: TextField(
// attributeValueId: 'id', maxLines: 5,
// okText: TranslationBase.of( decoration:
// context) textFieldSelectorDecoration(
// .ok, model
// okFunction: (selectedValue) { .patientAssessmentList[
// setState(() { 0]
// indication = .asciiDesc
// selectedValue; .toString(),
// }); indication != null
// }, ? indication['name']
// ); : null,
// showDialog( true),
// barrierDismissible: false, enabled: true,
// context: context, readOnly: true,
// builder: ),
// (BuildContext context) { ),
// return dialog; ),
// }, ],
// ); ),
// } ),
// : null,
// child: TextField(
// decoration:
// textFieldSelectorDecoration(
// element.icdCode10ID
// .toString(),
// indication != null
// ? indication['name']
// : null,
// true),
// enabled: true,
// readOnly: true,
// ),
// ),
// );
// }).toList(),
// ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFileds),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
@ -660,7 +650,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: TextField( child: TextField(
decoration: decoration:
Helpers.textFieldSelectorDecoration( Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).date, TranslationBase.of(context)
.date,
selectedDate != null selectedDate != null
? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
: null, : null,
@ -677,13 +668,14 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: model.medicationDurationList != null onTap: model.medicationDurationList !=
null
? () { ? () {
Helpers.hideKeyboard(context); Helpers.hideKeyboard(context);
ListSelectDialog dialog = ListSelectDialog dialog =
ListSelectDialog( ListSelectDialog(
list: list: model
model.medicationDurationList, .medicationDurationList,
attributeName: 'nameEn', attributeName: 'nameEn',
attributeValueId: 'id', attributeValueId: 'id',
okText: okText:
@ -698,7 +690,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: (BuildContext context) { builder:
(BuildContext context) {
return dialog; return dialog;
}, },
); );
@ -706,7 +699,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context).duration, TranslationBase.of(context)
.duration,
duration != null duration != null
? duration['nameEn'] ? duration['nameEn']
: null, : null,
@ -726,17 +720,10 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: TextFields( child: TextFields(
maxLines: 6, maxLines: 6,
minLines: 4, minLines: 4,
hintText: hintText: TranslationBase.of(context)
TranslationBase.of(context).instruction, .instruction,
controller: instructionController, controller: instructionController,
//keyboardType: TextInputType.number, //keyboardType: TextInputType.number,
validator: (value) {
if (value.isEmpty)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
},
), ),
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFileds),
@ -763,8 +750,23 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
"Please Fill All Fields"); "Please Fill All Fields");
return; return;
} }
if (int.parse(
strengthController.text) >
1000) {
DrAppToastMsg.showErrorToast(
"1000 is the MAX for the strength");
return;
}
if (int.parse(
strengthController.text) ==
0) {
DrAppToastMsg.showErrorToast(
"Streangth can't be zero");
return;
}
if (formKey.currentState.validate()) { if (formKey.currentState
.validate()) {
Navigator.pop(context); Navigator.pop(context);
{ {
// var x = model // var x = model
@ -801,8 +803,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
model: widget.model, model: widget.model,
duration: duration:
duration['id'].toString(), duration['id'].toString(),
frequency: frequency: frequency['id']
frequency['id'].toString(), .toString(),
route: route['id'].toString(), route: route['id'].toString(),
drugId: _selectedMedication drugId: _selectedMedication
.itemId .itemId
@ -812,7 +814,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
indication: indication:
indicationController.text, indicationController.text,
instruction: instruction:
instructionController.text, instructionController
.text,
doseTime: selectedDate, doseTime: selectedDate,
); );
} }

@ -214,16 +214,16 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
0] 0]
.entityList[ .entityList[
index] index]
.startDate) .createdOn)
.day .day
.toString(), .toString(),
color: Colors color: Colors
.green, .green,
), ),
AppText( AppText(
Helpers.getMonth(model.prescriptionList[0].entityList[index].startDate != Helpers.getMonth(model.prescriptionList[0].entityList[index].createdOn !=
null null
? (DateTime.parse(model.prescriptionList[0].entityList[index].startDate) ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn)
.month) .month)
: DateTime.now() : DateTime.now()
.month) .month)
@ -261,9 +261,13 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
child: child:
AppText( AppText(
model model
.prescriptionList[0] .prescriptionList[
.entityList[index] 0]
.startDate, .entityList[
index]
.startDate
.replaceAll("-",
"/"),
fontSize: fontSize:
12.0, 12.0,
), ),

@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -36,6 +37,7 @@ class UpdatePrescriptionForm extends StatefulWidget {
final String startDate; final String startDate;
final String frequency; final String frequency;
final String drugNameGeneric; final String drugNameGeneric;
final PrescriptionViewModel model; final PrescriptionViewModel model;
UpdatePrescriptionForm( UpdatePrescriptionForm(
@ -71,14 +73,44 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
GetMedicationResponseModel newSelectedMedication; GetMedicationResponseModel newSelectedMedication;
GlobalKey key = GlobalKey key =
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>(); new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
List<dynamic> indicationList;
dynamic indication;
DateTime selectedDate;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
remarksController.text = widget.remarks;
indicationList = List();
dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"};
dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"};
dynamic indication3 = {"id": 547, "name": "Hypertrichosis"};
dynamic indication4 = {"id": 548, "name": "Mild Dizziness"};
dynamic indication5 = {"id": 549, "name": "Enlargement of Facial Features"};
dynamic indication6 = {
"id": 550,
"name": "Phenytoin Hypersensitivity Syndrome"
};
dynamic indication7 = {"id": 551, "name": "Asterixis"};
dynamic indication8 = {"id": 552, "name": "Bullous Dermatitis"};
dynamic indication9 = {"id": 554, "name": "Purpuric Dermatitis"};
dynamic indication10 = {"id": 555, "name": "Systemic Lupus Erythematosus"};
indicationList.add(indication1);
indicationList.add(indication2);
indicationList.add(indication3);
indicationList.add(indication4);
indicationList.add(indication5);
indicationList.add(indication6);
indicationList.add(indication7);
indicationList.add(indication8);
indicationList.add(indication9);
indicationList.add(indication10);
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return StatefulBuilder(builder: return StatefulBuilder(builder:
(BuildContext context, StateSetter setState /*You can rename this!*/) { (BuildContext context, StateSetter setState /*You can rename this!*/) {
return BaseView<MedicineViewModel>( return BaseView<MedicineViewModel>(
@ -109,13 +141,14 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
FocusScope.of(context).requestFocus(new FocusNode()); FocusScope.of(context).requestFocus(new FocusNode());
}, },
child: DraggableScrollableSheet( child: DraggableScrollableSheet(
initialChildSize: 0.95, initialChildSize: 0.98,
maxChildSize: 0.99, maxChildSize: 0.99,
minChildSize: 0.6, minChildSize: 0.6,
builder: builder:
(BuildContext context, ScrollController scrollController) { (BuildContext context, ScrollController scrollController) {
return Container( return SingleChildScrollView(
height: MediaQuery.of(context).size.height * 1.3, child: Container(
height: MediaQuery.of(context).size.height * 2.0,
child: Form( child: Form(
child: Padding( child: Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
@ -205,28 +238,33 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
// height: 12, // height: 12,
// ), // ),
Container( Container(
height: MediaQuery.of(context).size.height * height:
MediaQuery.of(context).size.height *
0.060, 0.060,
width: double.infinity, width: double.infinity,
child: Row( child: Row(
children: [ children: [
Container( Container(
width: width: MediaQuery.of(context)
MediaQuery.of(context).size.width * .size
.width *
0.4900, 0.4900,
height: height: MediaQuery.of(context)
MediaQuery.of(context).size.height * .size
.height *
0.55, 0.55,
child: TextFields( child: TextFields(
inputFormatters: [ inputFormatters: [
LengthLimitingTextInputFormatter(4), LengthLimitingTextInputFormatter(
4),
WhitelistingTextInputFormatter WhitelistingTextInputFormatter
.digitsOnly .digitsOnly
], ],
hintText: widget.doseStreangth, hintText: widget.doseStreangth,
fontSize: 15.0, fontSize: 15.0,
controller: strengthController, controller: strengthController,
keyboardType: TextInputType.number, keyboardType:
TextInputType.number,
onChanged: (String value) { onChanged: (String value) {
setState(() { setState(() {
strengthChar = value.length; strengthChar = value.length;
@ -251,35 +289,45 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
width: 10.0, width: 10.0,
), ),
Container( Container(
width: width: MediaQuery.of(context)
MediaQuery.of(context).size.width * .size
.width *
0.3700, 0.3700,
child: InkWell( child: InkWell(
onTap: model.medicationStrengthList != onTap:
model.medicationStrengthList !=
null null
? () { ? () {
Helpers.hideKeyboard(context); Helpers.hideKeyboard(
ListSelectDialog dialog = context);
ListSelectDialog
dialog =
ListSelectDialog( ListSelectDialog(
list: model list: model
.medicationStrengthList, .medicationStrengthList,
attributeName: 'nameEn', attributeName:
attributeValueId: 'id', 'nameEn',
okText: TranslationBase.of( attributeValueId:
'id',
okText:
TranslationBase.of(
context) context)
.ok, .ok,
okFunction: okFunction:
(selectedValue) { (selectedValue) {
setState(() { setState(() {
units = selectedValue; units =
selectedValue;
}); });
}, },
); );
showDialog( showDialog(
barrierDismissible: false, barrierDismissible:
false,
context: context, context: context,
builder: builder:
(BuildContext context) { (BuildContext
context) {
return dialog; return dialog;
}, },
); );
@ -304,7 +352,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
height: 12, height: 12,
), ),
Container( Container(
height: MediaQuery.of(context).size.height * height:
MediaQuery.of(context).size.height *
0.070, 0.070,
child: InkWell( child: InkWell(
onTap: model.medicationRouteList != null onTap: model.medicationRouteList != null
@ -312,11 +361,12 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
Helpers.hideKeyboard(context); Helpers.hideKeyboard(context);
ListSelectDialog dialog = ListSelectDialog dialog =
ListSelectDialog( ListSelectDialog(
list: model.medicationRouteList, list:
model.medicationRouteList,
attributeName: 'nameEn', attributeName: 'nameEn',
attributeValueId: 'id', attributeValueId: 'id',
okText: okText: TranslationBase.of(
TranslationBase.of(context) context)
.ok, .ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
@ -330,14 +380,16 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: (BuildContext context) { builder:
(BuildContext context) {
return dialog; return dialog;
}, },
); );
} }
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration:
textFieldSelectorDecoration(
'Route', 'Route',
route != null route != null
? route['nameEn'] ? route['nameEn']
@ -351,20 +403,22 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
height: 12.0, height: 12.0,
), ),
Container( Container(
height: MediaQuery.of(context).size.height * height:
MediaQuery.of(context).size.height *
0.070, 0.070,
child: InkWell( child: InkWell(
onTap: model.medicationDoseTimeList != null onTap: model.medicationDoseTimeList !=
null
? () { ? () {
Helpers.hideKeyboard(context); Helpers.hideKeyboard(context);
ListSelectDialog dialog = ListSelectDialog dialog =
ListSelectDialog( ListSelectDialog(
list: list: model
model.medicationDoseTimeList, .medicationDoseTimeList,
attributeName: 'nameEn', attributeName: 'nameEn',
attributeValueId: 'id', attributeValueId: 'id',
okText: okText: TranslationBase.of(
TranslationBase.of(context) context)
.ok, .ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
@ -375,15 +429,18 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: (BuildContext context) { builder:
(BuildContext context) {
return dialog; return dialog;
}, },
); );
} }
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration:
TranslationBase.of(context).doseTime, textFieldSelectorDecoration(
TranslationBase.of(context)
.doseTime,
doseTime != null doseTime != null
? doseTime['nameEn'] ? doseTime['nameEn']
: null, : null,
@ -396,20 +453,22 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
height: 12.0, height: 12.0,
), ),
Container( Container(
height: MediaQuery.of(context).size.height * height:
MediaQuery.of(context).size.height *
0.070, 0.070,
child: InkWell( child: InkWell(
onTap: model.medicationFrequencyList != null onTap: model.medicationFrequencyList !=
null
? () { ? () {
Helpers.hideKeyboard(context); Helpers.hideKeyboard(context);
ListSelectDialog dialog = ListSelectDialog dialog =
ListSelectDialog( ListSelectDialog(
list: list: model
model.medicationFrequencyList, .medicationFrequencyList,
attributeName: 'nameEn', attributeName: 'nameEn',
attributeValueId: 'id', attributeValueId: 'id',
okText: okText: TranslationBase.of(
TranslationBase.of(context) context)
.ok, .ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
@ -421,17 +480,21 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: (BuildContext context) { builder:
(BuildContext context) {
return dialog; return dialog;
}, },
); );
} }
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration:
TranslationBase.of(context).frequency, textFieldSelectorDecoration(
TranslationBase.of(context)
.frequency,
frequencyUpdate != null frequencyUpdate != null
? frequencyUpdate['nameEn'] ? frequencyUpdate[
'nameEn']
: null, : null,
true), true),
enabled: false, enabled: false,
@ -442,20 +505,22 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
height: 12.0, height: 12.0,
), ),
Container( Container(
height: MediaQuery.of(context).size.height * height:
MediaQuery.of(context).size.height *
0.070, 0.070,
child: InkWell( child: InkWell(
onTap: model.medicationDurationList != null onTap: model.medicationDurationList !=
null
? () { ? () {
Helpers.hideKeyboard(context); Helpers.hideKeyboard(context);
ListSelectDialog dialog = ListSelectDialog dialog =
ListSelectDialog( ListSelectDialog(
list: list: model
model.medicationDurationList, .medicationDurationList,
attributeName: 'nameEn', attributeName: 'nameEn',
attributeValueId: 'id', attributeValueId: 'id',
okText: okText: TranslationBase.of(
TranslationBase.of(context) context)
.ok, .ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
@ -467,17 +532,21 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: (BuildContext context) { builder:
(BuildContext context) {
return dialog; return dialog;
}, },
); );
} }
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration:
TranslationBase.of(context).duration, textFieldSelectorDecoration(
TranslationBase.of(context)
.duration,
updatedDuration != null updatedDuration != null
? updatedDuration['nameEn'] ? updatedDuration[
'nameEn']
.toString() .toString()
: null, : null,
true), true),
@ -488,6 +557,106 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
SizedBox( SizedBox(
height: 12.0, height: 12.0,
), ),
Container(
height: screenSize.height * 0.070,
width: double.infinity,
child: Row(
children: [
Container(
width: MediaQuery.of(context)
.size
.width *
0.29,
child: InkWell(
onTap: indicationList != null
? () {
Helpers.hideKeyboard(
context);
}
: null,
child: TextField(
decoration:
textFieldSelectorDecoration(
model.patientAssessmentList
.isNotEmpty
? model
.patientAssessmentList[
0]
.icdCode10ID
.toString()
: '',
indication != null
? indication['name']
: null,
true),
enabled: true,
readOnly: true,
),
),
),
Container(
width: MediaQuery.of(context)
.size
.width *
0.61,
child: InkWell(
onTap: indicationList != null
? () {
Helpers.hideKeyboard(
context);
}
: null,
child: TextField(
maxLines: 3,
decoration:
textFieldSelectorDecoration(
model.patientAssessmentList
.isNotEmpty
? model
.patientAssessmentList[
0]
.asciiDesc
.toString()
: '',
indication != null
? indication['name']
: null,
true),
enabled: true,
readOnly: true,
),
),
),
],
),
),
SizedBox(
height: 12.0,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: () =>
selectDate(context, widget.model),
child: TextField(
decoration: Helpers
.textFieldSelectorDecoration(
widget.startDate,
selectedDate != null
? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
: null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
),
),
),
SizedBox(
height: 12.0,
),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
@ -496,18 +665,18 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
width: 1.0, width: 1.0,
color: HexColor("#CCCCCC"))), color: HexColor("#CCCCCC"))),
child: TextFields( child: TextFields(
hintText: widget.remarks,
controller: remarksController, controller: remarksController,
maxLines: 7, maxLines: 7,
minLines: 4, minLines: 4,
), ),
), ),
SizedBox( SizedBox(
height: 12.0, height: 10.0,
), ),
SizedBox( SizedBox(
height: height:
MediaQuery.of(context).size.height * 0.12, MediaQuery.of(context).size.height *
0.08,
), ),
Container( Container(
margin: EdgeInsets.all( margin: EdgeInsets.all(
@ -516,22 +685,24 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
AppButton( AppButton(
title: title: 'update prescription'
'update prescription'.toUpperCase(), .toUpperCase(),
onPressed: () { onPressed: () {
updatePrescription( updatePrescription(
newStartDate: selectedDate,
newDoseStreangth: newDoseStreangth:
strengthController strengthController
.text.isNotEmpty .text.isNotEmpty
? strengthController.text ? strengthController
: widget.doseStreangth, .text
newUnit: units != : widget
null .doseStreangth,
newUnit: units != null
? units['id'].toString() ? units['id'].toString()
: widget.doseUnit, : widget.doseUnit,
doseUnit: widget.doseUnit, doseUnit: widget.doseUnit,
doseStreangth: widget doseStreangth:
.doseStreangth, widget.doseStreangth,
duration: widget.duration, duration: widget.duration,
startDate: widget.startDate, startDate: widget.startDate,
doseId: widget.dose, doseId: widget.dose,
@ -539,27 +710,25 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
routeId: widget.route, routeId: widget.route,
patient: widget.patient, patient: widget.patient,
model: widget.model, model: widget.model,
newDuration: newDuration: updatedDuration !=
updatedDuration !=
null null
? updatedDuration[ ? updatedDuration['id']
'id']
.toString() .toString()
: widget.duration, : widget.duration,
drugId: widget.drugId, drugId: widget.drugId,
remarks: remarksController.text, remarks:
route: route != remarksController.text,
null route: route != null
? route['id'].toString() ? route['id'].toString()
: widget.route, : widget.route,
frequency: frequency: frequencyUpdate !=
frequencyUpdate !=
null null
? frequencyUpdate['id'] ? frequencyUpdate['id']
.toString() .toString()
: widget.frequency, : widget.frequency,
dose: doseTime != null dose: doseTime != null
? doseTime['id'].toString() ? doseTime['id']
.toString()
: widget.dose, : widget.dose,
enteredRemarks: enteredRemarks:
widget.enteredRemarks); widget.enteredRemarks);
@ -574,7 +743,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
], ],
), ),
), ),
)); )),
);
}), }),
), ),
), ),
@ -582,6 +752,24 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
}); });
} }
selectDate(BuildContext context, PrescriptionViewModel model) async {
Helpers.hideKeyboard(context);
DateTime selectedDate;
selectedDate = DateTime.now();
final DateTime picked = await showDatePicker(
context: context,
initialDate: selectedDate,
firstDate: DateTime.now(),
lastDate: DateTime(2040),
initialEntryMode: DatePickerEntryMode.calendar,
);
if (picked != null && picked != selectedDate) {
setState(() {
this.selectedDate = picked;
});
}
}
InputDecoration textFieldSelectorDecoration( InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown, String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon}) { {Icon suffixIcon}) {
@ -626,6 +814,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
String route, String route,
String routeId, String routeId,
String startDate, String startDate,
DateTime newStartDate,
String doseUnit, String doseUnit,
String doseStreangth, String doseStreangth,
String newDoseStreangth, String newDoseStreangth,
@ -664,7 +853,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
duration: newDuration.isNotEmpty duration: newDuration.isNotEmpty
? int.parse(newDuration) ? int.parse(newDuration)
: int.parse(duration), : int.parse(duration),
doseStartDate: startDate)); doseStartDate:
newStartDate != null ? newStartDate.toIso8601String() : startDate));
updatePrescriptionReqModel.prescriptionRequestModel = sss; updatePrescriptionReqModel.prescriptionRequestModel = sss;
//postProcedureReqModel.procedures = controlsProcedure; //postProcedureReqModel.procedures = controlsProcedure;

@ -34,13 +34,12 @@ postProcedure(
postProcedureReqModel.patientMRN = patient.patientMRN; postProcedureReqModel.patientMRN = patient.patientMRN;
entityList.forEach((element) { entityList.forEach((element) {
controls.add( controls.add(
Controls(code: "remarks", controlValue: remarks.isEmpty ? '' : remarks), Controls(
code: "remarks",
controlValue: element.remarks.isNotEmpty ? element.remarks : ""),
); );
controls.add( controls.add(
Controls( Controls(code: "ordertype", controlValue: element.type),
code: "ordertype",
controlValue:
orderType.toString().isNotEmpty ? orderType.toString() : '1'),
); );
}); });
@ -218,43 +217,43 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
Column( Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Container( // Container(
child: Row( // child: Row(
children: [ // children: [
AppText( // AppText(
TranslationBase.of(context).orderType), // TranslationBase.of(context).orderType),
Radio( // Radio(
activeColor: Color(0xFFB9382C), // activeColor: Color(0xFFB9382C),
value: 1, // value: 1,
groupValue: selectedType, // groupValue: selectedType,
onChanged: (value) { // onChanged: (value) {
setSelectedType(value); // setSelectedType(value);
}, // },
), // ),
Text('routine'), // Text('routine'),
Radio( // Radio(
activeColor: Color(0xFFB9382C), // activeColor: Color(0xFFB9382C),
groupValue: selectedType, // groupValue: selectedType,
value: 0, // value: 0,
onChanged: (value) { // onChanged: (value) {
setSelectedType(value); // setSelectedType(value);
}, // },
), // ),
Text(TranslationBase.of(context).urgent), // Text(TranslationBase.of(context).urgent),
], // ],
), // ),
), // ),
SizedBox( // SizedBox(
height: 15.0, // height: 15.0,
), // ),
TextFields( // TextFields(
hintText: TranslationBase.of(context).remarks, // hintText: TranslationBase.of(context).remarks,
controller: remarksController, // controller: remarksController,
minLines: 3, // minLines: 3,
maxLines: 5, // maxLines: 5,
), // ),
SizedBox( SizedBox(
height: 50.0, height: 100.0,
), ),
Container( Container(
margin: EdgeInsets.all( margin: EdgeInsets.all(
@ -266,6 +265,7 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
title: TranslationBase.of(context) title: TranslationBase.of(context)
.addSelectedProcedures, .addSelectedProcedures,
onPressed: () { onPressed: () {
//print(entityList.toString());
Navigator.pop(context); Navigator.pop(context);
postProcedure( postProcedure(
orderType: selectedType.toString(), orderType: selectedType.toString(),

@ -17,6 +17,8 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
final Function addSelectedHistories; final Function addSelectedHistories;
final Function(EntityList) removeHistory; final Function(EntityList) removeHistory;
final Function(EntityList) addHistory; final Function(EntityList) addHistory;
final Function(EntityList) addRemarks;
final bool Function(EntityList) isEntityListSelected; final bool Function(EntityList) isEntityListSelected;
final List<EntityList> masterList; final List<EntityList> masterList;
@ -27,7 +29,8 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
this.removeHistory, this.removeHistory,
this.masterList, this.masterList,
this.addHistory, this.addHistory,
this.isEntityListSelected}) this.isEntityListSelected,
this.addRemarks})
: super(key: key); : super(key: key);
@override @override
@ -37,7 +40,7 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
class _EntityListCheckboxSearchWidgetState class _EntityListCheckboxSearchWidgetState
extends State<EntityListCheckboxSearchWidget> { extends State<EntityListCheckboxSearchWidget> {
int selectedType; int selectedType = 1;
setSelectedType(int val) { setSelectedType(int val) {
setState(() { setState(() {
selectedType = val; selectedType = val;
@ -45,6 +48,8 @@ class _EntityListCheckboxSearchWidgetState
} }
List<EntityList> items = List(); List<EntityList> items = List();
List<String> remarksList = List();
List<int> typeList = List();
@override @override
void initState() { void initState() {
@ -52,6 +57,7 @@ class _EntityListCheckboxSearchWidgetState
super.initState(); super.initState();
} }
TextEditingController remarksController = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
@ -84,7 +90,8 @@ class _EntityListCheckboxSearchWidgetState
children: items.map((historyInfo) { children: items.map((historyInfo) {
return Column( return Column(
children: [ children: [
Row( ExpansionTile(
title: Row(
children: [ children: [
Checkbox( Checkbox(
value: widget.isEntityListSelected( value: widget.isEntityListSelected(
@ -94,10 +101,11 @@ class _EntityListCheckboxSearchWidgetState
setState(() { setState(() {
if (widget.isEntityListSelected( if (widget.isEntityListSelected(
historyInfo)) { historyInfo)) {
widget widget.removeHistory(
.removeHistory(historyInfo); historyInfo);
} else { } else {
widget.addHistory(historyInfo); widget
.addHistory(historyInfo);
} }
}); });
}), }),
@ -114,6 +122,57 @@ class _EntityListCheckboxSearchWidgetState
), ),
], ],
), ),
children: [
Container(
child: Row(
children: [
AppText(TranslationBase.of(context)
.orderType),
Radio(
activeColor: Color(0xFFB9382C),
value: 1,
groupValue: selectedType,
onChanged: (value) {
historyInfo.type =
setSelectedType(value)
.toString();
// historyInfo.type =
// value.toString();
},
),
Text('routine'),
Radio(
activeColor: Color(0xFFB9382C),
groupValue: selectedType,
value: 0,
onChanged: (value) {
historyInfo.type =
setSelectedType(value)
.toString();
// historyInfo.type =
// value.toString();
},
),
Text(TranslationBase.of(context)
.urgent),
],
),
),
SizedBox(
height: 15.0,
),
TextFields(
hintText:
TranslationBase.of(context).remarks,
//controller: remarksController,
onChanged: (value) {
historyInfo.remarks = value;
},
minLines: 3,
maxLines: 5,
),
],
),
DividerWithSpacesAround(), DividerWithSpacesAround(),
], ],
); );

@ -200,51 +200,51 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
isEntityListSelected(master), isEntityListSelected(master),
), ),
), ),
Container( // Container(
child: Row( // child: Row(
children: [ // children: [
AppText( // AppText(
TranslationBase.of(context).orderType), // TranslationBase.of(context).orderType),
Radio( // Radio(
activeColor: Color(0xFFB9382C), // activeColor: Color(0xFFB9382C),
value: 0, // value: 0,
groupValue: selectedType, // groupValue: selectedType,
onChanged: (value) { // onChanged: (value) {
setSelectedType(value); // setSelectedType(value);
}, // },
), // ),
Text(TranslationBase.of(context).urgent), // Text(TranslationBase.of(context).urgent),
Radio( // Radio(
activeColor: Color(0xFFB9382C), // activeColor: Color(0xFFB9382C),
groupValue: selectedType, // groupValue: selectedType,
value: 1, // value: 1,
onChanged: (value) { // onChanged: (value) {
setSelectedType(value); // setSelectedType(value);
}, // },
), // ),
Text('routine'), // Text('routine'),
], // ],
), // ),
), // ),
SizedBox( // SizedBox(
height: 12.0, // height: 12.0,
), // ),
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, // width: 1.0,
color: HexColor("#CCCCCC"))), // color: HexColor("#CCCCCC"))),
child: TextFields( // child: TextFields(
hintText: widget.remarks, // hintText: widget.remarks,
fontSize: 15.0, // fontSize: 15.0,
controller: widget.remarksController, // controller: widget.remarksController,
maxLines: 3, // maxLines: 3,
minLines: 2, // minLines: 2,
onChanged: (value) {}, // onChanged: (value) {},
), // ),
), // ),
SizedBox( SizedBox(
height: 50.0, height: 50.0,
), ),

@ -1117,6 +1117,9 @@ class TranslationBase {
localizedValues['otherProcedure'][locale.languageCode]; localizedValues['otherProcedure'][locale.languageCode];
String get admissionRequestSuccessMsg => String get admissionRequestSuccessMsg =>
localizedValues['admissionRequestSuccessMsg'][locale.languageCode]; localizedValues['admissionRequestSuccessMsg'][locale.languageCode];
String get infoStatus => localizedValues['infoStatus'][locale.languageCode];
String get doctorResponse =>
localizedValues['doctorResponse'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -233,11 +233,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () => { onTap: () => {
authenticateUser( authenticateUser(3, true, authProv)
3,
BiometricType
.face.index,
authProv)
}, },
child: getButton( child: getButton(
user.logInTypeID, user.logInTypeID,
@ -488,8 +484,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
onTap: () => { onTap: () => {
if (checkIfBiometricAvailable(BiometricType.fingerprint)) if (checkIfBiometricAvailable(BiometricType.fingerprint))
{ {
authenticateUser( authenticateUser(3, true, authProv)
3, BiometricType.fingerprint.index, authProv)
} }
}, },
child: RoundedContainer( child: RoundedContainer(
@ -524,7 +519,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
return InkWell( return InkWell(
onTap: () { onTap: () {
if (checkIfBiometricAvailable(BiometricType.face)) { if (checkIfBiometricAvailable(BiometricType.face)) {
authenticateUser(4, BiometricType.face.index, authProv); authenticateUser(4, true, authProv);
} }
}, },
child: RoundedContainer( child: RoundedContainer(
@ -706,7 +701,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
} }
loginWithFingurePrintFace(type, isActive, authProv) async { loginWithFingurePrintFace(type, isActive, authProv) async {
if (isActive == 1) { if (isActive) {
// this.startBiometricLoginIfAvailable(); // this.startBiometricLoginIfAvailable();
authenticated = await auth.authenticateWithBiometrics( authenticated = await auth.authenticateWithBiometrics(
localizedReason: 'Scan your fingerprint to authenticate', localizedReason: 'Scan your fingerprint to authenticate',

@ -167,12 +167,58 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
children: <Widget>[ children: <Widget>[
Divider(color: Colors.grey), Divider(color: Colors.grey),
SizedBox(height: 5,), SizedBox(height: 5,),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText( AppText(
TranslationBase.of(context).remarks + " : ",
fontSize: 2.5 * SizeConfig.textMultiplier,
//fontWeight: FontWeight.bold,
),Expanded(
child: AppText(
widget.reply.remarks, widget.reply.remarks,
fontSize: 2.5 * SizeConfig.textMultiplier, fontSize: 2.5 * SizeConfig.textMultiplier,
//fontWeight: FontWeight.bold, //fontWeight: FontWeight.bold,
), ),
SizedBox(height: 10,) ),
],
),
SizedBox(height: 10,),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).doctorResponse + " : ",
fontSize: 2.5 * SizeConfig.textMultiplier,
//fontWeight: FontWeight.bold,
),Expanded(
child: AppText(
widget.reply.doctorResponse,
fontSize: 2.5 * SizeConfig.textMultiplier,
//fontWeight: FontWeight.bold,
),
),
],
),SizedBox(height: 10,),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).infoStatus + " : ",
fontSize: 2.5 * SizeConfig.textMultiplier,
//fontWeight: FontWeight.bold,
),Expanded(
child: AppText(
widget.reply.infoStatus,
fontSize: 2.5 * SizeConfig.textMultiplier,
//fontWeight: FontWeight.bold,
),
),
],
)
], ],
), ),
), ),

@ -29,7 +29,11 @@ class AppScaffold extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppGlobal.CONTEX = context; AppGlobal.CONTEX = context;
ProjectViewModel projectProvider = Provider.of(context); ProjectViewModel projectProvider = Provider.of(context);
return Scaffold( return GestureDetector(
onTap: (){
FocusScope.of(context).requestFocus(new FocusNode());
},
child: Scaffold(
backgroundColor: Colors.white, backgroundColor: Colors.white,
appBar: isShowAppBar appBar: isShowAppBar
? AppBar( ? AppBar(
@ -76,6 +80,7 @@ class AppScaffold extends StatelessWidget {
], ],
), ),
), ),
),
); );
} }

Loading…
Cancel
Save