merge-requests/267/head
Sultan Khan 5 years ago
commit 135c852e8c

@ -649,5 +649,21 @@ const Map<String, Map<String, String>> localizedValues = {
}, },
'active': {'en': "Active", 'ar': "نشيط"}, 'active': {'en': "Active", 'ar': "نشيط"},
'hold': {'en': "Hold", 'ar': "معلق"}, 'hold': {'en': "Hold", 'ar': "معلق"},
'loading': {'en': "Loading...", 'ar': "جار التحميل..."} 'loading': {'en': "Loading...", 'ar': "جار التحميل..."},
'assessmentErrorMsg': {
'en': "You have to add at least one assessment.",
'ar': "يجب عليك إضافة تقييم واحد على الأقل."
},
'examinationErrorMsg': {
'en': "You have to add at least one examination.",
'ar': "يجب عليك إضافة الفحص واحد على الأقل."
},
'progressNoteErrorMsg': {
'en': "You have to add progress Note.",
'ar': "يجب عليك إضافة ملاحظة التقدم."
},
'chiefComplaintErrorMsg': {
'en': "You have to add chief complaint fields correctly .",
'ar': "يجب عليك إضافة حقول شكوى الرئيس بشكل صحيح"
},
}; };

@ -0,0 +1,36 @@
class GetMedicationResponseModel {
String description;
String genericName;
int itemId;
String keywords;
dynamic price;
dynamic quantity;
GetMedicationResponseModel(
{this.description,
this.genericName,
this.itemId,
this.keywords,
this.price,
this.quantity});
GetMedicationResponseModel.fromJson(Map<String, dynamic> json) {
description = json['Description'];
genericName = json['GenericName'];
itemId = json['ItemId'];
keywords = json['Keywords'];
price = json['Price'];
quantity = json['Quantity'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Description'] = this.description;
data['GenericName'] = this.genericName;
data['ItemId'] = this.itemId;
data['Keywords'] = this.keywords;
data['Price'] = this.price;
data['Quantity'] = this.quantity;
return data;
}
}

@ -1,18 +1,18 @@
class SearchDrugRequestModel { class SearchDrugRequestModel {
List<String> search; List<String> search;
String vidaAuthTokenID; // String vidaAuthTokenID;
SearchDrugRequestModel({this.search, this.vidaAuthTokenID}); SearchDrugRequestModel({this.search});
SearchDrugRequestModel.fromJson(Map<String, dynamic> json) { SearchDrugRequestModel.fromJson(Map<String, dynamic> json) {
search = json['Search'].cast<String>(); search = json['Search'].cast<String>();
vidaAuthTokenID = json['VidaAuthTokenID']; // vidaAuthTokenID = json['VidaAuthTokenID'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['Search'] = this.search; data['Search'] = this.search;
data['VidaAuthTokenID'] = this.vidaAuthTokenID; // data['VidaAuthTokenID'] = this.vidaAuthTokenID;
return data; return data;
} }
} }

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart';
import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/model/prescription_req_model.dart'; import 'package:doctor_app_flutter/core/model/prescription_req_model.dart';
import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug_model.dart';
@ -16,6 +17,7 @@ class PrescriptionService extends BaseService {
List<SearchDrugModel> _drugsList = List(); List<SearchDrugModel> _drugsList = List();
List<SearchDrugModel> get drugsList => _drugsList; List<SearchDrugModel> get drugsList => _drugsList;
List<dynamic> doctorsList = []; List<dynamic> doctorsList = [];
List<GetMedicationResponseModel> allMedicationList = [];
List<dynamic> specialityList = []; List<dynamic> specialityList = [];
List<dynamic> drugToDrug = []; List<dynamic> drugToDrug = [];
@ -59,6 +61,21 @@ class PrescriptionService extends BaseService {
}, body: _drugRequestModel.toJson()); }, body: _drugRequestModel.toJson());
} }
Future getMedicationList() async {
hasError = false;
_drugRequestModel.search =[""];
await baseAppClient.post(SEARCH_DRUG,
onSuccess: (dynamic response, int statusCode) {
allMedicationList = [];
response['MedicationList']['entityList'].forEach((v) {
allMedicationList.add(GetMedicationResponseModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _drugRequestModel.toJson());
}
Future postPrescription( Future postPrescription(
PostPrescriptionReqModel postProcedureReqModel) async { PostPrescriptionReqModel postProcedureReqModel) async {
hasError = false; hasError = false;

@ -92,7 +92,10 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getMasterLookup(MasterKeysService masterKeys) async { Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false}) async {
if(isBusyLocal){
setState(ViewState.Busy);
}else
setState(ViewState.Busy); setState(ViewState.Busy);
await _SOAPService.getMasterLookup(masterKeys); await _SOAPService.getMasterLookup(masterKeys);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {

@ -1,5 +1,7 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/service/medicine_service.dart'; import 'package:doctor_app_flutter/core/service/medicine_service.dart';
import 'package:doctor_app_flutter/core/service/prescription_service.dart';
import '../../locator.dart'; import '../../locator.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';
@ -9,6 +11,9 @@ class MedicineViewModel extends BaseViewModel {
get pharmacyItemsList => _medicineService.pharmacyItemsList; get pharmacyItemsList => _medicineService.pharmacyItemsList;
get pharmaciesList => _medicineService.pharmaciesList; get pharmaciesList => _medicineService.pharmaciesList;
PrescriptionService _prescriptionService = locator<PrescriptionService>();
List<GetMedicationResponseModel> get allMedicationList => _prescriptionService.allMedicationList;
Future getMedicineItem(String itemName) async { Future getMedicineItem(String itemName) async {
setState(ViewState.Busy); setState(ViewState.Busy);
@ -19,6 +24,15 @@ class MedicineViewModel extends BaseViewModel {
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getMedicationList() async {
setState(ViewState.Busy);
await _prescriptionService.getMedicationList();
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getPharmaciesList(int itemId) async { Future getPharmaciesList(int itemId) async {
setState(ViewState.Busy); setState(ViewState.Busy);

@ -17,6 +17,7 @@ class PrescriptionViewModel extends BaseViewModel {
List<PrescriptionModel> get prescriptionList => List<PrescriptionModel> get prescriptionList =>
_prescriptionService.prescriptionList; _prescriptionService.prescriptionList;
List<dynamic> get drugsList => _prescriptionService.doctorsList; List<dynamic> get drugsList => _prescriptionService.doctorsList;
List<dynamic> get allMedicationList => _prescriptionService.allMedicationList;
Future getPrescription({int mrn}) async { Future getPrescription({int mrn}) async {
hasError = false; hasError = false;

@ -1,8 +1,8 @@
const PATIENT_TYPE = const [ const PATIENT_TYPE = const [
{"text": "outPatiant", "text_ar": "المريض الخارجي", "val": "0"}, {"text": "Outpatient", "text_ar": "المريض الخارجي", "val": "0"},
{"text": "InPatiant", "text_ar": "المريض المنوم", "val": "1"}, {"text": "Inpatient", "text_ar": "المريض المنوم", "val": "1"},
{"text": "Discharge", "text_ar": "المريض المعافى", "val": "2"}, {"text": "Discharge", "text_ar": "المريض المعافى", "val": "2"},
{"text": "Referrd", "text_ar": "المريض المحول الي", "val": "3"}, {"text": "Referred", "text_ar": "المريض المحول الي", "val": "3"},
{ {
"text": "Referral Discharge", "text": "Referral Discharge",
"text_ar": "المريض المحال المعافى", "text_ar": "المريض المحال المعافى",

@ -135,7 +135,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
/// var result = await BarcodeScanner.scan(); /// var result = await BarcodeScanner.scan();
/// int patientID = get from qr result /// int patientID = get from qr result
var result = await BarcodeScanner.scan(); var result = await BarcodeScanner.scan();
// if (result.rawContent == "") { if (result.rawContent != "") {
List<String> listOfParams = result.rawContent.split(','); List<String> listOfParams = result.rawContent.split(',');
String patientType = "1"; String patientType = "1";
setState(() { setState(() {
@ -213,5 +213,5 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
//DrAppToastMsg.showErrorToast(error); //DrAppToastMsg.showErrorToast(error);
}); });
} }
// } }
} }

@ -1,7 +1,8 @@
import 'dart:math'; import 'dart:math';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
@ -11,12 +12,12 @@ 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';
import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart'; import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_error.dart';
@ -45,6 +46,9 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
bool _isInit = true; bool _isInit = true;
final SpeechToText speech = SpeechToText(); final SpeechToText speech = SpeechToText();
String lastStatus = ''; String lastStatus = '';
GetMedicationResponseModel _selectedMedication;
GlobalKey key =
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
// String lastWords; // String lastWords;
List<LocaleName> _localeNames = []; List<LocaleName> _localeNames = [];
@ -84,12 +88,46 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
}); });
} }
InputDecoration textFieldSelectorDecoration(String hintText,
String selectedText, bool isDropDown,
{IconData icon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<MedicineViewModel>( return BaseView<MedicineViewModel>(
builder: (_, model, w) => AppScaffold( onModelReady: (model) async {
appBarTitle: TranslationBase.of(context).searchMedicine, if(model.allMedicationList.isNotEmpty)
body: FractionallySizedBox( await model.getMedicationList();
},
builder: (_, model, w) =>
AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase
.of(context)
.searchMedicine,
body: SingleChildScrollView(
child: FractionallySizedBox(
widthFactor: 0.97, widthFactor: 0.97,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
@ -129,29 +167,66 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Container( Container(
child: AppTextFormField( height: MediaQuery
hintText: TranslationBase.of(context) .of(context)
.size
.height * 0.070,
child: InkWell(
onTap: model.allMedicationList != null
? () {
setState(() {
_selectedMedication = null;
});
}
: null,
child: _selectedMedication == null
? AutoCompleteTextField<
GetMedicationResponseModel>(
decoration: textFieldSelectorDecoration(
TranslationBase
.of(context)
.searchMedicineNameHere, .searchMedicineNameHere,
controller: myController, _selectedMedication != null
onSaved: (value) {}, ? _selectedMedication.genericName
onFieldSubmitted: (value) { : null,
searchMedicine(context, model); true,
}, icon: EvaIcons.search),
textInputAction: TextInputAction.search, itemSubmitted: (item) =>
// TODO return it back when it needed setState(
// prefix: IconButton( () => _selectedMedication = item),
// icon: Icon(Icons.mic), key: key,
// color: suggestions: model.allMedicationList,
// lastStatus == 'listening' ? Colors.red : Colors.grey, itemBuilder: (context, suggestion) =>
// onPressed: () { new Padding(
// myController.text = ''; child: Texts(suggestion.description + '/' +
// setState(() { suggestion.genericName),
// lastStatus = 'listening'; padding: EdgeInsets.all(8.0)),
// }); itemSorter: (a, b) => 1,
// itemFilter: (suggestion, input) =>
// startVoiceSearch(); suggestion.genericName
// }), .toLowerCase()
inputFormatter: ONLY_LETTERS), .startsWith(input.toLowerCase()) ||
suggestion.description
.toLowerCase()
.startsWith(input.toLowerCase()) ||
suggestion.keywords
.toLowerCase()
.startsWith(input.toLowerCase()),
)
: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase
.of(context)
.searchMedicineNameHere,
_selectedMedication != null
? _selectedMedication.description +
('${_selectedMedication.genericName}')
: null,
true,
icon: EvaIcons.search),
enabled: false,
),
),
), ),
SizedBox( SizedBox(
height: 15, height: 15,
@ -163,15 +238,13 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
// TODO change it secondary button and add loading // TODO change it secondary button and add loading
AppButton( AppButton(
title: TranslationBase.of(context).search, title: TranslationBase.of(context).search,
onPressed: () async{ onPressed: () async {
await searchMedicine(context, model); await searchMedicine(context, model);
}, },
), ),
], ],
), ),
), ),
Column( Column(
children: [ children: [
Container( Container(
@ -204,21 +277,16 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: itemCount: model.pharmacyItemsList == null
model.pharmacyItemsList ==
null
? 0 ? 0
: model : model.pharmacyItemsList.length,
.pharmacyItemsList.length, itemBuilder: (BuildContext context,
itemBuilder: int index) {
(BuildContext context, int index) {
return InkWell( return InkWell(
child: MedicineItemWidget( child: MedicineItemWidget(
label: model label: model.pharmacyItemsList[index]
.pharmacyItemsList[index]
["ItemDescription"], ["ItemDescription"],
url: model url: model.pharmacyItemsList[index]
.pharmacyItemsList[index]
["ImageSRCUrl"], ["ImageSRCUrl"],
), ),
onTap: () { onTap: () {
@ -227,8 +295,8 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) =>
PharmaciesListScreen( PharmaciesListScreen(
itemID: model itemID:
.pharmacyItemsList[ model.pharmacyItemsList[
index]["ItemID"], index]["ItemID"],
url: model url: model
.pharmacyItemsList[ .pharmacyItemsList[
@ -249,19 +317,20 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
], ],
), ),
), ),
),
),),); ),),);
} }
searchMedicine(context, MedicineViewModel model) async { searchMedicine(context, MedicineViewModel model) async {
FocusScope.of(context).unfocus(); FocusScope.of(context).unfocus();
if (myController.text.isNullOrEmpty()) { if (_selectedMedication.isNullOrEmpty()) {
helpers.showErrorToast(TranslationBase helpers.showErrorToast(TranslationBase
.of(context) .of(context)
.typeMedicineName); .typeMedicineName);
//"Type Medicine Name") //"Type Medicine Name")
return; return;
} } else
if (myController.text.length < 3) { if (_selectedMedication.description.length < 3) {
helpers.showErrorToast(TranslationBase helpers.showErrorToast(TranslationBase
.of(context) .of(context)
.moreThan3Letter); .moreThan3Letter);
@ -270,7 +339,7 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.getMedicineItem(myController.text); await model.getMedicineItem(_selectedMedication.description);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
} }

@ -42,7 +42,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
String itemText2 = ''; String itemText2 = '';
final GlobalKey<FormState> _formKey = GlobalKey<FormState>(); final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
bool _autoValidate = false; bool _autoValidate = false;
bool onlyArrived = false; bool onlyArrived = true;
var _patientSearchFormValues = PatientModel( var _patientSearchFormValues = PatientModel(
FirstName: "0", FirstName: "0",

@ -141,9 +141,13 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
indent: 0, indent: 0,
endIndent: 0, endIndent: 0,
), ),
Row(mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText( AppText(
notesList[index]["Notes"], notesList[index]["Notes"],
margin: 5, margin: 5,
),
],
) )
], ],
), ),

@ -1025,6 +1025,17 @@ class TranslationBase {
String get active => localizedValues['active'][locale.languageCode]; String get active => localizedValues['active'][locale.languageCode];
String get hold => localizedValues['hold'][locale.languageCode]; String get hold => localizedValues['hold'][locale.languageCode];
String get loading => localizedValues['loading'][locale.languageCode]; String get loading => localizedValues['loading'][locale.languageCode];
String get assessmentErrorMsg =>
localizedValues['assessmentErrorMsg'][locale.languageCode];
String get examinationErrorMsg =>
localizedValues['examinationErrorMsg'][locale.languageCode];
String get progressNoteErrorMsg =>
localizedValues['progressNoteErrorMsg'][locale.languageCode];
String get chiefComplaintErrorMsg =>
localizedValues['chiefComplaintErrorMsg'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -77,7 +77,7 @@ class PatientPageHeaderWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context).age, TranslationBase.of(context).age ,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -74,7 +75,7 @@ class StepsWidget extends StatelessWidget {
AppText( AppText(
"SUBJECTIVE", "SUBJECTIVE",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
], ],
), ),
@ -86,7 +87,7 @@ class StepsWidget extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: () => index >= 1 ? changeCurrentTab(1) : null, onTap: () => index >= 1 ? changeCurrentTab(1) : null,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
width: index == 1 ? 70 : 50, width: index == 1 ? 70 : 50,
@ -124,7 +125,7 @@ class StepsWidget extends StatelessWidget {
AppText( AppText(
"OBJECTIVE", "OBJECTIVE",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize:SizeConfig.textMultiplier * 2.0,
), ),
], ],
), ),
@ -139,7 +140,7 @@ class StepsWidget extends StatelessWidget {
changeCurrentTab(2); changeCurrentTab(2);
}, },
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
width: index == 2 ? 70 : 50, width: index == 2 ? 70 : 50,
@ -177,7 +178,7 @@ class StepsWidget extends StatelessWidget {
AppText( AppText(
"ASSESSMENT", "ASSESSMENT",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize:SizeConfig.textMultiplier * 2.0,
), ),
], ],
), ),
@ -189,7 +190,7 @@ class StepsWidget extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(4) : null, onTap: () => index >= 3 ? changeCurrentTab(4) : null,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
width: index == 3 ? 70 : 50, width: index == 3 ? 70 : 50,
@ -224,13 +225,12 @@ class StepsWidget extends StatelessWidget {
SizedBox( SizedBox(
height: index == 3 ? 5 : 10, height: index == 3 ? 5 : 10,
), ),
Container( Center(
margin: EdgeInsets.only(left: index == 3? 15:0),
child: AppText( child: AppText(
"PLAN", "PLAN",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.center, textAlign: TextAlign.center,
fontSize: 14, fontSize:SizeConfig.textMultiplier * 2.0,
), ),
), ),
], ],
@ -309,7 +309,7 @@ class StepsWidget extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null, onTap: () => index >= 2 ? changeCurrentTab(1) : null,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
width: index == 1 ? 70 : 50, width: index == 1 ? 70 : 50,
@ -347,7 +347,7 @@ class StepsWidget extends StatelessWidget {
AppText( AppText(
"هدف", "هدف",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize:SizeConfig.textMultiplier * 2.0,
), ),
], ],
), ),
@ -359,7 +359,7 @@ class StepsWidget extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(2) : null, onTap: () => index >= 3 ? changeCurrentTab(2) : null,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
width: index == 2 ? 70 : 50, width: index == 2 ? 70 : 50,
@ -400,7 +400,7 @@ class StepsWidget extends StatelessWidget {
child: AppText( child: AppText(
"تقدير", "تقدير",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize:SizeConfig.textMultiplier * 2.0,
), ),
), ),
], ],
@ -413,7 +413,7 @@ class StepsWidget extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(4) : null, onTap: () => index >= 3 ? changeCurrentTab(4) : null,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
width: index == 3 ? 70 : 50, width: index == 3 ? 70 : 50,
@ -453,7 +453,7 @@ class StepsWidget extends StatelessWidget {
child: AppText( child: AppText(
"خطة", "خطة",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize:SizeConfig.textMultiplier * 2.0,
), ),
), ),
], ],

