updates & fixes

development-3.3_voipCall
haroon amjad 3 years ago
parent e530646c28
commit d2a16f5357

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

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

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

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

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

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

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

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

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

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

@ -19,8 +19,7 @@ class AddAllergies extends StatefulWidget {
final Function addAllergiesFun; final Function addAllergiesFun;
final List<MySelectedAllergy> myAllergiesList; final List<MySelectedAllergy> myAllergiesList;
const AddAllergies({Key key, this.addAllergiesFun, this.myAllergiesList}) const AddAllergies({Key key, this.addAllergiesFun, this.myAllergiesList}) : super(key: key);
: super(key: key);
@override @override
_AddAllergiesState createState() => _AddAllergiesState(); _AddAllergiesState createState() => _AddAllergiesState();
@ -42,98 +41,80 @@ class _AddAllergiesState extends State<AddAllergies> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return FractionallySizedBox( return AppScaffold(
heightFactor: 1, // baseViewModel: model,
child: BaseView<SOAPViewModel>( isShowAppBar: true,
onModelReady: (model) async { appBar: BottomSheetTitle(
if (model.allergiesList.length == 0) { title: TranslationBase.of(context).addAllergies,
await model.getMasterLookup(MasterKeysService.Allergies); ),
} body: Center(
if (model.allergySeverityList.length == 0) { child: Container(
await model.getMasterLookup(MasterKeysService.AllergySeverity); child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
} SizedBox(
}, height: 10,
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,
),
]),
), ),
), SizedBox(
bottomSheet: model.state != ViewState.Idle height: 16,
? Container( ),
height: 0, Expanded(
) child: Center(
: CustomBottomSheetContainer( child: FractionallySizedBox(
label: TranslationBase.of(context).addAllergies, widthFactor: 0.9,
onTap: () { child: Center(
setState(() { child: BaseView<SOAPViewModel>(
widget.addAllergiesFun(myAllergiesListLocal); 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) { isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedAllergy> allergy = myAllergiesListLocal.where( Iterable<MySelectedAllergy> allergy =
(element) => myAllergiesListLocal.where((element) => masterKey.id == element.selectedAllergy.id && masterKey.typeId == element.selectedAllergy.typeId && element.isChecked);
masterKey.id == element.selectedAllergy.id &&
masterKey.typeId == element.selectedAllergy.typeId &&
element.isChecked);
if (allergy.length > 0) { if (allergy.length > 0) {
return true; return true;
} }
@ -141,16 +122,12 @@ class _AddAllergiesState extends State<AddAllergies> {
} }
removeAllergyFromLocalList(MasterKeyModel masterKey) { removeAllergyFromLocalList(MasterKeyModel masterKey) {
myAllergiesListLocal myAllergiesListLocal.removeWhere((element) => element.selectedAllergy.id == masterKey.id);
.removeWhere((element) => element.selectedAllergy.id == masterKey.id);
} }
MySelectedAllergy getSelectedAllergy(MasterKeyModel masterKey) { MySelectedAllergy getSelectedAllergy(MasterKeyModel masterKey) {
Iterable<MySelectedAllergy> allergy = myAllergiesListLocal.where( Iterable<MySelectedAllergy> allergy =
(element) => myAllergiesListLocal.where((element) => masterKey.id == element.selectedAllergy.id && masterKey.typeId == element.selectedAllergy.typeId && element.isChecked);
masterKey.id == element.selectedAllergy.id &&
masterKey.typeId == element.selectedAllergy.typeId &&
element.isChecked);
if (allergy.length > 0) { if (allergy.length > 0) {
return allergy.first; return allergy.first;
} }
@ -164,18 +141,13 @@ class _AddAllergiesState extends State<AddAllergies> {
setState(() { setState(() {
List<MySelectedAllergy> allergy = List<MySelectedAllergy> allergy =
// ignore: missing_return // ignore: missing_return
myAllergiesListLocal myAllergiesListLocal.where((element) => mySelectedAllergy.selectedAllergy.id == element.selectedAllergy.id).toList();
.where((element) =>
mySelectedAllergy.selectedAllergy.id ==
element.selectedAllergy.id)
.toList();
if (allergy.isEmpty) { if (allergy.isEmpty) {
myAllergiesListLocal.add(mySelectedAllergy); myAllergiesListLocal.add(mySelectedAllergy);
} else { } else {
allergy.first.selectedAllergy = mySelectedAllergy.selectedAllergy; allergy.first.selectedAllergy = mySelectedAllergy.selectedAllergy;
allergy.first.selectedAllergySeverity = allergy.first.selectedAllergySeverity = mySelectedAllergy.selectedAllergySeverity;
mySelectedAllergy.selectedAllergySeverity;
allergy.first.remark = mySelectedAllergy.remark; allergy.first.remark = mySelectedAllergy.remark;
allergy.first.isChecked = mySelectedAllergy.isChecked; 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/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/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.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); : super(key: key);
@override @override
_MasterKeyCheckboxSearchAllergiesWidgetState createState() => _MasterKeyCheckboxSearchAllergiesWidgetState createState() => _MasterKeyCheckboxSearchAllergiesWidgetState();
_MasterKeyCheckboxSearchAllergiesWidgetState();
} }
class _MasterKeyCheckboxSearchAllergiesWidgetState class _MasterKeyCheckboxSearchAllergiesWidgetState extends State<MasterKeyCheckboxSearchAllergiesWidget> {
extends State<MasterKeyCheckboxSearchAllergiesWidget> {
List<MasterKeyModel> items = List(); List<MasterKeyModel> items = List();
TextEditingController filteredSearchController = TextEditingController(); TextEditingController filteredSearchController = TextEditingController();
@ -60,56 +60,66 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
child: Container( child: Container(
height: Utils.getTextFieldHeight(), height: Utils.getTextFieldHeight(),
child: Center( child: Center(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12), child: Column(
color: Colors.white), children: [
child: Column( AppTextFieldCustom(
children: [ hintText: TranslationBase.of(context).selectAllergy,
AppTextFieldCustom( isTextFieldHasSuffix: true,
hintText: TranslationBase.of(context).selectAllergy, hasBorder: false,
isTextFieldHasSuffix: true, controller: filteredSearchController,
hasBorder: false, onChanged: (value) {
controller: filteredSearchController, // filterSearchResults(value);
onChanged: (value) { },
filterSearchResults(value); onFieldSubmitted: (value) {
}, widget.model.getMasterLookup(MasterKeysService.Allergies, searchKey: filteredSearchController.text);
suffixIcon: IconButton( widget.model.getMasterLookup(MasterKeysService.AllergySeverity, searchKey: "");
icon: Icon( },
Icons.search, suffixIcon: IconButton(
color: Colors.black, icon: Icon(
)), Icons.search,
color: Colors.black,
), ),
DividerWithSpacesAround(), onPressed: () {
SizedBox( widget.model.getMasterLookup(MasterKeysService.Allergies, searchKey: filteredSearchController.text);
height: 10, 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( SizedBox(
@ -126,8 +136,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
if (query.isNotEmpty) { if (query.isNotEmpty) {
List<MasterKeyModel> dummyListData = List(); List<MasterKeyModel> dummyListData = List();
dummySearchList.forEach((items) { dummySearchList.forEach((items) {
if (items.nameAr.toLowerCase().contains(query.toLowerCase()) || if (items.nameAr.toLowerCase().contains(query.toLowerCase()) || items.nameEn.toLowerCase().contains(query.toLowerCase())) {
items.nameEn.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(items); dummyListData.add(items);
} }
}); });

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

Loading…
Cancel
Save