updates & fixes

development-3.3_voipCall
haroon amjad 1 year ago
parent e530646c28
commit d2a16f5357

@ -181,6 +181,9 @@ class BaseAppClient {
body['DoctorID'] = doctorProfile?.doctorID;
}
}
if (body['DoctorID'] == 0) {
body['DoctorID'] = null;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_Language, 'en');
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null

@ -4,6 +4,7 @@ class DoctorsByClinicIdRequest {
bool continueDentalPlan;
bool isSearchAppointmnetByClinicID;
int patientID;
int doctorID;
int gender;
bool isGetNearAppointment;
bool isVoiceCommand;
@ -18,6 +19,7 @@ class DoctorsByClinicIdRequest {
this.continueDentalPlan = false,
this.isSearchAppointmnetByClinicID = true,
this.patientID,
this.doctorID,
this.gender,
this.isGetNearAppointment = false,
this.isVoiceCommand = true,
@ -30,6 +32,7 @@ class DoctorsByClinicIdRequest {
DoctorsByClinicIdRequest.fromJson(Map<String, dynamic> json) {
clinicID = json['ClinicID'];
projectID = json['ProjectID'];
doctorID = json['DoctorID'];
continueDentalPlan = json['ContinueDentalPlan'];
isSearchAppointmnetByClinicID = json['IsSearchAppointmnetByClinicID'];
patientID = json['PatientID'];
@ -49,6 +52,7 @@ class DoctorsByClinicIdRequest {
data['ContinueDentalPlan'] = this.continueDentalPlan;
data['IsSearchAppointmnetByClinicID'] = this.isSearchAppointmnetByClinicID;
data['PatientID'] = this.patientID;
data['DoctorID'] = this.doctorID;
data['gender'] = this.gender;
data['IsGetNearAppointment'] = this.isGetNearAppointment;
data['IsVoiceCommand'] = this.isVoiceCommand;

@ -227,7 +227,7 @@ class PatiantInformtion {
endTime = json['endTime'];
episodeNo = json['episodeNo'] ?? json['EpisodeID'] ?? json['EpisodeNo'];
fallRiskScore = json['fallRiskScore'];
isSigned = json['isSigned'];
isSigned = json['IsSigned'];
medicationOrders = json['medicationOrders'];
nationality = json['nationality'] ?? json['NationalityNameN'];
patientMRN = json['patientMRN'] ??

@ -55,10 +55,11 @@ class LookupService extends BaseService {
List<dynamic> listOfAdmissionType = [];
List<dynamic> listOfDiagnosisSelectionTypes = [];
Future getMasterLookup(MasterKeysService masterKeys) async {
Future getMasterLookup(MasterKeysService masterKeys, {String searchKey = ""}) async {
hasError = false;
Map<String, dynamic> body = {
"MasterInput": masterKeys.getMasterKeyService()
"MasterInput": masterKeys.getMasterKeyService(),
"SearchKey": searchKey
};
await baseAppClient.post(GET_MASTER_LOOKUP_LIST,
onSuccess: (dynamic response, int statusCode) {

@ -8,8 +8,7 @@ class OutPatientService extends BaseService {
List<PatiantInformtion> get patientList => _patientList;
Future getOutPatient(
PatientSearchRequestModel patientSearchRequestModel) async {
Future getOutPatient(PatientSearchRequestModel patientSearchRequestModel) async {
hasError = false;
await baseAppClient.post(
GET_MY_OUT_PATIENT,
@ -27,8 +26,7 @@ class OutPatientService extends BaseService {
);
}
Future getPatientFileInformation(
PatientSearchRequestModel patientSearchRequestModel) async {
Future getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel) async {
hasError = false;
await baseAppClient.post(
PRM_SEARCH_PATIENT,

@ -114,6 +114,7 @@ class PatientReferralService extends LookupService {
_doctorsByClinicIdRequest.clinicID = clinicId;
_doctorsByClinicIdRequest.patientID = patient.patientId;
_doctorsByClinicIdRequest.gender = patient.gender;
_doctorsByClinicIdRequest.doctorID = 0;
await baseAppClient.postPatient(PATIENT_GET_DOCTOR_BY_CLINIC_Hospital,
onSuccess: (dynamic response, int statusCode) {

@ -152,12 +152,12 @@ class SOAPViewModel extends BaseViewModel {
planCallBack.nextFunction(model);
}
Future getMasterLookup(MasterKeysService masterKeys,
{bool isBusyLocal = false}) async {
{bool isBusyLocal = false, String searchKey = ""}) async {
if (isBusyLocal) {
setState(ViewState.Busy);
} else
setState(ViewState.Busy);
await _SOAPService.getMasterLookup(masterKeys);
await _SOAPService.getMasterLookup(masterKeys, searchKey: searchKey);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.Error);

@ -189,7 +189,7 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
children: [
ElevatedButton(
child: AppText(
"Sing In",
"Sign In",
fontWeight: FontWeight.w600,
color: Colors.black,
fontSize: 16,
@ -199,7 +199,7 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
}),
ElevatedButton(
child: AppText(
"Sing Out",
"Sign Out",
fontWeight: FontWeight.w600,
color: Colors.black,
fontSize: 16,

@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/date-utils.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/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -23,10 +24,7 @@ class ECGPage extends StatelessWidget {
String arrivalType = routeArgs['arrival-type'];
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PatientMuseViewModel>(
onModelReady: (model) => model.getECGPatient(
patientType: patient.patientType,
patientOutSA: 0,
patientID: patient.patientId),
onModelReady: (model) => model.getECGPatient(patientType: patient.patientType, patientOutSA: 0, patientID: patient.patientId),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
@ -59,19 +57,24 @@ class ECGPage extends StatelessWidget {
model.patientMuseResultsModelList.length,
(index) => InkWell(
onTap: () async {
await launch(model
.patientMuseResultsModelList[index].imageURL);
Uri ecgImageURL = Uri.parse(model.patientMuseResultsModelList[index].imageURL);
await canLaunchUrl(ecgImageURL).then((value) async {
await launchUrl(ecgImageURL);
}).catchError((err) {
DrAppToastMsg.showErrorToast(err.toString());
});
// if (await canLaunchUrl(ecgImageURL)) {
// await launchUrl(ecgImageURL);
// } else {
// DrAppToastMsg.showErrorToast("Unable to open ECG Image");
// }
},
child: Container(
width: double.infinity,
height: 120,
margin: EdgeInsets.only(top: 5, bottom: 5),
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
border:
Border.all(color: Colors.white, width: 2),
color: Colors.white,
borderRadius: BorderRadius.circular(8)),
decoration: BoxDecoration(border: Border.all(color: Colors.white, width: 2), color: Colors.white, borderRadius: BorderRadius.circular(8)),
child: Column(
children: [
Row(
@ -79,8 +82,7 @@ class ECGPage extends StatelessWidget {
children: [
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
'ECG Report',
@ -90,26 +92,12 @@ class ECGPage extends StatelessWidget {
SizedBox(height: 3),
RichText(
text: TextSpan(
style: TextStyle(
fontSize: 1.6 *
SizeConfig.textMultiplier,
color: Colors.black),
style: TextStyle(fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black),
children: <TextSpan>[
new TextSpan(text: TranslationBase.of(context).orderNo, style: TextStyle(fontSize: 12, fontFamily: 'Poppins')),
new TextSpan(
text: TranslationBase.of(
context)
.orderNo,
style: TextStyle(
fontSize: 12,
fontFamily: 'Poppins')),
new TextSpan(
text:
'${/*model.patientMuseResultsModelList[index].orderNo?? */ '3455'}',
style: TextStyle(
fontWeight:
FontWeight.w600,
fontFamily: 'Poppins',
fontSize: 14)),
text: '${/*model.patientMuseResultsModelList[index].orderNo?? */ '3455'}',
style: TextStyle(fontWeight: FontWeight.w600, fontFamily: 'Poppins', fontSize: 14)),
],
),
)
@ -118,8 +106,7 @@ class ECGPage extends StatelessWidget {
),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime, isArabic: projectViewModel.isArabic)}',

@ -230,6 +230,7 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
"isInpatient": false,
"arrivalType": "7",
"isSearchAndOut": false,
"isSigned": model.filterData[index].isSigned != null ? model.filterData[index].isSigned : false,
});
},
// isFromSearch: widget.isSearch,

@ -44,6 +44,8 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
bool isFromSearch = false;
bool isFromLiveCare = false;
bool isSigned = false;
bool isInpatient = false;
bool isMyPatient = false;
bool isCallFinished = false;
@ -87,6 +89,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
arrivalType = routeArgs['arrivalType'];
from = routeArgs['from'];
to = routeArgs['to'];
isSigned = routeArgs['isSigned'];
if (routeArgs.containsKey("isSearch")) {
isFromSearch = routeArgs['isSearch'];
}
@ -263,7 +266,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
if (patient.episodeNo != 0)
AppButton(
loading: model.state == ViewState.BusyLocal,
disabled: model.state == ViewState.BusyLocal,
disabled: model.state == ViewState.BusyLocal || isSigned,
title: "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}",
color: ((isInpatient) || isFromLiveCare) && model.state != ViewState.BusyLocal
? AppGlobal.appRedColor

@ -19,8 +19,7 @@ class AddAllergies extends StatefulWidget {
final Function addAllergiesFun;
final List<MySelectedAllergy> myAllergiesList;
const AddAllergies({Key key, this.addAllergiesFun, this.myAllergiesList})
: super(key: key);
const AddAllergies({Key key, this.addAllergiesFun, this.myAllergiesList}) : super(key: key);
@override
_AddAllergiesState createState() => _AddAllergiesState();
@ -42,98 +41,80 @@ class _AddAllergiesState extends State<AddAllergies> {
@override
Widget build(BuildContext context) {
return FractionallySizedBox(
heightFactor: 1,
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.allergiesList.length == 0) {
await model.getMasterLookup(MasterKeysService.Allergies);
}
if (model.allergySeverityList.length == 0) {
await model.getMasterLookup(MasterKeysService.AllergySeverity);
}
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBar: BottomSheetTitle(
title: TranslationBase.of(context).addAllergies,
),
body: Center(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 10,
),
SizedBox(
height: 16,
),
Expanded(
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Center(
child: NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchAllergiesWidget(
model: model,
masterList: model.allergiesList,
removeAllergy: (master) {
setState(() {
removeAllergyFromLocalList(master);
});
},
addAllergy:
(MySelectedAllergy mySelectedAllergy) {
addAllergyLocally(mySelectedAllergy);
},
addSelectedAllergy: () {
setState(() {
widget
.addAllergiesFun(myAllergiesListLocal);
});
},
isServiceSelected: (master) =>
isServiceSelected(master),
getServiceSelectedAllergy: (master) =>
getSelectedAllergy(master),
),
),
),
),
),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.11,
),
]),
return AppScaffold(
// baseViewModel: model,
isShowAppBar: true,
appBar: BottomSheetTitle(
title: TranslationBase.of(context).addAllergies,
),
body: Center(
child: Container(
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
SizedBox(
height: 10,
),
),
bottomSheet: model.state != ViewState.Idle
? Container(
height: 0,
)
: CustomBottomSheetContainer(
label: TranslationBase.of(context).addAllergies,
onTap: () {
setState(() {
widget.addAllergiesFun(myAllergiesListLocal);
});
},
SizedBox(
height: 16,
),
Expanded(
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Center(
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {},
builder: (_, model, w) {
return MasterKeyCheckboxSearchAllergiesWidget(
model: model,
masterList: model.allergiesList,
removeAllergy: (master) {
setState(() {
removeAllergyFromLocalList(master);
});
},
addAllergy: (MySelectedAllergy mySelectedAllergy) {
addAllergyLocally(mySelectedAllergy);
},
addSelectedAllergy: () {
setState(() {
widget.addAllergiesFun(myAllergiesListLocal);
});
},
isServiceSelected: (master) => isServiceSelected(master),
getServiceSelectedAllergy: (master) => getSelectedAllergy(master),
);
}),
),
),
),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.11,
),
]),
),
),
bottomSheet:
// model.state != ViewState.Idle
// ?
// Container(
// height: 0,
// )
// :
CustomBottomSheetContainer(
label: TranslationBase.of(context).addAllergies,
onTap: () {
setState(() {
widget.addAllergiesFun(myAllergiesListLocal);
});
},
),
);
}
isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedAllergy> allergy = myAllergiesListLocal.where(
(element) =>
masterKey.id == element.selectedAllergy.id &&
masterKey.typeId == element.selectedAllergy.typeId &&
element.isChecked);
Iterable<MySelectedAllergy> allergy =
myAllergiesListLocal.where((element) => masterKey.id == element.selectedAllergy.id && masterKey.typeId == element.selectedAllergy.typeId && element.isChecked);
if (allergy.length > 0) {
return true;
}
@ -141,16 +122,12 @@ class _AddAllergiesState extends State<AddAllergies> {
}
removeAllergyFromLocalList(MasterKeyModel masterKey) {
myAllergiesListLocal
.removeWhere((element) => element.selectedAllergy.id == masterKey.id);
myAllergiesListLocal.removeWhere((element) => element.selectedAllergy.id == masterKey.id);
}
MySelectedAllergy getSelectedAllergy(MasterKeyModel masterKey) {
Iterable<MySelectedAllergy> allergy = myAllergiesListLocal.where(
(element) =>
masterKey.id == element.selectedAllergy.id &&
masterKey.typeId == element.selectedAllergy.typeId &&
element.isChecked);
Iterable<MySelectedAllergy> allergy =
myAllergiesListLocal.where((element) => masterKey.id == element.selectedAllergy.id && masterKey.typeId == element.selectedAllergy.typeId && element.isChecked);
if (allergy.length > 0) {
return allergy.first;
}
@ -164,18 +141,13 @@ class _AddAllergiesState extends State<AddAllergies> {
setState(() {
List<MySelectedAllergy> allergy =
// ignore: missing_return
myAllergiesListLocal
.where((element) =>
mySelectedAllergy.selectedAllergy.id ==
element.selectedAllergy.id)
.toList();
myAllergiesListLocal.where((element) => mySelectedAllergy.selectedAllergy.id == element.selectedAllergy.id).toList();
if (allergy.isEmpty) {
myAllergiesListLocal.add(mySelectedAllergy);
} else {
allergy.first.selectedAllergy = mySelectedAllergy.selectedAllergy;
allergy.first.selectedAllergySeverity =
mySelectedAllergy.selectedAllergySeverity;
allergy.first.selectedAllergySeverity = mySelectedAllergy.selectedAllergySeverity;
allergy.first.remark = mySelectedAllergy.remark;
allergy.first.isChecked = mySelectedAllergy.isChecked;
}

@ -1,3 +1,5 @@
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/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart';
@ -36,12 +38,10 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget {
: super(key: key);
@override
_MasterKeyCheckboxSearchAllergiesWidgetState createState() =>
_MasterKeyCheckboxSearchAllergiesWidgetState();
_MasterKeyCheckboxSearchAllergiesWidgetState createState() => _MasterKeyCheckboxSearchAllergiesWidgetState();
}
class _MasterKeyCheckboxSearchAllergiesWidgetState
extends State<MasterKeyCheckboxSearchAllergiesWidget> {
class _MasterKeyCheckboxSearchAllergiesWidgetState extends State<MasterKeyCheckboxSearchAllergiesWidget> {
List<MasterKeyModel> items = List();
TextEditingController filteredSearchController = TextEditingController();
@ -60,56 +60,66 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
child: Container(
height: Utils.getTextFieldHeight(),
child: Center(
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
children: [
AppTextFieldCustom(
hintText: TranslationBase.of(context).selectAllergy,
isTextFieldHasSuffix: true,
hasBorder: false,
controller: filteredSearchController,
onChanged: (value) {
filterSearchResults(value);
},
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Colors.black,
)),
child: Container(
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Column(
children: [
AppTextFieldCustom(
hintText: TranslationBase.of(context).selectAllergy,
isTextFieldHasSuffix: true,
hasBorder: false,
controller: filteredSearchController,
onChanged: (value) {
// filterSearchResults(value);
},
onFieldSubmitted: (value) {
widget.model.getMasterLookup(MasterKeysService.Allergies, searchKey: filteredSearchController.text);
widget.model.getMasterLookup(MasterKeysService.AllergySeverity, searchKey: "");
},
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Colors.black,
),
DividerWithSpacesAround(),
SizedBox(
height: 10,
onPressed: () {
widget.model.getMasterLookup(MasterKeysService.Allergies, searchKey: filteredSearchController.text);
widget.model.getMasterLookup(MasterKeysService.AllergySeverity, searchKey: "");
},
),
),
DividerWithSpacesAround(),
SizedBox(
height: 10,
),
Expanded(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Container(
height: MediaQuery.of(context).size.height * 0.60,
child: widget.model.state == ViewState.Idle
? ListView.builder(
itemCount: widget.model.allergiesList.length,
itemBuilder: (context, index) {
return AddAllergiesItem(
item: widget.model.allergiesList[index],
model: widget.model,
removeAllergy: widget.removeAllergy,
addAllergy: widget.addAllergy,
isServiceSelected: widget.isServiceSelected,
getServiceSelectedAllergy: widget.getServiceSelectedAllergy,
);
},
)
: widget.model.state == ViewState.Busy
? Center(child: CircularProgressIndicator())
: Container(),
),
Expanded(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Container(
height:
MediaQuery.of(context).size.height * 0.60,
child: ListView.builder(
itemCount: items.length,
itemBuilder: (context, index) {
return AddAllergiesItem(
item: items[index],
model: widget.model,
removeAllergy: widget.removeAllergy,
addAllergy: widget.addAllergy,
isServiceSelected:
widget.isServiceSelected,
getServiceSelectedAllergy:
widget.getServiceSelectedAllergy,
);
},
),
),
),
),
],
))),
),
),
],
),
),
),
),
),
SizedBox(
@ -126,8 +136,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
if (query.isNotEmpty) {
List<MasterKeyModel> dummyListData = List();
dummySearchList.forEach((items) {
if (items.nameAr.toLowerCase().contains(query.toLowerCase()) ||
items.nameEn.toLowerCase().contains(query.toLowerCase())) {
if (items.nameAr.toLowerCase().contains(query.toLowerCase()) || items.nameEn.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(items);
}
});

@ -25,19 +25,13 @@ class UpdateSubjectivePage extends StatefulWidget {
final PatiantInformtion patientInfo;
final int currentIndex;
UpdateSubjectivePage(
{Key key,
this.changePageViewIndex,
this.patientInfo,
this.changeLoadingState,
this.currentIndex});
UpdateSubjectivePage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex});
@override
_UpdateSubjectivePageState createState() => _UpdateSubjectivePageState();
}
class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
implements SubjectiveCallBack {
class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements SubjectiveCallBack {
bool isChiefExpand = false;
bool isHistoryExpand = false;
bool isAllergiesExpand = false;
@ -53,67 +47,43 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
widget.changeLoadingState(true);
if (model.patientHistoryList.isNotEmpty) {
model.patientHistoryList.forEach((element) {
if (element.historyType ==
MasterKeysService.HistoryFamily.getMasterKeyService()) {
if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistoryFamily,
id: element.historyId,
);
if (history != null) {
MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory(
history: history,
isChecked: element.isChecked,
remark: element.remarks,
isLocal: false);
MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory(history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false);
myHistoryList.add(mySelectedHistory);
}
}
if (element.historyType ==
MasterKeysService.HistoryMedical.getMasterKeyService()) {
if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistoryMedical,
id: element.historyId,
);
if (history != null) {
MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory(
history: history,
isChecked: element.isChecked,
remark: element.remarks,
isLocal: false);
MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory(history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false);
myHistoryList.add(mySelectedHistory);
}
}
if (element.historyType ==
MasterKeysService.HistorySports.getMasterKeyService()) {
if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistorySports,
id: element.historyId,
);
if (history != null) {
MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory(
history: history,
isChecked: element.isChecked,
remark: element.remarks,
isLocal: false);
MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory(history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false);
myHistoryList.add(mySelectedHistory);
}
}
if (element.historyType ==
MasterKeysService.HistorySurgical.getMasterKeyService()) {
if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistorySurgical,
id: element.historyId,
);
if (history != null) {
MySelectedHistory mySelectedHistory =
SoapUtils.generateMySelectedHistory(
history: history,
isChecked: element.isChecked,
remark: element.remarks,
isLocal: false);
MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory(history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false);
myHistoryList.add(mySelectedHistory);
}
}
@ -124,17 +94,10 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
getAllergies(SOAPViewModel model) async {
if (model.patientAllergiesList.isNotEmpty) {
model.patientAllergiesList.forEach((element) {
MasterKeyModel selectedAllergy = model.getOneMasterKey(
masterKeys: MasterKeysService.Allergies,
id: element.allergyDiseaseId,
typeId: element.allergyDiseaseType);
MasterKeyModel selectedAllergy = model.getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType);
MasterKeyModel selectedAllergySeverity;
if (element.severity == 0) {
selectedAllergySeverity = MasterKeyModel(
id: 0,
typeId: MasterKeysService.AllergySeverity.getMasterKeyService(),
nameAr: '',
nameEn: '');
selectedAllergySeverity = MasterKeyModel(id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: '');
} else {
selectedAllergySeverity = model.getOneMasterKey(
masterKeys: MasterKeysService.AllergySeverity,
@ -142,17 +105,10 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
);
}
MySelectedAllergy mySelectedAllergy =
SoapUtils.generateMySelectedAllergy(
allergy: selectedAllergy,
isChecked: element.isChecked,
createdBy: element.createdBy,
remark: element.remarks,
isLocal: false,
allergySeverity: selectedAllergySeverity);
MySelectedAllergy mySelectedAllergy = SoapUtils.generateMySelectedAllergy(
allergy: selectedAllergy, isChecked: element.isChecked, createdBy: element.createdBy, remark: element.remarks, isLocal: false, allergySeverity: selectedAllergySeverity);
if (selectedAllergy != null && selectedAllergySeverity != null)
myAllergiesList.add(mySelectedAllergy);
if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy);
});
}
}
@ -168,14 +124,11 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
if (model.patientChiefComplaintList.isNotEmpty) {
isChiefExpand = true;
complaintsController.text = Utils.parseHtmlString(
model.patientChiefComplaintList[0].chiefComplaint);
complaintsController.text = Utils.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint);
illnessController.text = model.patientChiefComplaintList[0].hopi;
medicationController.text =
!(model.patientChiefComplaintList[0].currentMedication).isNotEmpty
? model.patientChiefComplaintList[0].currentMedication +
'\n \n'
: model.patientChiefComplaintList[0].currentMedication;
medicationController.text = model.patientChiefComplaintList[0].currentMedication != null ? !(model.patientChiefComplaintList[0].currentMedication).isNotEmpty
? model.patientChiefComplaintList[0].currentMedication + '\n \n'
: model.patientChiefComplaintList[0].currentMedication : "";
}
if (widget.patientInfo.admissionNo == null) {
await getHistory(model);
@ -214,17 +167,14 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
complaintsController: complaintsController,
illnessController: illnessController,
medicationController: medicationController,
complaintsControllerError:
model.complaintsControllerError,
complaintsControllerError: model.complaintsControllerError,
illnessControllerError: model.illnessControllerError,
medicationControllerError:
model.medicationControllerError,
medicationControllerError: model.medicationControllerError,
),
isExpanded: isChiefExpand,
),
SizedBox(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 4 : 2),
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2),
),
if (widget.patientInfo.admissionNo == null)
ExpandableSOAPWidget(
@ -236,15 +186,12 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
});
},
child: Column(
children: [
UpdateHistoryWidget(myHistoryList: myHistoryList)
],
children: [UpdateHistoryWidget(myHistoryList: myHistoryList)],
),
isExpanded: isHistoryExpand,
),
SizedBox(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 4 : 2),
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2),
),
if (widget.patientInfo.admissionNo == null)
ExpandableSOAPWidget(
@ -268,8 +215,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
isExpanded: isAllergiesExpand,
),
SizedBox(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 20 : 10),
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : 10),
),
],
),
@ -280,10 +226,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
);
}
addSubjectiveInfo(
{SOAPViewModel model,
List<MySelectedAllergy> myAllergiesList,
List<MySelectedHistory> myHistoryList}) async {
addSubjectiveInfo({SOAPViewModel model, List<MySelectedAllergy> myAllergiesList, List<MySelectedHistory> myHistoryList}) async {
if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus();
widget.changeLoadingState(true);
formKey.currentState.save();
@ -292,8 +235,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
model.complaintsControllerError = '';
model.medicationControllerError = '';
model.illnessControllerError = '';
if (complaintsController.text.isNotEmpty &&
illnessController.text.isNotEmpty) {
if (complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty) {
await model.postSubjectServices(
patientInfo: widget.patientInfo,
complaintsText: complaintsController.text,
@ -309,32 +251,25 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
} else {
setState(() {
if (complaintsController.text.isEmpty) {
model.complaintsControllerError =
TranslationBase.of(context).emptyMessage;
model.complaintsControllerError = TranslationBase.of(context).emptyMessage;
}
if (illnessController.text.isEmpty) {
model.illnessControllerError =
TranslationBase.of(context).emptyMessage;
model.illnessControllerError = TranslationBase.of(context).emptyMessage;
}
if (medicationController.text.isEmpty) {
model.medicationControllerError =
TranslationBase.of(context).emptyMessage;
model.medicationControllerError = TranslationBase.of(context).emptyMessage;
}
});
widget.changeLoadingState(false);
Utils.showErrorToast(
TranslationBase.of(context).chiefComplaintErrorMsg);
Utils.showErrorToast(TranslationBase.of(context).chiefComplaintErrorMsg);
}
}
@override
Function nextFunction(model) {
addSubjectiveInfo(
model: model,
myAllergiesList: myAllergiesList,
myHistoryList: myHistoryList);
addSubjectiveInfo(model: model, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList);
}
}

@ -11,7 +11,7 @@ description: A new Flutter project.
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.3.97+1
version: 1.3.9+19
environment:

Loading…
Cancel
Save