@ -272,13 +272,19 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
onModelReady: (model) async { onModelReady: (model) async {
if (model.historyFamilyList.length == 0) { if (model.historyFamilyList.length == 0) {
await model.getMasterLookup(MasterKeysService.HistoryFamily); await model.getMasterLookup(MasterKeysService.HistoryFamily);
setState(() { }
}); if (model.historySurgicalList.length == 0) {
await model.getMasterLookup(MasterKeysService.HistorySurgical);
await model.getMasterLookup(MasterKeysService.HistorySports);
}
if (model.historyMedicalList.length == 0) {
await model.getMasterLookup(MasterKeysService.HistoryMedical);
} }
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
// baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
body: Center( body: Center(
child: Container( child: Container(
@ -291,17 +297,6 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
), ),
PriorityBar(onTap: (activePriority) async { PriorityBar(onTap: (activePriority) async {
widget.changePageViewIndex(activePriority); widget.changePageViewIndex(activePriority);
if(activePriority ==1) {
if (model.historySurgicalList.length == 0) {
await model.getMasterLookup(MasterKeysService.HistorySurgical);
await model.getMasterLookup(MasterKeysService.HistorySports);
}
}
if(activePriority ==2) {
if (model.historyMedicalList.length == 0) {
await model.getMasterLookup(MasterKeysService.HistoryMedical);
}
}
}), }),
SizedBox( SizedBox(
height: 20, height: 20,

@ -504,7 +504,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
} else { } else {
helpers.showErrorToast(TranslationBase helpers.showErrorToast(TranslationBase
.of(context) .of(context)
.requiredMsg); .chiefComplaintErrorMsg);
} }

@ -381,9 +381,13 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
.next, .next,
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
onPressed: () async { onPressed: () async {
if (widget.mySelectedAssessmentList.isEmpty) {
helpers.showErrorToast(
TranslationBase.of(context).assessmentErrorMsg);
} else {
widget.changePageViewIndex(3); widget.changePageViewIndex(3);
widget.changeLoadingState(true); widget.changeLoadingState(true);
}
}, },
), ),
SizedBox( SizedBox(
@ -690,6 +694,9 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
maxLines: 18, maxLines: 18,
minLines: 5, minLines: 5,
controller: remarkController, controller: remarkController,
onChanged:(value) {
widget.mySelectedAssessment.remark = remarkController.text;
},
validator: (value) { validator: (value) {
if (value == null) if (value == null)
return TranslationBase return TranslationBase

@ -412,11 +412,11 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
widget.changePageViewIndex(2); widget.changePageViewIndex(2);
} }
} else { } else {
widget.changeLoadingState(true); // widget.changeLoadingState(true);
//
widget.changePageViewIndex(2); // widget.changePageViewIndex(2);
// helpers.showErrorToast(TranslationBase.of(context).requiredMsg); helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg);
} }
} }
@ -505,7 +505,7 @@ class _AddExaminationDailogState extends State<AddExaminationDailog> {
}, },
builder: (_, model, w) => builder: (_, model, w) =>
AppScaffold( AppScaffold(
// baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
body: Center( body: Center(
child: Container( child: Container(
@ -518,16 +518,14 @@ class _AddExaminationDailogState extends State<AddExaminationDailog> {
height: 16, height: 16,
), ),
AppText( AppText(
"Examinations", TranslationBase.of(context).physicalSystemExamination,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16, fontSize: 16,
), ),
SizedBox( SizedBox(
height: 16, height: 16,
), ),
NetworkBaseView( MasterKeyCheckboxSearchWidget(
baseViewModel: model,
child: MasterKeyCheckboxSearchWidget(
model: model, model: model,
hintSearchText: TranslationBase.of(context).searchExamination, hintSearchText: TranslationBase.of(context).searchExamination,
buttonName: TranslationBase.of(context).addExamination, buttonName: TranslationBase.of(context).addExamination,
@ -553,7 +551,6 @@ class _AddExaminationDailogState extends State<AddExaminationDailog> {
}, },
isServiceSelected: (master) =>isServiceSelected(master), isServiceSelected: (master) =>isServiceSelected(master),
), ),
),
]), ]),
))), ))),
)), )),

@ -1,10 +1,12 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_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/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
@ -130,7 +132,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
), ),
Column( Column(
children: [ children: [
if(model.patientProgressNoteList.isEmpty) if(widget.patientProgressNote==null)
Container( Container(
margin: margin:
EdgeInsets.only(left: 10, right: 10, top: 15), EdgeInsets.only(left: 10, right: 10, top: 15),
@ -321,6 +323,8 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
} else { } else {
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
} else {
helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg);
} }
} }
@ -372,7 +376,13 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
), ),
AppButton( AppButton(
title: TranslationBase.of(context).add.toUpperCase(), title: TranslationBase.of(context).add.toUpperCase(),
onPressed: () { onPressed: () async{
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
widget.patientProgressNote.createdByName = widget.patientProgressNote.createdByName??doctorProfile.doctorName;
widget.patientProgressNote.editedByName=doctorProfile.doctorName;
widget.patientProgressNote.createdOn= DateTime.now().toString() ;
setState(() { setState(() {
print(progressNoteController.text); print(progressNoteController.text);
}); });

Loading…
Cancel
Save