WD: vida 3 api changes

update_flutter_3.24_vida_plus_episode_MDS
taha.alam 11 months ago
parent 7dde65f8d8
commit 6e6cb20487

@ -242,6 +242,8 @@ const GET_DIET_TYPES = 'Services/DoctorApplication.svc/REST/DietTypes';
const GET_ICD_CODES = 'Services/DoctorApplication.svc/REST/GetICDCodes';
const POST_ADMISSION_REQUEST =
'Services/DoctorApplication.svc/REST/PostAdmissionRequest';
const IS_KSA_PROJECT =
'Services/DoctorApplication.svc/REST/IsKsaProject';
const GET_ITEM_BY_MEDICINE =
'Services/DoctorApplication.svc/REST/GetItemByMedicineCode';

@ -1291,6 +1291,7 @@ const Map<String, Map<String, String>> localizedValues = {
},
"noRemarks": {"en": "No Remarks", "ar": "لا ملاحظات"},
"event": {"en": "Event: ", "ar": "حدث: "},
"morphology": {"en": "Morphology: ", "ar": "مورفولوجيا: "},
"editDiagnosis": {"en": "Edit Diagnosis ", "ar": "تحرير التشخيص"},
"selectedDiagnosis": {
"en": "Kindly Select Diagnosis",
@ -1334,4 +1335,5 @@ const Map<String, Map<String, String>> localizedValues = {
"ar": "ملاحظة التقدم لا يمكن أن تكون فارغة"
},
"morphologyCode": {"en": "Morphology Code", "ar": "كود الشكل"},
"intendedLengthOfStay": {"en": "Intended Length Of Stay", "ar": "مدة الإقامة المقصودة"},
};

@ -21,7 +21,8 @@ enum MasterKeysService {
MedicationIndications,
AdmissionRequestType,
DiagnosisSelectionType,
MorphologyCode
MorphologyCode,
IntendedLengthOfStay
}
extension SelectedMasterKeysService on MasterKeysService {
@ -93,6 +94,8 @@ extension SelectedMasterKeysService on MasterKeysService {
case MasterKeysService.MorphologyCode:
return 1097;
break;
case MasterKeysService.IntendedLengthOfStay:
return 4048;
}
}
}

@ -3,10 +3,11 @@ class PostAssessmentRequestModel {
int? appointmentNo;
int? episodeId;
String? createdByName;
bool? isOPD;
int? createdBy;
List<IcdCodeDetails>? icdCodeDetails;
PostAssessmentRequestModel({this.patientMRN, this.appointmentNo, this.episodeId, this.createdByName, this.createdBy, this.icdCodeDetails});
PostAssessmentRequestModel({this.patientMRN, this.appointmentNo, this.episodeId, this.createdByName, this.createdBy, this.icdCodeDetails, this.isOPD});
PostAssessmentRequestModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN'];
@ -14,6 +15,7 @@ class PostAssessmentRequestModel {
episodeId = json['EpisodeID'];
createdByName = json['CreatedByName'];
createdBy = json['CreatedBy'];
isOPD = json['isOPD'] ?? false;
if (json['icdCodeDetails'] != null) {
icdCodeDetails = <IcdCodeDetails>[];
json['icdCodeDetails'].forEach((v) {
@ -29,6 +31,7 @@ class PostAssessmentRequestModel {
data['EpisodeID'] = this.episodeId;
data['CreatedByName'] = this.createdByName;
data['CreatedBy'] = this.createdBy;
data['isOPD'] = this.isOPD ?? false;
if (this.icdCodeDetails != null) {
data['icdCodeDetails'] = this.icdCodeDetails!.map((v) => v.toJson()).toList();
}
@ -42,8 +45,9 @@ class IcdCodeDetails {
int? diagnosisTypeId;
bool? complexDiagnosis;
String? remarks;
String? morphologyCode;
IcdCodeDetails({this.icdcode10Id, this.conditionId, this.diagnosisTypeId, this.complexDiagnosis, this.remarks});
IcdCodeDetails({this.icdcode10Id, this.conditionId, this.diagnosisTypeId, this.complexDiagnosis, this.remarks, this.morphologyCode});
IcdCodeDetails.fromJson(Map<String, dynamic> json) {
icdcode10Id = json['icdcode10Id'];
@ -51,6 +55,7 @@ class IcdCodeDetails {
diagnosisTypeId = json['diagnosisTypeId'];
complexDiagnosis = json['complexDiagnosis'];
remarks = json['remarks'];
morphologyCode = json['morphologyCode'];
}
Map<String, dynamic> toJson() {
@ -60,6 +65,7 @@ class IcdCodeDetails {
data['diagnosisTypeId'] = this.diagnosisTypeId;
data['complexDiagnosis'] = this.complexDiagnosis;
data['remarks'] = this.remarks;
data['morphologyCode'] = this.morphologyCode;
return data;
}
}

@ -41,6 +41,7 @@ class AdmissionRequest {
int? appointmentNo;
int? episodeID;
int? admissionRequestNo;
dynamic? intendedLengthOfStayId;
AdmissionRequest(
{this.patientMRN,
@ -84,7 +85,8 @@ class AdmissionRequest {
this.admissionRequestProcedures,
this.appointmentNo,
this.episodeID,
this.admissionRequestNo});
this.admissionRequestNo,
this.intendedLengthOfStayId});
AdmissionRequest.fromJson(Map<String, dynamic> json) {
patientMRN = json['patientMRN'];
@ -124,6 +126,7 @@ class AdmissionRequest {
otherProcedures = json['otherProcedures'];
pastMedicalHistory = json['pastMedicalHistory'];
pastSurgicalHistory = json['pastSurgicalHistory'];
intendedLengthOfStayId = json['intendedLengthOfStayId'];
if (json['admissionRequestDiagnoses'] != null) {
admissionRequestDiagnoses = [];
json['admissionRequestDiagnoses'].forEach((v) {
@ -194,6 +197,7 @@ class AdmissionRequest {
data['appointmentNo'] = this.appointmentNo;
data['episodeID'] = this.episodeID;
data['admissionRequestNo'] = this.admissionRequestNo;
data['intendedLengthOfStayId'] = this.intendedLengthOfStayId;
return data;
}
}

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

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart';
import 'package:doctor_app_flutter/core/service/base/lookup-service.dart';
@ -13,6 +14,7 @@ class AdmissionRequestService extends LookupService {
List<dynamic> allergiesLookupList = [];
List<dynamic> dietTypesList = [];
List<dynamic> icdCodes = [];
bool isKSAProject = false;
setSpecialityList() {
specialityList.clear();
@ -229,4 +231,35 @@ class AdmissionRequestService extends LookupService {
body: body,
);
}
Future<bool> getKSAProjectValue() async {
hasError = false;
Map<String, dynamic> body = Map();
await baseAppClient.post(
IS_KSA_PROJECT,
onSuccess: (dynamic response, int statusCode) {
isKSAProject = response['isKSAProject'] ?? false;
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: body,
);
return isKSAProject;
}
Future getMasterKeyItems() async {
hasError = false;
await baseAppClient.post(GET_MASTER_LOOKUP_LIST,
onSuccess: (dynamic response, int statusCode) {
setMasterLookupInCorrectArray(response['MasterLookUpList']['entityList'],
MasterKeysService.IntendedLengthOfStay);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: {"MasterInput": 1047});
}
}

@ -184,6 +184,9 @@ class SOAPService extends LookupService {
Future postAssessment(
PostAssessmentRequestModel postAssessmentRequestModel) async {
var request = {
'AssessmenttRequestViewModel':postAssessmentRequestModel.toJson()
};
hasError = false;
await baseAppClient.post(POST_ASSESSMENT,
onSuccess: (dynamic response, int statusCode) {
@ -191,7 +194,7 @@ class SOAPService extends LookupService {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: postAssessmentRequestModel.toJson());
}, body: request );
}
Future patchAllergy(PostAllergyRequestModel patchAllergyRequestModel) async {
@ -1558,17 +1561,21 @@ class SOAPService extends LookupService {
}, body: finalRequest);
}
Future isMorphology(String icd10Code) async {
Future<bool> isMorphology(String icd10Code) async {
hasError = false;
await baseAppClient.post(IS_MORPHOLOGY,
onSuccess: (dynamic response, int statusCode) {
print("Success");
isMorphology_ = response['Ismorphology'];
return isMorphology_;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
return false;
}, body: {"selectedIcdCode": icd10Code});
return false;
}
Future getMorphologyDiagnosis() async {

@ -67,6 +67,8 @@ class SOAPViewModel extends BaseViewModel {
List<MasterKeyModel> get allergiesList => _SOAPService.allergiesList;
List<MasterKeyModel> get morphologyList => _SOAPService.morphologyList;
List<MasterKeyModel> get allergySeverityList =>
_SOAPService.allergySeverityList;
@ -514,6 +516,8 @@ class SOAPViewModel extends BaseViewModel {
return result.first;
}
break;
case MasterKeysService.IntendedLengthOfStay:
return MasterKeyModel();
case MasterKeysService.AllergySeverity:
List<MasterKeyModel> result = allergySeverityList.where((element) {
return element.id == id &&
@ -1501,6 +1505,19 @@ class SOAPViewModel extends BaseViewModel {
return result;
}
Future getMorphologyDiagnosis(String icdCode10) async {
setState(ViewState.BusyLocal);
bool isMorphologyRequired = await _SOAPService.isMorphology(icdCode10);
if (isMorphologyRequired) {
await _SOAPService.getMorphologyDiagnosis();
}
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
void changeCurrentCategorySelectedState(
GeneralSpeciality selectedExamination, bool status) {
final item = speciality.firstWhere(

@ -25,6 +25,8 @@ class AdmissionRequestViewModel extends BaseViewModel {
List<dynamic> get diagnosisTypesList => _admissionRequestService.diagnosisTypesList;
List<dynamic> get intendedStayLength => _admissionRequestService.intendedLengthOfStay;
List<dynamic> get allergiesList => _admissionRequestService.allergiesLookupList;
List<dynamic> get dietTypesList => _admissionRequestService.dietTypesList;
@ -150,4 +152,18 @@ class AdmissionRequestViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
}
Future getIsKSAProject() async {
setState(ViewState.BusyLocal);
bool result = await _admissionRequestService.getKSAProjectValue();
if(result){
await _admissionRequestService.getMasterKeyItems();
}
if (_admissionRequestService.hasError) {
error = _admissionRequestService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
}

@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart';
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';
@ -31,10 +32,12 @@ import '../../../../routes.dart';
class AdmissionRequestSecondScreen extends StatefulWidget {
@override
_AdmissionRequestSecondScreenState createState() => _AdmissionRequestSecondScreenState();
_AdmissionRequestSecondScreenState createState() =>
_AdmissionRequestSecondScreenState();
}
class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScreen> {
class _AdmissionRequestSecondScreenState
extends State<AdmissionRequestSecondScreen> {
final _postPlansEstimatedCostController = TextEditingController();
final _estimatedCostController = TextEditingController();
final _expectedDaysController = TextEditingController();
@ -49,6 +52,7 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
dynamic _selectedWard;
dynamic _selectedRoomCategory;
dynamic _selectedAdmissionType;
dynamic _selectedIntendedStayLength;
String costError = '',
plansError = '',
@ -60,7 +64,9 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
treatmentsError = '',
complicationsError = '',
proceduresError = '',
admissionTypeError = '';
admissionTypeError = '',
stayLengthError = '';
@override
Widget build(BuildContext context) {
@ -74,9 +80,16 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<AdmissionRequestViewModel>(
onModelReady: (model){
WidgetsBinding.instance.addPostFrameCallback((_) async {
await model.getIsKSAProject();
//todo handle get diagnosis list
});
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
isLoading: model.state == ViewState.BusyLocal,
appBar: PatientProfileAppBar(patient),
appBarTitle: TranslationBase.of(context).admissionRequest,
body: GestureDetector(
@ -104,13 +117,15 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
height: 15,
),
Container(
margin: EdgeInsets.symmetric(vertical: 0, horizontal: 16),
margin:
EdgeInsets.symmetric(vertical: 0, horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
Utils.convertToTitleCase(
TranslationBase.of(context).postPlansEstimatedCost,
TranslationBase.of(context)
.postPlansEstimatedCost,
),
color: Color(0xFF2E303A),
fontSize: SizeConfig.textMultiplier! * 1.8,
@ -121,11 +136,15 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).estimatedCost,
hintText:
TranslationBase.of(context).estimatedCost,
controller: _estimatedCostController,
validationError: costError,
inputType: TextInputType.number,
inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_NUMBERS))],
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))
],
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
@ -148,8 +167,10 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
height: 10,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).otherDepartmentsInterventions,
controller: _otherDepartmentsInterventionsController,
hintText: TranslationBase.of(context)
.otherDepartmentsInterventions,
controller:
_otherDepartmentsInterventionsController,
inputType: TextInputType.multiline,
validationError: otherInterventionsError,
minLines: 2,
@ -172,7 +193,8 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).expectedDays,
hintText:
TranslationBase.of(context).expectedDays,
controller: _expectedDaysController,
validationError: expectedDaysError,
inputType: TextInputType.number,
@ -190,8 +212,11 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).expectedAdmissionDate,
dropDownText: _expectedAdmissionDate != null ? "${AppDateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}" : "",
hintText: TranslationBase.of(context)
.expectedAdmissionDate,
dropDownText: _expectedAdmissionDate != null
? "${AppDateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}"
: "",
enabled: false,
isTextFieldHasSuffix: true,
validationError: expectedDatesError,
@ -206,7 +231,8 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
if (_expectedAdmissionDate == null) {
_expectedAdmissionDate = DateTime.now();
}
_selectDate(context, _expectedAdmissionDate!, (picked) {
_selectDate(context, _expectedAdmissionDate!,
(picked) {
setState(() {
_expectedAdmissionDate = picked;
});
@ -215,37 +241,123 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
onChanged: (value) {},
onFieldSubmitted: () {},
),
SizedBox(
height: 10,
),
if (model.intendedStayLength != null &&
model.intendedStayLength.isNotEmpty) ...{
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context)
.intendedLengthOfStay,
dropDownText:
_selectedIntendedStayLength != null
? _selectedIntendedStayLength['nameEn']
: null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: stayLengthError,
onClick: model.intendedStayLength != null &&
model.intendedStayLength.length > 0
? () {
var attributeName =
projectViewModel.isArabic
? 'nameEn'
: 'nameAr';
openListDialogField(attributeName, 'id',
model.intendedStayLength,
(selectedValue) {
setState(() {
_selectedIntendedStayLength =
selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils.showMyDialog(
context);
await model.getDiagnosis().then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle &&
model.intendedStayLength
.isNotEmpty) {
var attributeName =
projectViewModel.isArabic
? 'nameEn'
: 'nameAr';
openListDialogField(attributeName,
'id', model.intendedStayLength,
(selectedValue) {
setState(() {
_selectedIntendedStayLength =
selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
onChanged: (value) {},
onFieldSubmitted: () {},
),
SizedBox(
height: 10,
)
} else ...{
SizedBox(
height: 10,
),
},
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).floor,
dropDownText: _selectedFloor != null ? _selectedFloor['description'] : null,
dropDownText: _selectedFloor != null
? _selectedFloor['description']
: null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: floorError,
onClick: model.floorList != null && model.floorList.length > 0
onClick: model.floorList != null &&
model.floorList.length > 0
? () {
openListDialogField('description', 'floorID', model.floorList, (selectedValue) {
openListDialogField(
'description',
'floorID',
model.floorList, (selectedValue) {
setState(() {
_selectedFloor = selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.getFloors().then((_) => GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.Idle && model.floorList.length > 0) {
openListDialogField('description', 'floorID', model.floorList, (selectedValue) {
GifLoaderDialogUtils.showMyDialog(
context);
await model.getFloors().then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle &&
model.floorList.length > 0) {
openListDialogField(
'description',
'floorID',
model.floorList, (selectedValue) {
setState(() {
_selectedFloor = selectedValue;
});
});
} else if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast("Empty List");
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
onChanged: (value) {},
@ -257,30 +369,46 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).ward,
dropDownText: _selectedWard != null ? _selectedWard['description'] : null,
dropDownText: _selectedWard != null
? _selectedWard['description']
: null,
enabled: false,
isTextFieldHasSuffix: true,
onClick: model.wardList != null && model.wardList.length > 0
onClick: model.wardList != null &&
model.wardList.length > 0
? () {
openListDialogField('description', 'nursingStationID', model.wardList, (selectedValue) {
openListDialogField(
'description',
'nursingStationID',
model.wardList, (selectedValue) {
setState(() {
_selectedWard = selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.getWards().then((_) => GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.Idle && model.wardList.length > 0) {
openListDialogField('description', 'nursingStationID', model.wardList, (selectedValue) {
GifLoaderDialogUtils.showMyDialog(
context);
await model.getWards().then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle &&
model.wardList.length > 0) {
openListDialogField(
'description',
'nursingStationID',
model.wardList, (selectedValue) {
setState(() {
_selectedWard = selectedValue;
});
});
} else if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast("Empty List");
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
onChanged: (value) {},
@ -291,32 +419,51 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).roomCategory,
dropDownText: _selectedRoomCategory != null ? _selectedRoomCategory['description'] : null,
hintText:
TranslationBase.of(context).roomCategory,
dropDownText: _selectedRoomCategory != null
? _selectedRoomCategory['description']
: null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: roomError,
onClick: model.roomCategoryList != null && model.roomCategoryList.length > 0
onClick: model.roomCategoryList != null &&
model.roomCategoryList.length > 0
? () {
openListDialogField('description', 'categoryID', model.roomCategoryList, (selectedValue) {
openListDialogField('description',
'categoryID', model.roomCategoryList,
(selectedValue) {
setState(() {
_selectedRoomCategory = selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.getRoomCategories().then((_) => GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.Idle && model.roomCategoryList.length > 0) {
openListDialogField('description', 'categoryID', model.roomCategoryList, (selectedValue) {
GifLoaderDialogUtils.showMyDialog(
context);
await model.getRoomCategories().then(
(_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle &&
model.roomCategoryList.length > 0) {
openListDialogField(
'description',
'categoryID',
model.roomCategoryList,
(selectedValue) {
setState(() {
_selectedRoomCategory = selectedValue;
_selectedRoomCategory =
selectedValue;
});
});
} else if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast("Empty List");
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
onChanged: (value) {},
@ -326,7 +473,8 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
height: 10,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).treatmentLine,
hintText:
TranslationBase.of(context).treatmentLine,
controller: _treatmentLineController,
inputType: TextInputType.multiline,
validationError: treatmentsError,
@ -340,7 +488,8 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
height: 10,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).complications,
hintText:
TranslationBase.of(context).complications,
controller: _complicationsController,
inputType: TextInputType.multiline,
validationError: complicationsError,
@ -354,7 +503,8 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
height: 10,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).otherProcedure,
hintText:
TranslationBase.of(context).otherProcedure,
controller: _otherProceduresController,
inputType: TextInputType.multiline,
validationError: proceduresError,
@ -369,32 +519,52 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).admissionType,
dropDownText: _selectedAdmissionType != null ? _selectedAdmissionType['nameEn'] : null,
hintText:
TranslationBase.of(context).admissionType,
dropDownText: _selectedAdmissionType != null
? _selectedAdmissionType['nameEn']
: null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: admissionTypeError,
onClick: model.admissionTypeList != null && model.admissionTypeList.length > 0
onClick: model.admissionTypeList != null &&
model.admissionTypeList.length > 0
? () {
openListDialogField('nameEn', 'id', model.admissionTypeList, (selectedValue) {
openListDialogField('nameEn', 'id',
model.admissionTypeList,
(selectedValue) {
setState(() {
_selectedAdmissionType = selectedValue;
_selectedAdmissionType =
selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.getMasterLookup(MasterKeysService.AdmissionRequestType).then((_) => GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.Idle && model.admissionTypeList.length > 0) {
openListDialogField('nameEn', 'id', model.admissionTypeList, (selectedValue) {
GifLoaderDialogUtils.showMyDialog(
context);
await model
.getMasterLookup(MasterKeysService
.AdmissionRequestType)
.then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle &&
model.admissionTypeList.length > 0) {
openListDialogField('nameEn', 'id',
model.admissionTypeList,
(selectedValue) {
setState(() {
_selectedAdmissionType = selectedValue;
_selectedAdmissionType =
selectedValue;
});
});
} else if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast("Empty List");
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
onChanged: (value) {},
@ -447,34 +617,55 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
_expectedAdmissionDate != null &&
_otherDepartmentsInterventionsController.text != "" &&
_selectedFloor != null &&
_selectedRoomCategory != null /*_selectedWard is not required*/ &&
_selectedRoomCategory !=
null /*_selectedWard is not required*/ &&
_treatmentLineController.text != "" &&
_complicationsController.text != "" &&
_otherProceduresController.text != "" &&
_selectedAdmissionType != null) {
_selectedAdmissionType != null && _selectedIntendedStayLength != null ) {
model.admissionRequestData = admissionRequest;
model.admissionRequestData!.estimatedCost = int.parse(_estimatedCostController.text);
model.admissionRequestData!.elementsForImprovement = _postPlansEstimatedCostController.text;
model.admissionRequestData!.estimatedCost =
int.parse(_estimatedCostController.text);
model.admissionRequestData!.elementsForImprovement =
_postPlansEstimatedCostController.text;
model.admissionRequestData!.expectedDays = int.parse(_expectedDaysController.text);
model.admissionRequestData!.admissionDate = _expectedAdmissionDate!.toIso8601String();
model.admissionRequestData.otherDepartmentinterventions = _otherDepartmentsInterventionsController.text;
model.admissionRequestData!.admissionLocationID = _selectedFloor['floorID'];
model.admissionRequestData!.wardID = _selectedWard != null ? _selectedWard['nursingStationID'] : 0;
model.admissionRequestData!.roomCategoryID = _selectedRoomCategory['categoryID'];
model.admissionRequestData!.expectedDays =
int.parse(_expectedDaysController.text);
model.admissionRequestData!.admissionDate =
_expectedAdmissionDate!.toIso8601String();
model.admissionRequestData.otherDepartmentinterventions =
_otherDepartmentsInterventionsController.text;
model.admissionRequestData!.admissionLocationID =
_selectedFloor['floorID'];
model.admissionRequestData!.wardID = _selectedWard != null
? _selectedWard['nursingStationID']
: 0;
model.admissionRequestData!.roomCategoryID =
_selectedRoomCategory['categoryID'];
model.admissionRequestData!.admissionRequestProcedures = [];
model.admissionRequestData!.mainLineOfTreatment = _treatmentLineController.text;
model.admissionRequestData!.complications = _complicationsController.text;
model.admissionRequestData!.otherProcedures = _otherProceduresController.text;
model.admissionRequestData!.admissionType = _selectedAdmissionType['id'];
model.admissionRequestData!.mainLineOfTreatment =
_treatmentLineController.text;
model.admissionRequestData!.complications =
_complicationsController.text;
model.admissionRequestData!.otherProcedures =
_otherProceduresController.text;
model.admissionRequestData!.admissionType =
_selectedAdmissionType['id'];
model.admissionRequestData.intendedLengthOfStayId = (_selectedIntendedStayLength as MasterKeyModel).id;
Navigator.of(context)
.pushNamed(PATIENT_ADMISSION_REQUEST_3, arguments: {'patient': patient, 'patientType': patientType, 'arrivalType': arrivalType, 'admission-data': model.admissionRequestData});
.pushNamed(PATIENT_ADMISSION_REQUEST_3, arguments: {
'patient': patient,
'patientType': patientType,
'arrivalType': arrivalType,
'admission-data': model.admissionRequestData
});
} else {
DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseFill);
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).pleaseFill);
setState(() {
if (_estimatedCostController.text == "") {
@ -490,23 +681,33 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
}
if (_expectedDaysController.text == "") {
expectedDaysError = TranslationBase.of(context).fieldRequired;
expectedDaysError =
TranslationBase.of(context).fieldRequired;
} else {
expectedDaysError = "";
}
if (_expectedAdmissionDate == null) {
expectedDatesError = TranslationBase.of(context).fieldRequired;
expectedDatesError =
TranslationBase.of(context).fieldRequired;
} else {
expectedDatesError = "";
}
if (_otherDepartmentsInterventionsController.text == "") {
otherInterventionsError = TranslationBase.of(context).fieldRequired;
otherInterventionsError =
TranslationBase.of(context).fieldRequired;
} else {
otherInterventionsError = "";
}
if (_selectedIntendedStayLength == null ) {
stayLengthError =
TranslationBase.of(context).fieldRequired;
} else {
stayLengthError = "";
}
if (_selectedFloor == null) {
floorError = TranslationBase.of(context).fieldRequired;
} else {
@ -520,25 +721,29 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
}
if (_treatmentLineController.text == "") {
treatmentsError = TranslationBase.of(context).fieldRequired;
treatmentsError =
TranslationBase.of(context).fieldRequired;
} else {
treatmentsError = "";
}
if (_complicationsController.text == "") {
complicationsError = TranslationBase.of(context).fieldRequired;
complicationsError =
TranslationBase.of(context).fieldRequired;
} else {
complicationsError = "";
}
if (_otherProceduresController.text == "") {
proceduresError = TranslationBase.of(context).fieldRequired;
proceduresError =
TranslationBase.of(context).fieldRequired;
} else {
proceduresError = "";
}
if (_selectedAdmissionType == null) {
admissionTypeError = TranslationBase.of(context).fieldRequired;
admissionTypeError =
TranslationBase.of(context).fieldRequired;
} else {
admissionTypeError = "";
}
@ -553,7 +758,8 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
);
}
Future _selectDate(BuildContext context, DateTime dateTime, Function(DateTime picked) updateDate) async {
Future _selectDate(BuildContext context, DateTime dateTime,
Function(DateTime picked) updateDate) async {
final DateTime? picked = await showDatePicker(
context: context,
initialDate: dateTime,
@ -566,7 +772,8 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
}
}
void openListDialogField(String attributeName, String attributeValueId, List<dynamic> list, Function(dynamic selectedValue) okFunction) {
void openListDialogField(String attributeName, String attributeValueId,
List<dynamic> list, Function(dynamic selectedValue) okFunction) {
ListSelectDialog dialog = ListSelectDialog(
list: list,
attributeName: attributeName,

@ -35,7 +35,13 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
dynamic _selectedIcd;
dynamic _selectedDiagnosisType;
String diagnosisError = '', icdError = '', diagnosisTypeError = '';
String diagnosisError = '', icdError = '', diagnosisTypeError = '',stayLengthError = '';
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {

@ -27,11 +27,18 @@ import '../../../../../core/model/SOAP/assessment/patch_assessment_req_model.dar
class AddAssessmentDetails extends StatefulWidget {
final MySelectedAssessment mySelectedAssessment;
final List<MySelectedAssessment> mySelectedAssessmentList;
final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) addSelectedAssessment;
final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate)
addSelectedAssessment;
final PatiantInformtion patientInfo;
final bool isUpdate;
AddAssessmentDetails({Key? key, required this.mySelectedAssessment, required this.addSelectedAssessment, required this.patientInfo, this.isUpdate = false, required this.mySelectedAssessmentList});
AddAssessmentDetails(
{Key? key,
required this.mySelectedAssessment,
required this.addSelectedAssessment,
required this.patientInfo,
this.isUpdate = false,
required this.mySelectedAssessmentList});
@override
_AddAssessmentDetailsState createState() => _AddAssessmentDetailsState();
@ -43,38 +50,66 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
TextEditingController conditionController = TextEditingController();
TextEditingController typeController = TextEditingController();
TextEditingController icdNameController = TextEditingController();
TextEditingController morphologyController = TextEditingController();
String? selectedMorphologyCode = null;
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
bool isFormSubmitted = false;
bool complexDiagnosis = true;
@override
void initState() {
// TODO: implement initState
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
remarkController.text = widget.mySelectedAssessment.remark ?? "";
appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString();
appointmentIdController.text =
widget.mySelectedAssessment.appointmentId.toString();
if (widget.isUpdate) {
if (widget.mySelectedAssessment.selectedDiagnosisCondition != null)
conditionController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisCondition!.nameAr! : widget.mySelectedAssessment.selectedDiagnosisCondition!.nameEn!;
conditionController.text = projectViewModel.isArabic
? widget.mySelectedAssessment.selectedDiagnosisCondition!.nameAr!
: widget.mySelectedAssessment.selectedDiagnosisCondition!.nameEn!;
if (widget.mySelectedAssessment.selectedDiagnosisType != null)
typeController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisType!.nameAr! : widget.mySelectedAssessment.selectedDiagnosisType!.nameEn!;
if (widget.mySelectedAssessment.selectedICD != null) icdNameController.text = widget.mySelectedAssessment.selectedICD!.code;
typeController.text = projectViewModel.isArabic
? widget.mySelectedAssessment.selectedDiagnosisType!.nameAr!
: widget.mySelectedAssessment.selectedDiagnosisType!.nameEn!;
if (widget.mySelectedAssessment.selectedICD != null)
icdNameController.text = widget.mySelectedAssessment.selectedICD!.code;
}
InputDecoration textFieldSelectorDecoration(String hintText, String? selectedText, bool isDropDown, {IconData? icon, String? validationError}) {
InputDecoration textFieldSelectorDecoration(
String hintText, String? selectedText, bool isDropDown,
{IconData? icon, String? validationError}) {
return new InputDecoration(
fillColor: Colors.white,
contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5),
borderSide: BorderSide(
color: (validationError != null
? Colors.red.shade700
: Color(0xFFEFEFEF)),
width: 2.5),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5),
borderSide: BorderSide(
color: (validationError != null
? Colors.red.shade700
: Color(0xFFEFEFEF)),
width: 2.5),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5),
borderSide: BorderSide(
color: (validationError != null
? Colors.red.shade700
: Color(0xFFEFEFEF)),
width: 2.5),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
@ -95,8 +130,12 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isLoading: model.state == ViewState.BusyLocal,
isShowAppBar: true,
appBar: BottomSheetTitle(title: widget.isUpdate ? TranslationBase.of(context).updateAssessmentDetails : TranslationBase.of(context).addAssessmentDetails),
appBar: BottomSheetTitle(
title: widget.isUpdate
? TranslationBase.of(context).updateAssessmentDetails
: TranslationBase.of(context).addAssessmentDetails),
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView(
child: Center(
@ -105,277 +144,396 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
FractionallySizedBox(
widthFactor: 0.9,
child: Container(
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
SizedBox(
height: 16,
),
Row(children: [
Checkbox(
value: complexDiagnosis,
onChanged: (bool? value) {
complexDiagnosis = value!;
setState(() {});
},
checkColor: Colors.white,
activeColor: Colors.green,
),
Text(
TranslationBase.of(context).complexDiagnosis,
),
]),
SizedBox(
height: 16,
),
Container(
margin: EdgeInsets.only(left: 0, right: 0, top: 15),
child: AppTextFieldCustom(
// height: 55.0,
height: Utils.getTextFieldHeight(),
hintText: TranslationBase.of(context).appointmentNumber,
isTextFieldHasSuffix: false,
enabled: false,
controller: appointmentIdController,
onChanged: (value) {},
onFieldSubmitted: () {},
),
),
SizedBox(
height: 10,
),
Column(children: [
InkWell(
onTap: model.listOfICD10 != null
? () {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
Row(children: [
Checkbox(
value: complexDiagnosis,
onChanged: (bool? value) {
complexDiagnosis = value!;
setState(() {});
},
checkColor: Colors.white,
activeColor: Colors.green,
),
Text(
TranslationBase.of(context).complexDiagnosis,
),
]),
SizedBox(
height: 16,
),
Container(
margin: EdgeInsets.only(left: 0, right: 0, top: 15),
child: AppTextFieldCustom(
// height: 55.0,
height: Utils.getTextFieldHeight(),
hintText:
TranslationBase.of(context).appointmentNumber,
isTextFieldHasSuffix: false,
enabled: false,
controller: appointmentIdController,
onChanged: (value) {},
onFieldSubmitted: () {},
),
),
SizedBox(
height: 10,
),
Column(children: [
InkWell(
onTap: model.listOfICD10 != null
? () {
setState(() {
widget.mySelectedAssessment
.selectedICD = null;
icdNameController.text = 'null';
});
}
: null,
child: AppTextFieldCustom(
onChanged: (text) {
setState(() {
widget.mySelectedAssessment.selectedICD = null;
icdNameController.text = 'null';
icdNameController.text;
});
}
: null,
child: AppTextFieldCustom(
onChanged: (text) {
setState(() {
icdNameController.text;
});
},
},
height: Utils.getTextFieldHeight(),
onClick: model.listOfICD10 != null
? () {
setState(() {
widget.mySelectedAssessment
.selectedICD = null;
icdNameController.text = 'null';
});
}
: null,
hintText:
TranslationBase.of(context).nameOrICD,
maxLines: 1,
minLines: 1,
controller: icdNameController,
enabled: true,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
onPressed: () {
if (icdNameController.text.length <=
2) {
DrAppToastMsg.showErrorToast(
"Please enter 3 or more characters");
} else {
model.listOfICD10!.clear();
model
.callAddAssessmentLookupsServices(
searchKey:
icdNameController.text);
}
},
icon: Icon(
Icons.search,
color: Colors.grey.shade600,
)),
onFieldSubmitted: () {},
)),
model.listOfICD10.length > 0 &&
icdNameController.text.isNotEmpty
? Container(
color: Colors.white,
height: MediaQuery.of(context).size.height *
0.4,
//height to 9% of screen height,
child: ListView.builder(
shrinkWrap: true,
itemCount: model.listOfICD10.length,
itemBuilder: (context, index) {
return InkWell(
child: ListTile(
title: AppText(
model.listOfICD10[index]
.description +
" / " +
model.listOfICD10[index]
.code
.toString()
.trim(),
fontSize: 12.0)),
onTap: () {
model.getMorphologyDiagnosis(model
.listOfICD10[index].code
.toString()
.trim());
widget.mySelectedAssessment
.selectedICD =
model.listOfICD10[index];
icdNameController.text = model
.listOfICD10[index]
.description;
model.listOfICD10.clear();
setState(() {});
});
},
))
: SizedBox()
// CustomAutoCompleteTextField(
// isShowError: isFormSubmitted && widget.mySelectedAssessment.selectedICD == null,
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// mainAxisSize: MainAxisSize.min,
// children: [
// AutoCompleteTextField<MasterKeyModel>(
// decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, null, true, suffixIcon: null),
// controller: icdNameController,
// itemSubmitted: (item) => setState(() {
// widget.mySelectedAssessment.selectedICD = item;
// // icdNameController.text = '${item.code.trim()}/${item.description}';
// icdNameController.text = '${item.description}';
// }),
// key: key,
// suggestions: model.listOfICD10,
// suggestionsAmount: model.listOfICD10.length,
// itemBuilder: (context, suggestion) =>
// new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString(), fontSize: 12.0), padding: EdgeInsets.all(8.0)),
// itemSorter: (a, b) => 1,
// itemFilter: (suggestion, input) =>
// // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
// // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
// // suggestion.code.toLowerCase().startsWith(input.toLowerCase()),
// suggestion.description.toLowerCase().contains(input.toLowerCase()) ||
// // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
// suggestion.code.toLowerCase().contains(input.toLowerCase()),
//
// ),
// Expanded(
// child: IconButton(
// onPressed: () {
// print(icdNameController.text);
// if (icdNameController.text.length <= 3) {
// DrAppToastMsg.showErrorToast("Please enter 4 or more characters");
// } else {
// model.listOfICD10.clear();
// model.callAddAssessmentLookupsServices(searchKey: icdNameController.text);
// }
// },
// icon: Icon(Icons.search),
// ),
// ),
// ],
// ),
// )
]),
if ((model.morphologyList != null &&
model.morphologyList.isNotEmpty) ||
morphologyController.text.isNotEmpty) ...{
AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
onClick: model.listOfICD10 != null
onClick: model.morphologyList != null
? () {
setState(() {
widget.mySelectedAssessment.selectedICD = null;
icdNameController.text = 'null';
});
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisCondition!,
okText: TranslationBase.of(context).ok,
selectedStringValue: widget
.mySelectedAssessment
.morphologyCode,
okFunction:
(MasterKeyModel selectedValue) {
setState(() {
widget.mySelectedAssessment
.morphologyCode =
selectedValue.code;
morphologyController.text =
selectedValue.code;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText: TranslationBase.of(context).nameOrICD,
hintText: TranslationBase.of(context).morphology,
maxLines: 1,
minLines: 1,
controller: icdNameController,
enabled: true,
controller: morphologyController,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
onPressed: () {
if (icdNameController.text.length <= 2) {
DrAppToastMsg.showErrorToast("Please enter 3 or more characters");
} else {
model.listOfICD10!.clear();
model.callAddAssessmentLookupsServices(searchKey: icdNameController.text);
}
},
icon: Icon(
Icons.search,
color: Colors.grey.shade600,
)),
enabled: false,
hasBorder: true,
validationError: isFormSubmitted &&
widget.mySelectedAssessment
.morphologyCode ==
null
? TranslationBase.of(context).emptyMessage
: null,
onChanged: (value) {},
onFieldSubmitted: () {},
)),
model.listOfICD10.length > 0 && icdNameController.text.isNotEmpty
? Container(
color: Colors.white,
height: MediaQuery.of(context).size.height * 0.4, //height to 9% of screen height,
child: ListView.builder(
shrinkWrap: true,
itemCount: model.listOfICD10.length,
itemBuilder: (context, index) {
return InkWell(
child: ListTile(title: AppText(model.listOfICD10[index].description + " / " + model.listOfICD10[index].code.toString(), fontSize: 12.0)),
onTap: () {
widget.mySelectedAssessment.selectedICD = model.listOfICD10[index];
icdNameController.text = model.listOfICD10[index].description;
model.listOfICD10.clear();
setState(() {});
});
},
))
: SizedBox()
// CustomAutoCompleteTextField(
// isShowError: isFormSubmitted && widget.mySelectedAssessment.selectedICD == null,
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// mainAxisSize: MainAxisSize.min,
// children: [
// AutoCompleteTextField<MasterKeyModel>(
// decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, null, true, suffixIcon: null),
// controller: icdNameController,
// itemSubmitted: (item) => setState(() {
// widget.mySelectedAssessment.selectedICD = item;
// // icdNameController.text = '${item.code.trim()}/${item.description}';
// icdNameController.text = '${item.description}';
// }),
// key: key,
// suggestions: model.listOfICD10,
// suggestionsAmount: model.listOfICD10.length,
// itemBuilder: (context, suggestion) =>
// new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString(), fontSize: 12.0), padding: EdgeInsets.all(8.0)),
// itemSorter: (a, b) => 1,
// itemFilter: (suggestion, input) =>
// // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
// // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
// // suggestion.code.toLowerCase().startsWith(input.toLowerCase()),
// suggestion.description.toLowerCase().contains(input.toLowerCase()) ||
// // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
// suggestion.code.toLowerCase().contains(input.toLowerCase()),
//
// ),
// Expanded(
// child: IconButton(
// onPressed: () {
// print(icdNameController.text);
// if (icdNameController.text.length <= 3) {
// DrAppToastMsg.showErrorToast("Please enter 4 or more characters");
// } else {
// model.listOfICD10.clear();
// model.callAddAssessmentLookupsServices(searchKey: icdNameController.text);
// }
// },
// icon: Icon(Icons.search),
// ),
// ),
// ],
// ),
// )
]),
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: 7,
),
AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
onClick: model.listOfDiagnosisCondition != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisCondition!,
okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition,
okFunction: (MasterKeyModel selectedValue) {
setState(() {
widget.mySelectedAssessment.selectedDiagnosisCondition = selectedValue;
conditionController.text =
projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisCondition!.nameAr! : widget.mySelectedAssessment.selectedDiagnosisCondition!.nameEn!;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText: TranslationBase.of(context).condition,
maxLines: 1,
minLines: 1,
controller: conditionController,
isTextFieldHasSuffix: true,
enabled: false,
hasBorder: true,
validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisCondition == null ? TranslationBase.of(context).emptyMessage : null,
onChanged: (value) {},
onFieldSubmitted: () {},
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
onClick: model.listOfDiagnosisType != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisType!,
okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment.selectedDiagnosisType !=null ? widget.mySelectedAssessment.selectedDiagnosisType : null,
okFunction: (MasterKeyModel selectedValue) {
setState(() {
widget.mySelectedAssessment.selectedDiagnosisType = selectedValue;
typeController.text = projectViewModel.isArabic ? selectedValue.nameAr! : selectedValue.nameEn!;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText: TranslationBase.of(context).dType,
maxLines: 1,
minLines: 1,
enabled: true,
isTextFieldHasSuffix: true,
controller: typeController,
hasBorder: true,
validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisType == null ? TranslationBase.of(context).emptyMessage : null,
onChanged: (value) {},
onFieldSubmitted: () {},
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(left: 0, right: 0, top: 15),
child: AppTextFieldCustom(
hintText: TranslationBase.of(context).remarks,
maxLines: 18,
minLines: 5,
inputType: TextInputType.multiline,
controller: remarkController,
onChanged: (value) {
widget.mySelectedAssessment.remark = remarkController.text;
},
onFieldSubmitted: () {},
),
),
SizedBox(
height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort
? 20
: SizeConfig.isHeightShort
? 15
: 10),
),
])),
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: 7,
),
AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
onClick: model.listOfDiagnosisCondition != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisCondition!,
okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment
.selectedDiagnosisCondition,
okFunction:
(MasterKeyModel selectedValue) {
setState(() {
widget.mySelectedAssessment
.selectedDiagnosisCondition =
selectedValue;
conditionController
.text = projectViewModel
.isArabic
? widget
.mySelectedAssessment
.selectedDiagnosisCondition!
.nameAr!
: widget
.mySelectedAssessment
.selectedDiagnosisCondition!
.nameEn!;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText: TranslationBase.of(context).condition,
maxLines: 1,
minLines: 1,
controller: conditionController,
isTextFieldHasSuffix: true,
enabled: false,
hasBorder: true,
validationError: isFormSubmitted &&
widget.mySelectedAssessment
.selectedDiagnosisCondition ==
null
? TranslationBase.of(context).emptyMessage
: null,
onChanged: (value) {},
onFieldSubmitted: () {},
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
onClick: model.listOfDiagnosisType != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisType!,
okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment
.selectedDiagnosisType !=
null
? widget.mySelectedAssessment
.selectedDiagnosisType
: null,
okFunction:
(MasterKeyModel selectedValue) {
setState(() {
widget.mySelectedAssessment
.selectedDiagnosisType =
selectedValue;
typeController.text =
projectViewModel.isArabic
? selectedValue.nameAr!
: selectedValue.nameEn!;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
hintText: TranslationBase.of(context).dType,
maxLines: 1,
minLines: 1,
enabled: true,
isTextFieldHasSuffix: true,
controller: typeController,
hasBorder: true,
validationError: isFormSubmitted &&
widget.mySelectedAssessment
.selectedDiagnosisType ==
null
? TranslationBase.of(context).emptyMessage
: null,
onChanged: (value) {},
onFieldSubmitted: () {},
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(left: 0, right: 0, top: 15),
child: AppTextFieldCustom(
hintText: TranslationBase.of(context).remarks,
maxLines: 18,
minLines: 5,
inputType: TextInputType.multiline,
controller: remarkController,
onChanged: (value) {
widget.mySelectedAssessment.remark =
remarkController.text;
},
onFieldSubmitted: () {},
),
),
SizedBox(
height: SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort
? 20
: SizeConfig.isHeightShort
? 15
: 10),
),
])),
),
],
),
@ -386,17 +544,26 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
height: 0,
)
: CustomBottomSheetContainer(
label: (widget.isUpdate ? TranslationBase.of(context).updateAssessmentDetails : TranslationBase.of(context).addAssessmentDetails),
label: (widget.isUpdate
? TranslationBase.of(context).updateAssessmentDetails
: TranslationBase.of(context).addAssessmentDetails),
onTap: () async {
setState(() {
isFormSubmitted = true;
});
widget.mySelectedAssessment.remark = remarkController.text;
widget.mySelectedAssessment.appointmentId = int.parse(appointmentIdController.text);
if (widget.mySelectedAssessment.selectedDiagnosisCondition != null &&
widget.mySelectedAssessment.selectedDiagnosisType != null &&
widget.mySelectedAssessment.appointmentId =
int.parse(appointmentIdController.text);
if (widget.mySelectedAssessment
.selectedDiagnosisCondition !=
null &&
widget.mySelectedAssessment.selectedDiagnosisType !=
null &&
widget.mySelectedAssessment.selectedICD != null) {
await submitAssessment(isUpdate: widget.isUpdate, model: model, mySelectedAssessment: widget.mySelectedAssessment);
await submitAssessment(
isUpdate: widget.isUpdate,
model: model,
mySelectedAssessment: widget.mySelectedAssessment);
}
},
),
@ -405,44 +572,54 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
);
}
submitAssessment({SOAPViewModel? model, MySelectedAssessment? mySelectedAssessment, bool isUpdate = false}) async {
submitAssessment(
{SOAPViewModel? model,
MySelectedAssessment? mySelectedAssessment,
bool isUpdate = false}) async {
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
GifLoaderDialogUtils.showMyDialog(context);
if (isUpdate) {
PostAssessmentRequestUpdateModel patchAssessmentReqModel = PostAssessmentRequestUpdateModel(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
createdByName: doctorProfile.doctorName,
createdBy: doctorProfile.doctorID,
icdCodeDetails: [
PostAssessmentRequestUpdateModel patchAssessmentReqModel =
PostAssessmentRequestUpdateModel(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
createdByName: doctorProfile.doctorName,
createdBy: doctorProfile.doctorID,
icdCodeDetails: [
new IcdCodeDetailsUpdate(
remarks: mySelectedAssessment!.remark,
complexDiagnosis: complexDiagnosis,
conditionId: mySelectedAssessment!.selectedDiagnosisCondition!.id,
conditionId:
mySelectedAssessment!.selectedDiagnosisCondition!.id,
prevIcdCode10ID: mySelectedAssessment.icdCode10ID,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id,
icdcode10Id: mySelectedAssessment.selectedICD!.code)
icdcode10Id: mySelectedAssessment.selectedICD!.code,
//todo will update the morphology here
)
]);
await model?.patchAssessment(patchAssessmentReqModel);
} else {
// Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
// DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostAssessmentRequestModel postAssessmentRequestModel = new PostAssessmentRequestModel(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
createdByName: doctorProfile.doctorName,
createdBy: doctorProfile.doctorID,
icdCodeDetails: [
new IcdCodeDetails(
remarks: mySelectedAssessment!.remark,
complexDiagnosis: complexDiagnosis,
conditionId: mySelectedAssessment!.selectedDiagnosisCondition!.id,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id,
icdcode10Id: mySelectedAssessment.selectedICD!.code)
PostAssessmentRequestModel postAssessmentRequestModel =
PostAssessmentRequestModel(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
createdByName: doctorProfile.doctorName,
createdBy: doctorProfile.doctorID,
icdCodeDetails: [
IcdCodeDetails(
remarks: mySelectedAssessment!.remark,
complexDiagnosis: complexDiagnosis,
conditionId: mySelectedAssessment!.selectedDiagnosisCondition!.id,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id,
icdcode10Id: mySelectedAssessment.selectedICD!.code,
morphologyCode: mySelectedAssessment.morphologyCode,
)
]);
await model?.postAssessment(postAssessmentRequestModel);
}

@ -30,16 +30,23 @@ class UpdateAssessmentPage extends StatefulWidget {
final Function changeLoadingState;
final int currentIndex;
UpdateAssessmentPage({Key? key, required this.changePageViewIndex, required this.patientInfo, required this.changeLoadingState, required this.currentIndex});
UpdateAssessmentPage(
{Key? key,
required this.changePageViewIndex,
required this.patientInfo,
required this.changeLoadingState,
required this.currentIndex});
@override
_UpdateAssessmentPageState createState() => _UpdateAssessmentPageState();
}
class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements AssessmentCallBack {
class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
implements AssessmentCallBack {
bool isAssessmentExpand = false;
List<MySelectedAssessment> mySelectedAssessmentList = [];
bool isPrescriptionOrder =false;
bool isPrescriptionOrder = false;
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
@ -65,18 +72,22 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
masterKeys: MasterKeysService.DiagnosisCondition,
id: element.conditionID!,
);
if (diagnosisCondition != null && diagnosisType != null && diagnosisCondition != null) {
MySelectedAssessment temMySelectedAssessment = SoapUtils.generateMySelectedAssessment(
appointmentNo: element.appointmentNo,
remark: element.remarks,
diagnosisType: diagnosisType,
diagnosisCondition: diagnosisCondition,
selectedICD: selectedICD,
doctorID: element.doctorID,
doctorName: element.doctorName,
createdBy: element.createdBy,
createdOn: element.createdOn,
icdCode10ID: element.icdCode10ID);
if (diagnosisCondition != null &&
diagnosisType != null &&
diagnosisCondition != null) {
MySelectedAssessment temMySelectedAssessment =
SoapUtils.generateMySelectedAssessment(
appointmentNo: element.appointmentNo,
remark: element.remarks,
diagnosisType: diagnosisType,
diagnosisCondition: diagnosisCondition,
selectedICD: selectedICD,
doctorID: element.doctorID,
doctorName: element.doctorName,
createdBy: element.createdBy,
createdOn: element.createdOn,
icdCode10ID: element.icdCode10ID,
morphology: element.morphologyCode);
mySelectedAssessmentList.add(temMySelectedAssessment);
}
@ -117,18 +128,22 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
Column(
children: [
SOAPOpenItems(
label: "${TranslationBase.of(context).addAssessment}",
label:
"${TranslationBase.of(context).addAssessment}",
onTap: () {
openAssessmentDialog(context, isUpdate: false, model: model);
openAssessmentDialog(context,
isUpdate: false, model: model);
},
),
SizedBox(
height: 20,
),
Column(
children: mySelectedAssessmentList.map((assessment) {
children:
mySelectedAssessmentList.map((assessment) {
return Container(
margin: EdgeInsets.only(left: 5, right: 5, top: 15, bottom: 15),
margin: EdgeInsets.only(
left: 5, right: 5, top: 15, bottom: 15),
child: Column(
children: [
Row(
@ -136,7 +151,9 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
@ -145,53 +162,102 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
new TextSpan(
text: "ICD : ".toUpperCase(),
),
new TextSpan(text: (assessment != null && assessment.selectedICD != null) ? assessment.selectedICD!.code.trim().toUpperCase() ?? "" : ""),
new TextSpan(
text: (assessment != null &&
assessment
.selectedICD !=
null)
? assessment
.selectedICD!
.code
.trim()
.toUpperCase() ??
""
: ""),
],
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
AppText(
assessment.createdOn != null
? AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(assessment.createdOn!), isMonthShort: true)
: AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()),
? AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.parse(
assessment
.createdOn!),
isMonthShort: true)
: AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.now()),
fontWeight: FontWeight.w600,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
),
AppText(
assessment.createdOn != null ? AppDateUtils.getHour(DateTime.parse(assessment.createdOn!)) : AppDateUtils.getHour(DateTime.now()),
assessment.createdOn != null
? AppDateUtils.getHour(
DateTime.parse(
assessment
.createdOn!))
: AppDateUtils.getHour(
DateTime.now()),
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
),
],
),
],
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Container(
width: MediaQuery.of(context).size.width * 0.50,
width: MediaQuery.of(context)
.size
.width *
0.50,
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.3,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4.3,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontWeight:
FontWeight.w600,
letterSpacing: -0.64,
),
children: <TextSpan>[
new TextSpan(
text: (assessment != null && assessment.selectedICD != null) ? assessment.selectedICD!.description.toString() : "",
text: (assessment !=
null &&
assessment
.selectedICD !=
null)
? assessment
.selectedICD!
.description
.toString()
: "",
// text: assessment.selectedICD.description.toString(),
),
],
@ -201,26 +267,82 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.5,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).appointmentNo,
text: TranslationBase.of(
context)
.appointmentNo,
style: new TextStyle(
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
letterSpacing: -0.4,
color:
Color(0xFF575757),
),
),
new TextSpan(
text: assessment
.appointmentId
.toString() ??
"",
style: new TextStyle(
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
letterSpacing: -0.48,
color:
Color(0xFF2B353E),
),
),
],
),
),
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight:
FontWeight.w600),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(
context)
.condition +
" : ",
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
letterSpacing: -0.4,
color: Color(0xFF575757),
color:
Color(0xFF575757),
),
),
new TextSpan(
text: assessment.appointmentId.toString() ?? "",
text: projectViewModel
.isArabic
? assessment
.selectedDiagnosisCondition!
.nameAr
: assessment
.selectedDiagnosisCondition!
.nameEn,
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
letterSpacing: -0.48,
color: Color(0xFF2B353E),
color:
Color(0xFF2B353E),
),
),
],
@ -229,21 +351,32 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600),
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight:
FontWeight.w600),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).condition + " : ",
text: TranslationBase.of(
context).morphology,
style: new TextStyle(
letterSpacing: -0.4,
color: Color(0xFF575757),
color:
Color(0xFF575757),
),
),
new TextSpan(
text: projectViewModel.isArabic ? assessment.selectedDiagnosisCondition!.nameAr : assessment.selectedDiagnosisCondition!.nameEn,
text: assessment.morphologyCode,
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
letterSpacing: -0.48,
color: Color(0xFF2B353E),
color:
Color(0xFF2B353E),
),
),
],
@ -252,21 +385,41 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600),
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight:
FontWeight.w600),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).dType + ' : ',
text: TranslationBase.of(
context)
.dType +
' : ',
style: new TextStyle(
letterSpacing: -0.4,
color: Color(0xFF575757),
color:
Color(0xFF575757),
),
),
new TextSpan(
text: projectViewModel.isArabic ? assessment.selectedDiagnosisType!.nameAr : assessment.selectedDiagnosisType!.nameEn,
text: projectViewModel
.isArabic
? assessment
.selectedDiagnosisType!
.nameAr
: assessment
.selectedDiagnosisType!
.nameEn,
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
letterSpacing: -0.48,
color: Color(0xFF2B353E),
color:
Color(0xFF2B353E),
),
),
],
@ -276,22 +429,41 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600),
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
color:
Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight:
FontWeight.w600),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).doctor + ' : ',
text:
TranslationBase.of(
context)
.doctor +
' : ',
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
letterSpacing: -0.4,
color: Color(0xFF575757),
color:
Color(0xFF575757),
),
),
new TextSpan(
text: assessment.doctorName ?? '',
text: assessment
.doctorName ??
'',
style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
letterSpacing: -0.48,
color: Color(0xFF2B353E),
color:
Color(0xFF2B353E),
),
),
],
@ -301,43 +473,80 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
height: 6,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
SizedBox(
height: 6,
),
AppText((assessment.remark != null && assessment.remark != '') ? TranslationBase.of(context).remarks + " : " : '',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600),
AppText(
(assessment.remark !=
null &&
assessment
.remark !=
'')
? TranslationBase.of(
context)
.remarks +
" : "
: '',
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight:
FontWeight.w600),
RemarkText(
remark: assessment.remark ?? "",
remark:
assessment.remark ?? "",
),
],
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
SizedBox(
height: MediaQuery.of(context).size.height * 0.05,
height: MediaQuery.of(context)
.size
.height *
0.05,
),
InkWell(
onTap: () {
if(model.isPrescriptionOrder && assessment.selectedDiagnosisType!.id ==2) {
Utils.showErrorToast(TranslationBase.of(context).principalDiagnosisCannot);
}else{
if (model
.isPrescriptionOrder &&
assessment
.selectedDiagnosisType!
.id ==
2) {
Utils.showErrorToast(
TranslationBase.of(
context)
.principalDiagnosisCannot);
} else {
openAssessmentDialog(
context, isUpdate: true,
context,
isUpdate: true,
assessment: assessment,
model: model);
}
},
child: Icon(
DoctorApp.edit,
size: 18,
color: model.isPrescriptionOrder && assessment.selectedDiagnosisType!.id ==2 ? Colors.grey : Colors.black ,
color: model.isPrescriptionOrder &&
assessment
.selectedDiagnosisType!
.id ==
2
? Colors.grey
: Colors.black,
),
)
],
@ -367,9 +576,13 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
);
}
openAssessmentDialog(BuildContext context, {MySelectedAssessment? assessment, bool isUpdate = false, required SOAPViewModel model}) {
openAssessmentDialog(BuildContext context,
{MySelectedAssessment? assessment,
bool isUpdate = false,
required SOAPViewModel model}) {
if (assessment == null) {
assessment = SoapUtils.generateMySelectedAssessment(remark: '', appointmentNo: widget.patientInfo.appointmentNo);
assessment = SoapUtils.generateMySelectedAssessment(
remark: '', appointmentNo: widget.patientInfo.appointmentNo);
}
showModalBottomSheet(
backgroundColor: Colors.white,
@ -381,9 +594,11 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
patientInfo: widget.patientInfo,
isUpdate: isUpdate,
mySelectedAssessmentList: mySelectedAssessmentList,
addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, bool isUpdate) async {
addSelectedAssessment: (MySelectedAssessment mySelectedAssessment,
bool isUpdate) async {
setState(() {
if (!isUpdate) mySelectedAssessmentList.add(mySelectedAssessment);
if (!isUpdate)
mySelectedAssessmentList.add(mySelectedAssessment);
});
});
});
@ -393,17 +608,24 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
nextFunction(model) {
if (mySelectedAssessmentList.isEmpty) {
Utils.showErrorToast(TranslationBase.of(context).assessmentErrorMsg);
} else if(!checkPrimaryDiagnosis()) {
} else if (!checkPrimaryDiagnosis()) {
Utils.showErrorToast(TranslationBase.of(context).onePrimaryDiagnosis);
}else{
} else {
widget.changeLoadingState(true);
widget.changePageViewIndex(3);
}
}
bool checkPrimaryDiagnosis(){
ProjectViewModel projectViewModel = Provider.of<ProjectViewModel>(context, listen: false);
bool isVidaPlus = Utils.isVidaPlusProject(projectViewModel, widget.patientInfo.projectId!);
List<MySelectedAssessment> type = mySelectedAssessmentList.where((element) => (element.selectedDiagnosisType!.id==2 && isVidaPlus ==false) || (element.selectedDiagnosisType!.code=='3' && isVidaPlus==true)).toList();
return type.isEmpty ? false : true;
bool checkPrimaryDiagnosis() {
ProjectViewModel projectViewModel =
Provider.of<ProjectViewModel>(context, listen: false);
bool isVidaPlus = Utils.isVidaPlusProject(
projectViewModel, widget.patientInfo.projectId!);
List<MySelectedAssessment> type = mySelectedAssessmentList
.where((element) =>
(element.selectedDiagnosisType!.id == 2 && isVidaPlus == false) ||
(element.selectedDiagnosisType!.code == '3' && isVidaPlus == true))
.toList();
return type.isEmpty ? false : true;
}
}

@ -32,7 +32,7 @@ class SoapUtils {
return mySelectedExamination;
}
static MySelectedAssessment generateMySelectedAssessment({appointmentNo, remark, diagnosisType, diagnosisCondition, selectedICD, doctorID, doctorName, createdBy, createdOn, icdCode10ID}) {
static MySelectedAssessment generateMySelectedAssessment({appointmentNo, remark, diagnosisType, diagnosisCondition, selectedICD, doctorID, doctorName, createdBy, createdOn, icdCode10ID, morphology}) {
MySelectedAssessment mySelectedAssessment = MySelectedAssessment(
appointmentId: appointmentNo,
remark: remark,
@ -43,7 +43,9 @@ class SoapUtils {
doctorName: doctorName,
createdBy: createdBy,
createdOn: createdOn,
icdCode10ID: icdCode10ID);
icdCode10ID: icdCode10ID,
morphologyCode: morphology
);
return mySelectedAssessment;
}
}

@ -1956,7 +1956,8 @@ class TranslationBase {
String get progressNoteCanNotBeEmpty => localizedValues['progressNoteCanNotBeEmpty']![locale.languageCode]!;
String get diagnosisAlreadyResolved => localizedValues['diagnosisAlreadyResolved']![locale.languageCode]!;
String get diagnosisAlreadyDeleted => localizedValues['diagnosisAlreadyDeleted']![locale.languageCode]!;
String get morphology => localizedValues['morphology']![locale.languageCode]!;
String get intendedLengthOfStay => localizedValues['intendedLengthOfStay']![locale.languageCode]!;
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -13,9 +13,10 @@ class MasterKeyDailog extends StatefulWidget {
final okText;
final Function(MasterKeyModel) okFunction;
MasterKeyModel? selectedValue;
String? selectedStringValue;
final bool isICD;
MasterKeyDailog({required this.list, required this.okText, required this.okFunction, this.selectedValue, this.isICD = false});
MasterKeyDailog({required this.list, required this.okText, required this.okFunction, this.selectedValue, this.isICD = false, this.selectedStringValue});
@override
_MasterKeyDailogState createState() => _MasterKeyDailogState();
@ -81,7 +82,7 @@ class _MasterKeyDailogState extends State<MasterKeyDailog> {
groupValue: widget.isICD ? widget.selectedValue!.code.toString() : widget.selectedValue!.id.toString(),
value: widget.isICD ? widget.selectedValue!.code.toString() : item.id.toString(),
activeColor: Colors.blue.shade700,
selected: widget.isICD ? item.code.toString() == widget.selectedValue!.code.toString() : item.id.toString() == widget.selectedValue!.id.toString(),
selected: widget.isICD ? item.code.toString() == widget.selectedValue!.code.toString() : (item.id.toString() == widget.selectedValue!.id.toString() || item.code.toString() == widget.selectedStringValue ),
onChanged: (val) {
setState(() {
widget.selectedValue = item;

Loading…
Cancel
Save