You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
115 lines
5.1 KiB
Dart
115 lines
5.1 KiB
Dart
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
|
|
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
|
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
|
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
|
|
import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart';
|
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_screen.dart';
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
class PatientPageHeaderWidget extends StatelessWidget {
|
|
final PatiantInformtion patient;
|
|
PatientPageHeaderWidget(this.patient);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
return BaseView<SOAPViewModel>(
|
|
onModelReady: (model) async {
|
|
GeneralGetReqForSOAP generalGetReqForSOAP =
|
|
GeneralGetReqForSOAP(patientMRN: patient.patientMRN ?? patient.patientId, doctorID: '', editedBy: '');
|
|
await model.getPatientAllergy(generalGetReqForSOAP);
|
|
if (model.allergiesList.length == 0) {
|
|
await model.getMasterLookup(MasterKeysService.Allergies);
|
|
}
|
|
if (model.allergySeverityList.length == 0) {
|
|
await model.getMasterLookup(MasterKeysService.AllergySeverity);
|
|
}
|
|
},
|
|
builder: (_, model, w) => Container(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
children: [
|
|
Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: <Widget>[
|
|
AvatarWidget(
|
|
Icon(
|
|
patient.genderDescription == "Male" ? DoctorApp.male : DoctorApp.female_icon,
|
|
size: 70,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
SizedBox(
|
|
width: 20,
|
|
),
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
children: [
|
|
SizedBox(
|
|
height: 5,
|
|
),
|
|
AppText(
|
|
patient.patientDetails!.fullName != null
|
|
? patient.patientDetails!.fullName
|
|
: patient.firstName,
|
|
color: Colors.black,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
Row(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
AppText(
|
|
TranslationBase.of(context).age,
|
|
color: Colors.black,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
SizedBox(
|
|
width: 20,
|
|
),
|
|
AppText(
|
|
patient.age.toString(),
|
|
color: Colors.black,
|
|
fontWeight: FontWeight.normal,
|
|
),
|
|
],
|
|
),
|
|
model.patientAllergiesList.isNotEmpty &&
|
|
model.getAllergicNames(projectViewModel.isArabic) != ''
|
|
? AppText(
|
|
TranslationBase.of(context).allergicTO ??
|
|
"" + " : " + model.getAllergicNames(projectViewModel.isArabic),
|
|
color: Color(0xFFB9382C),
|
|
fontWeight: FontWeight.bold,
|
|
)
|
|
: AppText(''),
|
|
],
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
Container(
|
|
width: double.infinity,
|
|
height: 1,
|
|
color: Color(0xffCCCCCC),
|
|
),
|
|
SizedBox(
|
|
width: 20,
|
|
),
|
|
],
|
|
),
|
|
));
|
|
}
|
|
}
|