|
|
|
|
@ -1,15 +1,18 @@
|
|
|
|
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/enum/view_state.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/locator.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/utils/utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/bottom_sheet/bottom_sheet_container.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
|
|
|
|
|
@ -17,6 +20,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
@ -34,7 +38,7 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
|
|
|
|
|
dynamic _selectedDiagnosis;
|
|
|
|
|
dynamic _selectedIcd;
|
|
|
|
|
dynamic _selectedDiagnosisType;
|
|
|
|
|
|
|
|
|
|
TextEditingController morphologyController = TextEditingController();
|
|
|
|
|
String diagnosisError = '', icdError = '', diagnosisTypeError = '',stayLengthError = '';
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
@ -50,7 +54,6 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
|
|
|
|
|
AdmissionRequest admissionRequest = routeArgs['admission-data'];
|
|
|
|
|
|
|
|
|
|
final screenSize = MediaQuery.of(context).size;
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
|
|
|
|
|
return BaseView<AdmissionRequestViewModel>(
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
@ -132,7 +135,10 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
BaseView<SOAPViewModel>(
|
|
|
|
|
builder: (_, soapModel, w) => Column(children: [
|
|
|
|
|
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
height: screenSize.height * 0.075,
|
|
|
|
|
hintText: TranslationBase.of(context).icd,
|
|
|
|
|
dropDownText: _selectedIcd != null ? _selectedIcd['description'] : null,
|
|
|
|
|
@ -142,6 +148,9 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
|
|
|
|
|
onClick: model.icdCodes != null && model.icdCodes.length > 0
|
|
|
|
|
? () {
|
|
|
|
|
openListDialogField('description', 'code', model.icdCodes, (selectedValue) {
|
|
|
|
|
soapModel.getMorphologyDiagnosis(selectedValue['code']
|
|
|
|
|
.toString()
|
|
|
|
|
.trim());
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedIcd = selectedValue;
|
|
|
|
|
});
|
|
|
|
|
@ -152,6 +161,9 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
|
|
|
|
|
await model.getICDCodes(patient.patientMRN!).then((_) => GifLoaderDialogUtils.hideDialog(context));
|
|
|
|
|
if (model.state == ViewState.Idle && model.icdCodes.length > 0) {
|
|
|
|
|
openListDialogField('description', 'code', model.icdCodes, (selectedValue) {
|
|
|
|
|
soapModel.getMorphologyDiagnosis(selectedValue['code']
|
|
|
|
|
.toString()
|
|
|
|
|
.trim());
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedIcd = selectedValue;
|
|
|
|
|
});
|
|
|
|
|
@ -165,6 +177,51 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
|
|
|
|
|
onChanged: (value) {},
|
|
|
|
|
onFieldSubmitted: () {},
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 10,),
|
|
|
|
|
if ((soapModel.morphologyList.isNotEmpty) ||
|
|
|
|
|
morphologyController.text.isNotEmpty) ...{
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
height: Utils.getTextFieldHeight(),
|
|
|
|
|
onClick: soapModel.morphologyList.isNotEmpty
|
|
|
|
|
? () {
|
|
|
|
|
MasterKeyDailog dialog = MasterKeyDailog(
|
|
|
|
|
list: soapModel.morphologyList!,
|
|
|
|
|
okText: TranslationBase.of(context).ok,
|
|
|
|
|
selectedStringValue: "",
|
|
|
|
|
okFunction:
|
|
|
|
|
(MasterKeyModel selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
|
|
morphologyController.text =
|
|
|
|
|
selectedValue.code;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
hintText: TranslationBase.of(context).morphology,
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
minLines: 1,
|
|
|
|
|
controller: morphologyController,
|
|
|
|
|
isTextFieldHasSuffix: true,
|
|
|
|
|
enabled: false,
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
validationError:
|
|
|
|
|
morphologyController.text ==
|
|
|
|
|
""
|
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
|
: null,
|
|
|
|
|
onChanged: (value) {},
|
|
|
|
|
onFieldSubmitted: () {},
|
|
|
|
|
),
|
|
|
|
|
}],)),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
@ -332,6 +389,9 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
|
|
|
|
|
'isActive': true,
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
/* changed based on vida 3 web */
|
|
|
|
|
model.admissionRequestData.diagnosis = "${_selectedIcd['code']} : ${_selectedIcd['description']}; ";
|
|
|
|
|
|
|
|
|
|
model.admissionRequestData!.admissionRequestDiagnoses = admissionRequestDiagnoses;
|
|
|
|
|
|
|
|
|
|
await model.makeAdmissionRequest();
|
|
|
|
|
|