Inpatient services contd.
parent
a8ba6c9f3c
commit
4901163b7c
@ -0,0 +1,71 @@
|
||||
class InPatientAdvanceHistoryResponseModel {
|
||||
int? advanceNumber;
|
||||
int? errorCode;
|
||||
String? message;
|
||||
List<ResponseInpatientAdvanceInfo>? responseInpatientAdvanceInfo;
|
||||
int? statusCode;
|
||||
|
||||
InPatientAdvanceHistoryResponseModel({this.advanceNumber, this.errorCode, this.message, this.responseInpatientAdvanceInfo, this.statusCode});
|
||||
|
||||
InPatientAdvanceHistoryResponseModel.fromJson(Map<String, dynamic> json) {
|
||||
advanceNumber = json['advanceNumber'];
|
||||
errorCode = json['errorCode'];
|
||||
message = json['message'];
|
||||
if (json['responseInpatientAdvanceInfo'] != null) {
|
||||
responseInpatientAdvanceInfo = <ResponseInpatientAdvanceInfo>[];
|
||||
json['responseInpatientAdvanceInfo'].forEach((v) {
|
||||
responseInpatientAdvanceInfo!.add(new ResponseInpatientAdvanceInfo.fromJson(v));
|
||||
});
|
||||
}
|
||||
statusCode = json['statusCode'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['advanceNumber'] = this.advanceNumber;
|
||||
data['errorCode'] = this.errorCode;
|
||||
data['message'] = this.message;
|
||||
if (this.responseInpatientAdvanceInfo != null) {
|
||||
data['responseInpatientAdvanceInfo'] = this.responseInpatientAdvanceInfo!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['statusCode'] = this.statusCode;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class ResponseInpatientAdvanceInfo {
|
||||
int? admissionNo;
|
||||
int? admissionReqNo;
|
||||
String? createdOn;
|
||||
int? patientId;
|
||||
int? projectId;
|
||||
num? requestedAmount;
|
||||
String? setupId;
|
||||
int? status;
|
||||
|
||||
ResponseInpatientAdvanceInfo({this.admissionNo, this.admissionReqNo, this.createdOn, this.patientId, this.projectId, this.requestedAmount, this.setupId, this.status});
|
||||
|
||||
ResponseInpatientAdvanceInfo.fromJson(Map<String, dynamic> json) {
|
||||
admissionNo = json['admissionNo'];
|
||||
admissionReqNo = json['admissionReqNo'];
|
||||
createdOn = json['createdOn'];
|
||||
patientId = json['patientId'];
|
||||
projectId = json['projectId'];
|
||||
requestedAmount = json['requestedAmount'];
|
||||
setupId = json['setupId'];
|
||||
status = json['status'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['admissionNo'] = this.admissionNo;
|
||||
data['admissionReqNo'] = this.admissionReqNo;
|
||||
data['createdOn'] = this.createdOn;
|
||||
data['patientId'] = this.patientId;
|
||||
data['projectId'] = this.projectId;
|
||||
data['requestedAmount'] = this.requestedAmount;
|
||||
data['setupId'] = this.setupId;
|
||||
data['status'] = this.status;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,74 @@
|
||||
class InPatientAdvanceResponseModel {
|
||||
int? advanceNumber;
|
||||
Null errorCode;
|
||||
String? message;
|
||||
List<ResponseInpatientAdvanceInfo>? responseInpatientAdvanceInfo;
|
||||
int? statusCode;
|
||||
|
||||
InPatientAdvanceResponseModel({this.advanceNumber, this.errorCode, this.message, this.responseInpatientAdvanceInfo, this.statusCode});
|
||||
|
||||
InPatientAdvanceResponseModel.fromJson(Map<String, dynamic> json) {
|
||||
advanceNumber = json['advanceNumber'];
|
||||
errorCode = json['errorCode'];
|
||||
message = json['message'];
|
||||
if (json['responseInpatientAdvanceInfo'] != null) {
|
||||
responseInpatientAdvanceInfo = <ResponseInpatientAdvanceInfo>[];
|
||||
json['responseInpatientAdvanceInfo'].forEach((v) {
|
||||
responseInpatientAdvanceInfo!.add(new ResponseInpatientAdvanceInfo.fromJson(v));
|
||||
});
|
||||
}
|
||||
statusCode = json['statusCode'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['advanceNumber'] = this.advanceNumber;
|
||||
data['errorCode'] = this.errorCode;
|
||||
data['message'] = this.message;
|
||||
if (this.responseInpatientAdvanceInfo != null) {
|
||||
data['responseInpatientAdvanceInfo'] = this.responseInpatientAdvanceInfo!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['statusCode'] = this.statusCode;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class ResponseInpatientAdvanceInfo {
|
||||
int? admissionNo;
|
||||
int? admissionReqNo;
|
||||
String? createdOn;
|
||||
int? patientId;
|
||||
int? projectId;
|
||||
num? requestedAmount;
|
||||
String? setupId;
|
||||
int? status;
|
||||
int? paymentRequestID;
|
||||
|
||||
ResponseInpatientAdvanceInfo({this.admissionNo, this.admissionReqNo, this.createdOn, this.patientId, this.projectId, this.requestedAmount, this.setupId, this.status, this.paymentRequestID});
|
||||
|
||||
ResponseInpatientAdvanceInfo.fromJson(Map<String, dynamic> json) {
|
||||
admissionNo = json['admissionNo'];
|
||||
admissionReqNo = json['admissionReqNo'];
|
||||
createdOn = json['createdOn'];
|
||||
patientId = json['patientId'];
|
||||
projectId = json['projectId'];
|
||||
requestedAmount = json['requestedAmount'];
|
||||
setupId = json['setupId'];
|
||||
status = json['status'];
|
||||
paymentRequestID = json['PaymentRequestId'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['admissionNo'] = this.admissionNo;
|
||||
data['admissionReqNo'] = this.admissionReqNo;
|
||||
data['createdOn'] = this.createdOn;
|
||||
data['patientId'] = this.patientId;
|
||||
data['projectId'] = this.projectId;
|
||||
data['requestedAmount'] = this.requestedAmount;
|
||||
data['setupId'] = this.setupId;
|
||||
data['status'] = this.status;
|
||||
data['PaymentRequestId'] = this.paymentRequestID;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
class GetMedicalInstructions {
|
||||
dynamic propertyChanged;
|
||||
int? admissionRequestNoField;
|
||||
String? clinicNameField;
|
||||
String? doctorNameField;
|
||||
String? expectedAdmissionDateField;
|
||||
List<MedicaLInstructionsField>? medicaLInstructionsField;
|
||||
dynamic medicalInstructionsXMLField;
|
||||
String? medicalRemarksField;
|
||||
int? projectIdField;
|
||||
String? projectNameField;
|
||||
String? setupIdField;
|
||||
|
||||
GetMedicalInstructions(
|
||||
{this.propertyChanged,
|
||||
this.admissionRequestNoField,
|
||||
this.clinicNameField,
|
||||
this.doctorNameField,
|
||||
this.expectedAdmissionDateField,
|
||||
this.medicaLInstructionsField,
|
||||
this.medicalInstructionsXMLField,
|
||||
this.medicalRemarksField,
|
||||
this.projectIdField,
|
||||
this.projectNameField,
|
||||
this.setupIdField});
|
||||
|
||||
GetMedicalInstructions.fromJson(Map<String, dynamic> json) {
|
||||
propertyChanged = json['PropertyChanged'];
|
||||
admissionRequestNoField = json['admissionRequestNoField'];
|
||||
clinicNameField = json['clinicNameField'];
|
||||
doctorNameField = json['doctorNameField'];
|
||||
expectedAdmissionDateField = json['expectedAdmissionDateField'];
|
||||
if (json['medicaLInstructions'] != null) {
|
||||
medicaLInstructionsField = <MedicaLInstructionsField>[];
|
||||
json['medicaLInstructions'].forEach((v) {
|
||||
medicaLInstructionsField!.add(new MedicaLInstructionsField.fromJson(v));
|
||||
});
|
||||
}
|
||||
medicalInstructionsXMLField = json['medicalInstructionsXMLField'];
|
||||
medicalRemarksField = json['medicalRemarksField'];
|
||||
projectIdField = json['projectIdField'];
|
||||
projectNameField = json['projectNameField'];
|
||||
setupIdField = json['setupIdField'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['PropertyChanged'] = this.propertyChanged;
|
||||
data['admissionRequestNoField'] = this.admissionRequestNoField;
|
||||
data['clinicNameField'] = this.clinicNameField;
|
||||
data['doctorNameField'] = this.doctorNameField;
|
||||
data['expectedAdmissionDateField'] = this.expectedAdmissionDateField;
|
||||
if (this.medicaLInstructionsField != null) {
|
||||
data['medicaLInstructionsField'] = this.medicaLInstructionsField!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['medicalInstructionsXMLField'] = this.medicalInstructionsXMLField;
|
||||
data['medicalRemarksField'] = this.medicalRemarksField;
|
||||
data['projectIdField'] = this.projectIdField;
|
||||
data['projectNameField'] = this.projectNameField;
|
||||
data['setupIdField'] = this.setupIdField;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class MedicaLInstructionsField {
|
||||
Null propertyChanged;
|
||||
String? descriptionField;
|
||||
int? parameterCodeField;
|
||||
|
||||
MedicaLInstructionsField({this.propertyChanged, this.descriptionField, this.parameterCodeField});
|
||||
|
||||
MedicaLInstructionsField.fromJson(Map<String, dynamic> json) {
|
||||
propertyChanged = json['PropertyChanged'];
|
||||
descriptionField = json['description'];
|
||||
parameterCodeField = json['parameterCodeField'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['PropertyChanged'] = this.propertyChanged;
|
||||
data['descriptionField'] = this.descriptionField;
|
||||
data['parameterCodeField'] = this.parameterCodeField;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
|
||||
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
|
||||
import 'package:hmg_patient_app_new/features/inpatient_services/inpatient_services_view_model.dart';
|
||||
import 'package:hmg_patient_app_new/generated/codegen_loader.g.dart';
|
||||
import 'package:hmg_patient_app_new/theme/colors.dart';
|
||||
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
|
||||
import 'package:hmg_patient_app_new/widgets/custom_tab_bar.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class InpatientAdvancePaymentPage extends StatelessWidget {
|
||||
const InpatientAdvancePaymentPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.bgScaffoldColor,
|
||||
body: CollapsingListView(
|
||||
title: LocaleKeys.advancePayment.tr(),
|
||||
child: Consumer<InpatientServicesViewModel>(builder: (context, inpatientServicesVM, child) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(height: 16.h),
|
||||
CustomTabBar(
|
||||
activeTextColor: Color(0xffED1C2B),
|
||||
activeBackgroundColor: Color(0xffED1C2B).withValues(alpha: .1),
|
||||
initialIndex: 0,
|
||||
tabs: [
|
||||
CustomTabBarModel(null, LocaleKeys.requests.tr(context: context)),
|
||||
CustomTabBarModel(null, LocaleKeys.history.tr(context: context)),
|
||||
],
|
||||
onTabChange: (index) {
|
||||
inpatientServicesVM.onTabChanged(index);
|
||||
},
|
||||
).paddingSymmetrical(24.h, 0.h),
|
||||
SizedBox(height: 24.h),
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
|
||||
import 'package:hmg_patient_app_new/core/utils/utils.dart';
|
||||
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
|
||||
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
|
||||
import 'package:hmg_patient_app_new/features/inpatient_services/inpatient_services_view_model.dart';
|
||||
import 'package:hmg_patient_app_new/theme/colors.dart';
|
||||
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class MedicalInstructionsPage extends StatelessWidget {
|
||||
const MedicalInstructionsPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.bgScaffoldColor,
|
||||
body: CollapsingListView(
|
||||
title: "Medical Instructions",
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(24.h),
|
||||
child: Container(
|
||||
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
||||
color: AppColors.whiteColor,
|
||||
borderRadius: 24.r,
|
||||
hasShadow: true,
|
||||
),
|
||||
child: Consumer<InpatientServicesViewModel>(builder: (context, inpatientServicesVM, child) {
|
||||
return inpatientServicesVM.isMedicalInstructionsLoading
|
||||
? ListView.builder(
|
||||
padding: EdgeInsets.zero,
|
||||
shrinkWrap: true,
|
||||
itemCount: 5,
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
"Lorem <i>ipsum dolor sit</i> amet, consectetur <b>adipiscing elit</b>".toText16().toShimmer2(),
|
||||
SizedBox(
|
||||
height: 16.h,
|
||||
),
|
||||
],
|
||||
).paddingSymmetrical(24.h, 16.h);
|
||||
},
|
||||
)
|
||||
: inpatientServicesVM.getMedicalInstructionsList.first.medicaLInstructionsField!.isNotEmpty
|
||||
? ListView.builder(
|
||||
padding: EdgeInsets.zero,
|
||||
shrinkWrap: true,
|
||||
itemCount: inpatientServicesVM.getMedicalInstructionsList.first.medicaLInstructionsField!.length,
|
||||
itemBuilder: (context, index) {
|
||||
final instruction = inpatientServicesVM.getMedicalInstructionsList.first.medicaLInstructionsField![index];
|
||||
return "• ${instruction.descriptionField}".toText16(weight: FontWeight.w500).paddingSymmetrical(24.h, 16.h);
|
||||
},
|
||||
)
|
||||
: Utils.getNoDataWidget(context);
|
||||
}),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,103 @@
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
||||
import 'package:hmg_patient_app_new/core/app_state.dart';
|
||||
import 'package:hmg_patient_app_new/core/dependencies.dart';
|
||||
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
|
||||
import 'package:hmg_patient_app_new/core/utils/utils.dart';
|
||||
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
|
||||
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
|
||||
import 'package:hmg_patient_app_new/features/inpatient_services/inpatient_services_view_model.dart';
|
||||
import 'package:hmg_patient_app_new/services/navigation_service.dart';
|
||||
import 'package:hmg_patient_app_new/theme/colors.dart';
|
||||
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
|
||||
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
|
||||
import 'package:hmg_patient_app_new/widgets/input_widget.dart';
|
||||
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
|
||||
|
||||
import '../../../generated/locale_keys.g.dart';
|
||||
|
||||
class PatientRelationOfficeWidget extends StatelessWidget {
|
||||
PatientRelationOfficeWidget({super.key, required this.inPatientServicesViewModel});
|
||||
|
||||
InpatientServicesViewModel inPatientServicesViewModel;
|
||||
final TextEditingController notesTextController = TextEditingController();
|
||||
late AppState appState;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
appState = getIt.get<AppState>();
|
||||
return Padding(
|
||||
padding: EdgeInsets.all(16.h),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
"How we may assist you?".toText16(isBold: true),
|
||||
SizedBox(
|
||||
height: 16.h,
|
||||
),
|
||||
TextInputWidget(
|
||||
padding: EdgeInsets.all(8.h),
|
||||
labelText: LocaleKeys.details.tr(context: context),
|
||||
hintText: "",
|
||||
controller: notesTextController,
|
||||
keyboardType: TextInputType.text,
|
||||
isEnable: true,
|
||||
prefix: null,
|
||||
autoFocus: true,
|
||||
isAllowRadius: true,
|
||||
isBorderAllowed: false,
|
||||
isAllowLeadingIcon: true,
|
||||
leadingIcon: AppAssets.notes_icon,
|
||||
hasError: false,
|
||||
errorMessage: "",
|
||||
),
|
||||
SizedBox(
|
||||
height: 24.h,
|
||||
),
|
||||
CustomButton(
|
||||
text: LocaleKeys.send.tr(context: context),
|
||||
onPressed: () {
|
||||
LoaderBottomSheet.showLoader();
|
||||
inPatientServicesViewModel.insertInPatientOrder(
|
||||
getAdmissionInfoResponseModel: inPatientServicesViewModel.getAdmissionInfoResponseModel!,
|
||||
typeID: 1,
|
||||
patientName: "${appState.getAuthenticatedUser()!.firstName!} ${appState.getAuthenticatedUser()!.lastName!}",
|
||||
patientNameAR: "${appState.getAuthenticatedUser()!.firstNameN!} ${appState.getAuthenticatedUser()!.lastNameN!}",
|
||||
patientMobileNo: appState.getAuthenticatedUser()!.mobileNumber!,
|
||||
comments: notesTextController.text,
|
||||
onError: (String errorMessage) {
|
||||
LoaderBottomSheet.hideLoader();
|
||||
showCommonBottomSheetWithoutHeight(GetIt.instance<NavigationService>().navigatorKey.currentContext!,
|
||||
child: Utils.getErrorWidget(loadingText: errorMessage).paddingSymmetrical(0.h, 24.h),
|
||||
callBackFunc: () {},
|
||||
isFullScreen: false,
|
||||
isCloseButtonVisible: false,
|
||||
isAutoDismiss: true);
|
||||
},
|
||||
onSuccess: (val) {
|
||||
LoaderBottomSheet.hideLoader();
|
||||
showCommonBottomSheetWithoutHeight(GetIt.instance<NavigationService>().navigatorKey.currentContext!,
|
||||
child: Utils.getSuccessWidget(loadingText: LocaleKeys.requestSubmittedSuccessfully.tr()).paddingSymmetrical(0.h, 24.h), callBackFunc: () {
|
||||
Navigator.of(context).pop();
|
||||
}, isFullScreen: false, isCloseButtonVisible: false, isAutoDismiss: true);
|
||||
});
|
||||
},
|
||||
backgroundColor: AppColors.primaryRedColor,
|
||||
borderColor: AppColors.primaryRedColor,
|
||||
textColor: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
borderRadius: 12,
|
||||
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
||||
height: 50.h,
|
||||
icon: AppAssets.sendEmailIcon,
|
||||
iconColor: Colors.white,
|
||||
iconSize: 18.h,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue