WIP:add button added.
parent
564e70c0f6
commit
1fbd511161
@ -0,0 +1,4 @@
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M10.6249 6.66671C10.6249 6.32153 10.3451 6.04171 9.99992 6.04171C9.65474 6.04171 9.37492 6.32153 9.37492 6.66671V9.37504H6.66659C6.32141 9.37504 6.04159 9.65486 6.04159 10C6.04159 10.3452 6.32141 10.625 6.66659 10.625H9.37492V13.3334C9.37492 13.6786 9.65474 13.9584 9.99992 13.9584C10.3451 13.9584 10.6249 13.6786 10.6249 13.3334V10.625H13.3333C13.6784 10.625 13.9583 10.3452 13.9583 10C13.9583 9.65486 13.6784 9.37504 13.3333 9.37504H10.6249V6.66671Z" fill="#2B353E"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.0476 1.45837H9.95227C8.12669 1.45836 6.69279 1.45835 5.57327 1.60887C4.42606 1.76311 3.51585 2.08564 2.80068 2.8008C2.08551 3.51597 1.76299 4.42618 1.60875 5.57339C1.45823 6.69291 1.45824 8.12681 1.45825 9.9524V10.0477C1.45824 11.8733 1.45823 13.3072 1.60875 14.4267C1.76299 15.5739 2.08551 16.4841 2.80068 17.1993C3.51585 17.9144 4.42606 18.237 5.57327 18.3912C6.69278 18.5417 8.12667 18.5417 9.95225 18.5417H10.0476C11.8731 18.5417 13.3071 18.5417 14.4266 18.3912C15.5738 18.237 16.484 17.9144 17.1992 17.1993C17.9143 16.4841 18.2369 15.5739 18.3911 14.4267C18.5416 13.3072 18.5416 11.8733 18.5416 10.0477V9.9524C18.5416 8.12682 18.5416 6.6929 18.3911 5.57339C18.2369 4.42618 17.9143 3.51597 17.1992 2.8008C16.484 2.08564 15.5738 1.76311 14.4266 1.60887C13.3071 1.45835 11.8732 1.45836 10.0476 1.45837ZM3.68456 3.68469C4.12877 3.24048 4.73123 2.98333 5.73983 2.84772C6.76641 2.7097 8.11627 2.70837 9.99992 2.70837C11.8836 2.70837 13.2334 2.7097 14.26 2.84772C15.2686 2.98333 15.8711 3.24048 16.3153 3.68469C16.7595 4.12889 17.0166 4.73135 17.1522 5.73995C17.2903 6.76654 17.2916 8.1164 17.2916 10C17.2916 11.8837 17.2903 13.2335 17.1522 14.2601C17.0166 15.2687 16.7595 15.8712 16.3153 16.3154C15.8711 16.7596 15.2686 17.0168 14.26 17.1524C13.2334 17.2904 11.8836 17.2917 9.99992 17.2917C8.11627 17.2917 6.76641 17.2904 5.73983 17.1524C4.73123 17.0168 4.12877 16.7596 3.68456 16.3154C3.24036 15.8712 2.9832 15.2687 2.8476 14.2601C2.70958 13.2335 2.70825 11.8837 2.70825 10C2.70825 8.1164 2.70958 6.76654 2.8476 5.73995C2.9832 4.73135 3.24036 4.12889 3.68456 3.68469Z" fill="#2B353E"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
@ -0,0 +1,3 @@
|
||||
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.0001 30.3333C8.084 30.3333 1.66675 23.916 1.66675 16C1.66675 8.08388 8.084 1.66663 16.0001 1.66663C23.9162 1.66663 30.3334 8.08388 30.3334 16C30.3334 23.916 23.9162 30.3333 16.0001 30.3333ZM3.66675 16C3.66675 22.8115 9.18857 28.3333 16.0001 28.3333C19.0459 28.3333 21.8338 27.2292 23.9854 25.3995L6.60053 8.01462C4.7708 10.1663 3.66675 12.9542 3.66675 16ZM25.3996 23.9853C27.2294 21.8336 28.3334 19.0457 28.3334 16C28.3334 9.18845 22.8116 3.66663 16.0001 3.66663C12.9543 3.66663 10.1664 4.77068 8.01474 6.60041L25.3996 23.9853Z" fill="#ADADAD"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 702 B |
@ -1,11 +1,33 @@
|
||||
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_chief_complaint.dart';
|
||||
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/empty_complaints.dart';
|
||||
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// class CheifComplaints extends StatelessWidget{
|
||||
// final List<String> complaints;
|
||||
//
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
class UpdateChiefComplaints extends StatelessWidget {
|
||||
final List<String> complaints;
|
||||
|
||||
const UpdateChiefComplaints({Key? key, required this.complaints})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
AddChiefComplaint(
|
||||
onAddCheifComplaintClicked: () {},
|
||||
),
|
||||
if (complaints.isEmpty) ...{
|
||||
EmptyComplaints()
|
||||
} else ...{
|
||||
ListView.builder(
|
||||
itemBuilder: (_, index) => ComplaintItems(complaints[index], onCrossClicked:(){
|
||||
|
||||
}))
|
||||
}
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,31 @@
|
||||
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
||||
class AddChiefComplaint extends StatelessWidget{
|
||||
final VoidCallback onAddCheifComplaintClicked;
|
||||
|
||||
const AddChiefComplaint({super.key, required this.onAddCheifComplaintClicked});
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: AppButton(
|
||||
icon: SvgPicture.asset('assets/images/svgs/add-square.svg'),
|
||||
title: TranslationBase.of(context).previous,
|
||||
color: Colors.grey[300]!,
|
||||
fontColor: Colors.black,
|
||||
fontWeight: FontWeight.w600,
|
||||
disabled: true,
|
||||
onPressed: () async {
|
||||
onAddCheifComplaintClicked();
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
// import 'package:flutter/material.dart';
|
||||
//
|
||||
// class ComplaintItems extends StatelessWidget{
|
||||
//
|
||||
// }
|
||||
@ -0,0 +1,25 @@
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
||||
import '../../../../../../../utils/translations_delegate_base_utils.dart';
|
||||
|
||||
class EmptyComplaints extends StatelessWidget{
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
mainAxisAlignment : MainAxisAlignment.center,
|
||||
children: [
|
||||
SvgPicture.asset('assets/images/svgs/unavailable.svg'),
|
||||
SizedBox(height: 10,),
|
||||
AppText(
|
||||
TranslationBase.of(context).noComplaintsFound,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Color(0xFFADADAD),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,274 @@
|
||||
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/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_history.dart';
|
||||
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart';
|
||||
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart';
|
||||
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart';
|
||||
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart';
|
||||
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart';
|
||||
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjective_call_back.dart';
|
||||
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
|
||||
import 'package:doctor_app_flutter/utils/utils.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'chief_complaint/chief_complaints.dart';
|
||||
|
||||
|
||||
|
||||
class UpdateSubjectivePage extends StatefulWidget {
|
||||
final Function changePageViewIndex;
|
||||
final Function changeLoadingState;
|
||||
final PatiantInformtion patientInfo;
|
||||
final int currentIndex;
|
||||
|
||||
UpdateSubjectivePage({Key? key, required this.changePageViewIndex, required this.patientInfo, required this.changeLoadingState, required this.currentIndex});
|
||||
|
||||
@override
|
||||
_UpdateSubjectivePageState createState() => _UpdateSubjectivePageState();
|
||||
}
|
||||
|
||||
class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements SubjectiveCallBack {
|
||||
bool isChiefExpand = false;
|
||||
bool isHistoryExpand = false;
|
||||
bool isAllergiesExpand = false;
|
||||
TextEditingController illnessController = TextEditingController();
|
||||
TextEditingController complaintsController = TextEditingController();
|
||||
TextEditingController medicationController = TextEditingController();
|
||||
|
||||
final formKey = GlobalKey<FormState>();
|
||||
List<MySelectedAllergy> myAllergiesList = [];
|
||||
List<MySelectedHistory> myHistoryList = [];
|
||||
|
||||
getHistory(SOAPViewModel model) async {
|
||||
widget.changeLoadingState(true);
|
||||
if (model.patientHistoryList.isNotEmpty) {
|
||||
model.patientHistoryList.forEach((element) {
|
||||
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);
|
||||
myHistoryList.add(mySelectedHistory);
|
||||
}
|
||||
}
|
||||
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);
|
||||
myHistoryList.add(mySelectedHistory);
|
||||
}
|
||||
}
|
||||
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);
|
||||
myHistoryList.add(mySelectedHistory);
|
||||
}
|
||||
}
|
||||
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);
|
||||
myHistoryList.add(mySelectedHistory);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
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? selectedAllergySeverity;
|
||||
if (element.severity == 0) {
|
||||
selectedAllergySeverity = MasterKeyModel(id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: '');
|
||||
} else {
|
||||
selectedAllergySeverity = model.getOneMasterKey(
|
||||
masterKeys: MasterKeysService.AllergySeverity,
|
||||
id: element.severity,
|
||||
)!;
|
||||
}
|
||||
|
||||
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<SOAPViewModel>(
|
||||
onModelReady: (model) async {
|
||||
myAllergiesList.clear();
|
||||
myHistoryList.clear();
|
||||
model.setSubjectiveCallBack(this);
|
||||
await model.onUpdateSubjectStepStart(widget.patientInfo);
|
||||
|
||||
if (model.patientChiefComplaintList.isNotEmpty) {
|
||||
isChiefExpand = true;
|
||||
complaintsController.text = Utils.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint!);
|
||||
illnessController.text = model.patientChiefComplaintList[0].hopi!;
|
||||
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);
|
||||
|
||||
await getAllergies(model);
|
||||
}
|
||||
|
||||
widget.changeLoadingState(false);
|
||||
},
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
isShowAppBar: false,
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
body: SingleChildScrollView(
|
||||
physics: ScrollPhysics(),
|
||||
child: Center(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.9,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SOAPStepHeader(
|
||||
currentIndex: widget.currentIndex,
|
||||
changePageViewIndex: widget.changePageViewIndex,
|
||||
patientInfo: widget.patientInfo,
|
||||
),
|
||||
ExpandableSOAPWidget(
|
||||
headerTitle: TranslationBase.of(context).chiefComplaints,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isChiefExpand = !isChiefExpand;
|
||||
});
|
||||
},
|
||||
child: UpdateChiefComplaints(
|
||||
complaints: [],
|
||||
),
|
||||
isExpanded: isChiefExpand,
|
||||
),
|
||||
SizedBox(
|
||||
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 4 : 2),
|
||||
),
|
||||
if (widget.patientInfo.admissionNo == null)
|
||||
ExpandableSOAPWidget(
|
||||
headerTitle: TranslationBase.of(context).histories,
|
||||
isRequired: false,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isHistoryExpand = !isHistoryExpand;
|
||||
});
|
||||
},
|
||||
child: Column(
|
||||
children: [UpdateHistoryWidget(myHistoryList: myHistoryList)],
|
||||
),
|
||||
isExpanded: isHistoryExpand,
|
||||
),
|
||||
SizedBox(
|
||||
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 4 : 2),
|
||||
),
|
||||
if (widget.patientInfo.admissionNo == null)
|
||||
ExpandableSOAPWidget(
|
||||
headerTitle: TranslationBase.of(context).allergiesSoap,
|
||||
isRequired: false,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isAllergiesExpand = !isAllergiesExpand;
|
||||
});
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
UpdateAllergiesWidget(
|
||||
myAllergiesList: myAllergiesList,
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
],
|
||||
),
|
||||
isExpanded: isAllergiesExpand,
|
||||
),
|
||||
SizedBox(
|
||||
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 20 : 10),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
addSubjectiveInfo({required SOAPViewModel model, required List<MySelectedAllergy> myAllergiesList, required List<MySelectedHistory> myHistoryList}) async {
|
||||
if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus();
|
||||
widget.changeLoadingState(true);
|
||||
formKey.currentState!.save();
|
||||
formKey.currentState!.validate();
|
||||
|
||||
model.complaintsControllerError = '';
|
||||
model.medicationControllerError = '';
|
||||
model.illnessControllerError = '';
|
||||
if (complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty) {
|
||||
await model.postSubjectServices(
|
||||
patientInfo: widget.patientInfo,
|
||||
complaintsText: complaintsController.text,
|
||||
medicationText: medicationController.text,
|
||||
illnessText: illnessController.text,
|
||||
myHistoryList: myHistoryList,
|
||||
myAllergiesList: myAllergiesList,
|
||||
);
|
||||
|
||||
widget.changeLoadingState(true);
|
||||
|
||||
widget.changePageViewIndex(1);
|
||||
} else {
|
||||
setState(() {
|
||||
if (complaintsController.text.isEmpty) {
|
||||
model.complaintsControllerError = TranslationBase.of(context).emptyMessage;
|
||||
}
|
||||
|
||||
if (illnessController.text.isEmpty) {
|
||||
model.illnessControllerError = TranslationBase.of(context).emptyMessage;
|
||||
}
|
||||
|
||||
if (medicationController.text.isEmpty) {
|
||||
model.medicationControllerError = TranslationBase.of(context).emptyMessage;
|
||||
}
|
||||
});
|
||||
|
||||
widget.changeLoadingState(false);
|
||||
Utils.showErrorToast(TranslationBase.of(context).chiefComplaintErrorMsg);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Function nextFunction(model) {
|
||||
addSubjectiveInfo(model: model, myAllergiesList: myAllergiesList.where((i) => i.isChecked).toList(), myHistoryList: myHistoryList);
|
||||
return () {};
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue