MDS change

update_flutter_3.24_vida_plus_episode_MDS
sultan khan 11 months ago
parent ae9897cdb6
commit 2e93b1f92f

@ -40,6 +40,7 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
dynamic _selectedDiagnosisType; dynamic _selectedDiagnosisType;
TextEditingController morphologyController = TextEditingController(); TextEditingController morphologyController = TextEditingController();
String diagnosisError = '', icdError = '', diagnosisTypeError = '',stayLengthError = ''; String diagnosisError = '', icdError = '', diagnosisTypeError = '',stayLengthError = '';
dynamic morphologyCode='';
@override @override
void initState() { void initState() {
@ -185,16 +186,21 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
onClick: soapModel.morphologyList.isNotEmpty onClick: soapModel.morphologyList.isNotEmpty
? () { ? () {
MasterKeyDailog dialog = MasterKeyDailog( MasterKeyDailog dialog = MasterKeyDailog(
isSearch: true,
list: soapModel.morphologyList!, list: soapModel.morphologyList!,
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
selectedStringValue: "", selectedStringValue: "",
okFunction: okFunction:
(MasterKeyModel selectedValue) { (MasterKeyModel selectedValue) {
setState(() { setState(() {
morphologyController.text = morphologyController.text =
selectedValue.code; selectedValue.nameEn!;
morphologyCode = selectedValue.id!;
}); });
}, },
); );
showDialog( showDialog(

@ -325,7 +325,29 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
// ), // ),
// ) // )
]), ]),
if ((model.morphologyList != null && if (widget.mySelectedAssessment.selectedICD != null)
Column(
children: [
SizedBox(
height: 3,
),
Container(
width:
MediaQuery.of(context).size.width * 0.7,
child: AppText(
widget.mySelectedAssessment.selectedICD!
.description +
(' (${widget.mySelectedAssessment.selectedICD!.code} )'),
color: Color(0xFF575757),
fontSize: 10,
fontWeight: FontWeight.w700,
letterSpacing: -0.4,
),
),
],
),
SizedBox(height: 10,),
if ((
model.morphologyList.isNotEmpty) || model.morphologyList.isNotEmpty) ||
morphologyController.text.isNotEmpty) ...{ morphologyController.text.isNotEmpty) ...{
AppTextFieldCustom( AppTextFieldCustom(
@ -333,6 +355,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
onClick: model.morphologyList != null onClick: model.morphologyList != null
? () { ? () {
MasterKeyDailog dialog = MasterKeyDailog( MasterKeyDailog dialog = MasterKeyDailog(
isSearch:true,
list: model.morphologyList!, list: model.morphologyList!,
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
selectedStringValue: widget selectedStringValue: widget
@ -343,9 +366,9 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
setState(() { setState(() {
widget.mySelectedAssessment widget.mySelectedAssessment
.morphologyCode = .morphologyCode =
selectedValue.code; selectedValue.id!.toString();
morphologyController.text = morphologyController.text =
selectedValue.code; selectedValue.nameEn!;
}); });
}, },
); );
@ -375,27 +398,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
onFieldSubmitted: () {}, onFieldSubmitted: () {},
), ),
}, },
if (widget.mySelectedAssessment.selectedICD != null)
Column(
children: [
SizedBox(
height: 3,
),
Container(
width:
MediaQuery.of(context).size.width * 0.7,
child: AppText(
widget.mySelectedAssessment.selectedICD!
.description +
(' (${widget.mySelectedAssessment.selectedICD!.code} )'),
color: Color(0xFF575757),
fontSize: 10,
fontWeight: FontWeight.w700,
letterSpacing: -0.4,
),
),
],
),
SizedBox( SizedBox(
height: 7, height: 7,
), ),
@ -596,6 +599,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
prevIcdCode10ID: mySelectedAssessment.icdCode10ID, prevIcdCode10ID: mySelectedAssessment.icdCode10ID,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id, diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id,
icdcode10Id: mySelectedAssessment.selectedICD!.code, icdcode10Id: mySelectedAssessment.selectedICD!.code,
//todo will update the morphology here //todo will update the morphology here
) )
]); ]);

@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.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/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -15,17 +16,20 @@ class MasterKeyDailog extends StatefulWidget {
MasterKeyModel? selectedValue; MasterKeyModel? selectedValue;
String? selectedStringValue; String? selectedStringValue;
final bool isICD; final bool isICD;
final bool isSearch;
MasterKeyDailog({required this.list, required this.okText, required this.okFunction, this.selectedValue, this.isICD = false, this.selectedStringValue}); MasterKeyDailog({required this.list, required this.okText, required this.okFunction, this.selectedValue, this.isICD = false, this.selectedStringValue, this.isSearch =false});
@override @override
_MasterKeyDailogState createState() => _MasterKeyDailogState(); _MasterKeyDailogState createState() => _MasterKeyDailogState();
} }
class _MasterKeyDailogState extends State<MasterKeyDailog> { class _MasterKeyDailogState extends State<MasterKeyDailog> {
List<MasterKeyModel> items = [];
@override @override
void initState() { void initState() {
super.initState(); super.initState();
items.addAll(widget.list);
widget.selectedValue = widget.selectedValue ?? widget.list.first; widget.selectedValue = widget.selectedValue ?? widget.list.first;
} }
@ -74,6 +78,20 @@ class _MasterKeyDailogState extends State<MasterKeyDailog> {
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
if (widget.isSearch)
Container(
height: MediaQuery.of(context).size.height * 0.070,
child: TextField(
decoration: Utils.textFieldSelectorDecoration(TranslationBase.of(context).search, "", false,
suffixIcon: Icon(
Icons.search,
)),
enabled: true,
keyboardType: TextInputType.text,
onChanged: (value) {
filterSearchResults(value, projectViewModel);
},
)),
...widget.list ...widget.list
.map((item) => RadioListTile( .map((item) => RadioListTile(
title: AppText( title: AppText(
@ -99,4 +117,27 @@ class _MasterKeyDailogState extends State<MasterKeyDailog> {
static closeAlertDialog(BuildContext context) { static closeAlertDialog(BuildContext context) {
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
void filterSearchResults(String query,ProjectViewModel projectViewModel ) {
List<MasterKeyModel> dummySearchList = [];
dummySearchList.addAll(widget.list);
if (query.isNotEmpty) {
List<MasterKeyModel> dummyListData = [];
dummySearchList.forEach((item) {
if ((projectViewModel.isArabic ? item.nameAr : item.nameEn! + (widget.isICD ? '/${item.code}' : ''))!.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item);
}
});
setState(() {
items.clear();
items.addAll(dummyListData);
});
return;
} else {
setState(() {
items.clear();
items.addAll(widget.list);
});
}
}
} }

Loading…
Cancel
Save