MDS changes

update_flutter_3.24_vida_plus_episode_MDS
sultan khan 11 months ago
parent 6e6cb20487
commit ae9897cdb6

@ -42,7 +42,7 @@ class AdmissionRequest {
int? episodeID;
int? admissionRequestNo;
dynamic? intendedLengthOfStayId;
String? expectedAdmissionDate;
AdmissionRequest(
{this.patientMRN,
this.admitToClinic,
@ -86,7 +86,9 @@ class AdmissionRequest {
this.appointmentNo,
this.episodeID,
this.admissionRequestNo,
this.intendedLengthOfStayId});
this.intendedLengthOfStayId,
this.expectedAdmissionDate
});
AdmissionRequest.fromJson(Map<String, dynamic> json) {
patientMRN = json['patientMRN'];

@ -55,7 +55,7 @@ class LookupService extends BaseService {
List<dynamic> listOfAdmissionType = [];
List<dynamic> listOfDiagnosisSelectionTypes = [];
List<MasterKeyModel> morphologyList = [];
List<MasterKeyModel> intendedLengthOfStay = [];
List<dynamic> intendedLengthOfStay = [];
Future getMasterLookup(MasterKeysService masterKeys,
{String searchKey = ""}) async {
@ -225,7 +225,7 @@ class LookupService extends BaseService {
case MasterKeysService.IntendedLengthOfStay:
intendedLengthOfStay.clear();
entryList.forEach((v) {
intendedLengthOfStay.add(MasterKeyModel.fromJson(v));
intendedLengthOfStay.add(v);
});
break;
}

@ -232,7 +232,7 @@ class AdmissionRequestService extends LookupService {
);
}
Future<bool> getKSAProjectValue() async {
getKSAProjectValue() async {
hasError = false;
Map<String, dynamic> body = Map();
@ -240,7 +240,7 @@ class AdmissionRequestService extends LookupService {
await baseAppClient.post(
IS_KSA_PROJECT,
onSuccess: (dynamic response, int statusCode) {
isKSAProject = response['isKSAProject'] ?? false;
isKSAProject = response['IsKsaProject'];
},
onFailure: (String error, int statusCode) {
hasError = true;
@ -248,7 +248,6 @@ class AdmissionRequestService extends LookupService {
},
body: body,
);
return isKSAProject;
}
Future getMasterKeyItems() async {

@ -1561,7 +1561,7 @@ class SOAPService extends LookupService {
}, body: finalRequest);
}
Future<bool> isMorphology(String icd10Code) async {
Future isMorphology(String icd10Code) async {
hasError = false;
await baseAppClient.post(IS_MORPHOLOGY,
@ -1569,13 +1569,11 @@ class SOAPService extends LookupService {
print("Success");
isMorphology_ = response['Ismorphology'];
return isMorphology_;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
return false;
}, body: {"selectedIcdCode": icd10Code});
return false;
}, body: {"selectedIcdCode": "C00.0"}); //icd10Code commented for testing
}
Future getMorphologyDiagnosis() async {

@ -1507,8 +1507,8 @@ class SOAPViewModel extends BaseViewModel {
Future getMorphologyDiagnosis(String icdCode10) async {
setState(ViewState.BusyLocal);
bool isMorphologyRequired = await _SOAPService.isMorphology(icdCode10);
if (isMorphologyRequired) {
await _SOAPService.isMorphology(icdCode10);
if (_SOAPService.isMorphology_) {
await _SOAPService.getMorphologyDiagnosis();
}
if (_SOAPService.hasError) {

@ -1,5 +1,6 @@
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/service/patient_medical_file/admission_request/patient-admission-request-service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
@ -37,6 +38,8 @@ class AdmissionRequestViewModel extends BaseViewModel {
AdmissionRequest admissionRequestData = AdmissionRequest();
Future getSpecialityList() async {
await getMasterLookup(MasterKeysService.Speciality);
if (!_admissionRequestService.hasError) {
@ -155,8 +158,8 @@ class AdmissionRequestViewModel extends BaseViewModel {
Future getIsKSAProject() async {
setState(ViewState.BusyLocal);
bool result = await _admissionRequestService.getKSAProjectValue();
if(result){
await _admissionRequestService.getKSAProjectValue();
if(_admissionRequestService.isKSAProject){
await _admissionRequestService.getMasterKeyItems();
}
if (_admissionRequestService.hasError) {

@ -1,6 +1,6 @@
import 'dart:async';
import 'package:connectivity/connectivity.dart';
// import 'package:connectivity/connectivity.dart';
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
@ -42,20 +42,20 @@ class ProjectViewModel with ChangeNotifier {
ProjectViewModel() {
loadSharedPrefLanguage();
subscription = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) {
switch (result) {
case ConnectivityResult.wifi:
isInternetConnection = true;
break;
case ConnectivityResult.mobile:
isInternetConnection = true;
break;
case ConnectivityResult.none:
isInternetConnection = false;
break;
}
notifyListeners();
});
// subscription = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) {
// switch (result) {
// case ConnectivityResult.wifi:
// isInternetConnection = true;
// break;
// case ConnectivityResult.mobile:
// isInternetConnection = true;
// break;
// case ConnectivityResult.none:
// isInternetConnection = false;
// break;
// }
// notifyListeners();
// });
}
setVidaPlusProjectList(List<VidaPlusProjectListModel> vidaPlusProjectListModelInput) {

@ -286,6 +286,7 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
minLines: 4,
maxLines: 6,
inputType: TextInputType.multiline,
validationError: medicalHistoryError,
onChanged: (value) {},
onFieldSubmitted: () {},
),
@ -394,6 +395,11 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
} else {
surgicalHistoryError = null;
}
if(_dietTypeRemarksController.text.isEmpty){
medicalHistoryError = TranslationBase.of(context).fieldRequired;
}else{
medicalHistoryError= null;
}
});
}
},

@ -82,7 +82,7 @@ class _AdmissionRequestSecondScreenState
return BaseView<AdmissionRequestViewModel>(
onModelReady: (model){
WidgetsBinding.instance.addPostFrameCallback((_) async {
await model.getIsKSAProject();
model.getIsKSAProject();
//todo handle get diagnosis list
});
},
@ -241,8 +241,7 @@ class _AdmissionRequestSecondScreenState
onChanged: (value) {},
onFieldSubmitted: () {},
),
if (model.intendedStayLength != null &&
model.intendedStayLength.isNotEmpty) ...{
if (model.intendedStayLength.isNotEmpty) ...{
SizedBox(
height: 10,
),
@ -253,17 +252,16 @@ class _AdmissionRequestSecondScreenState
dropDownText:
_selectedIntendedStayLength != null
? _selectedIntendedStayLength['nameEn']
: null,
: model.intendedStayLength.first['nameEn'],
enabled: false,
isTextFieldHasSuffix: true,
validationError: stayLengthError,
onClick: model.intendedStayLength != null &&
model.intendedStayLength.length > 0
onClick: model.intendedStayLength.length > 0
? () {
var attributeName =
projectViewModel.isArabic
? 'nameEn'
: 'nameAr';
? 'nameAr':
'nameEn';
openListDialogField(attributeName, 'id',
model.intendedStayLength,
(selectedValue) {
@ -283,9 +281,9 @@ class _AdmissionRequestSecondScreenState
model.intendedStayLength
.isNotEmpty) {
var attributeName =
projectViewModel.isArabic
? 'nameEn'
: 'nameAr';
projectViewModel.isArabic
? 'nameAr':
'nameEn';
openListDialogField(attributeName,
'id', model.intendedStayLength,
(selectedValue) {
@ -634,6 +632,8 @@ class _AdmissionRequestSecondScreenState
int.parse(_expectedDaysController.text);
model.admissionRequestData!.admissionDate =
_expectedAdmissionDate!.toIso8601String();
model.admissionRequestData!.expectedAdmissionDate =
_expectedAdmissionDate!.toIso8601String();
model.admissionRequestData.otherDepartmentinterventions =
_otherDepartmentsInterventionsController.text;
model.admissionRequestData!.admissionLocationID =
@ -654,7 +654,7 @@ class _AdmissionRequestSecondScreenState
_otherProceduresController.text;
model.admissionRequestData!.admissionType =
_selectedAdmissionType['id'];
model.admissionRequestData.intendedLengthOfStayId = (_selectedIntendedStayLength as MasterKeyModel).id;
model.admissionRequestData.intendedLengthOfStayId = _selectedIntendedStayLength['id'];
Navigator.of(context)
.pushNamed(PATIENT_ADMISSION_REQUEST_3, arguments: {

@ -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();

@ -333,7 +333,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
onClick: model.morphologyList != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisCondition!,
list: model.morphologyList!,
okText: TranslationBase.of(context).ok,
selectedStringValue: widget
.mySelectedAssessment

@ -1,4 +1,4 @@
import 'package:connectivity/connectivity.dart';
// import 'package:connectivity/connectivity.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart';
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart';
@ -141,12 +141,12 @@ class Utils {
}
static Future<bool> checkConnection() async {
ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity());
if ((connectivityResult == ConnectivityResult.mobile) || (connectivityResult == ConnectivityResult.wifi)) {
// ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity());
// if ((connectivityResult == ConnectivityResult.mobile) || (connectivityResult == ConnectivityResult.wifi)) {
return true;
} else {
return false;
}
// } else {
// return false;
// }
}
static List<WorkingHours> getWorkingHours(String workingHours) {

@ -92,7 +92,7 @@ class _ListSelectDialogState extends State<ListSelectDialog> {
child: Column(
children: [
...items
.map((item) => RadioListTile(
.map((dynamic item) => RadioListTile(
title: Text("${Utils.convertToTitleCase(item[widget.attributeName].toString())}"),
groupValue: Utils.convertToTitleCase(widget.selectedValue[widget.attributeValueId].toString()),
value: item[widget.attributeValueId].toString(),

Loading…
Cancel
Save