completed the demo

faiz_dev
faizatflutter 3 days ago
parent 864b19d166
commit bcbdbb295d

@ -210,9 +210,9 @@ class ApiClientImp implements ApiClient {
body['TokenID'] = "@dm!n"; body['TokenID'] = "@dm!n";
} }
body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// body['PatientID'] = 6424682; // body['PatientID'] = 6424682;
body['PatientID'] = 4770714; // body['PatientID'] = 4772785;
// body['PatientID'] = 4771727; // body['PatientID'] = 4771727;
// body['PatientID'] = 3648831; // body['PatientID'] = 3648831;
// body['PatientID'] = 89754444; // body['PatientID'] = 89754444;
@ -263,7 +263,7 @@ class ApiClientImp implements ApiClient {
body: requestBody, body: requestBody,
headers: headers, headers: headers,
); );
// log("response: ${response.body.toString()}"); log("response: ${response.body.toString()}");
} on SocketException catch (e) { } on SocketException catch (e) {
final message = e.message.contains('Connection reset by peer') ? LocaleKeys.networkConnectionReset.tr() : LocaleKeys.networkErrorMessage.tr(); final message = e.message.contains('Connection reset by peer') ? LocaleKeys.networkConnectionReset.tr() : LocaleKeys.networkErrorMessage.tr();
onFailure(message, -1, failureType: ConnectivityFailure(message)); onFailure(message, -1, failureType: ConnectivityFailure(message));

@ -289,6 +289,7 @@ class ApiConsts {
static String submitRefund = "Services/COCWS.svc/REST/SubmitRefund"; static String submitRefund = "Services/COCWS.svc/REST/SubmitRefund";
static String isRefundableInvoice = "Services/Outps.svc/REST/isRefundableInvoice"; static String isRefundableInvoice = "Services/Outps.svc/REST/isRefundableInvoice";
static String getThresholdAmount = "Services/OUTPs.svc/REST/HIS_getThresholdAmount"; static String getThresholdAmount = "Services/OUTPs.svc/REST/HIS_getThresholdAmount";
static String checkIfPatientAdmitted = 'Services/Inps.svc/REST/checkIsPatientAdmittedOrAdmissionRequest';
static String getAiAnalysisURL = "https://api.labpredict.com"; static String getAiAnalysisURL = "https://api.labpredict.com";
static String getAiRadiologyAnalysis = "$getAiAnalysisURL/radiology"; static String getAiRadiologyAnalysis = "$getAiAnalysisURL/radiology";
@ -922,8 +923,6 @@ var PAYFORT_PROD_URL = 'https://paymentservices.payfort.com/FortAPI/paymentApi';
// Check If InPatient API // Check If InPatient API
var CHECK_IF_INPATIENT = 'Services/Patients.svc/REST/GetInPatientAdmissionInfo'; var CHECK_IF_INPATIENT = 'Services/Patients.svc/REST/GetInPatientAdmissionInfo';
var CHECK_IF_PATIENT_ADMITTED = 'Services/Inps.svc/REST/checkIsPatientAdmittedOrAdmissionRequest';
// Get General Instructions API // Get General Instructions API
var GET_GENERAL_INSTRUCTIONS = 'Services/INPs.svc/REST/getGeneralInstructions'; var GET_GENERAL_INSTRUCTIONS = 'Services/INPs.svc/REST/getGeneralInstructions';

@ -13,7 +13,12 @@ abstract class HabibWalletRepo {
Future<Either<Failure, GenericApiModel<List<HospitalsModel>>>> getProjectList(); Future<Either<Failure, GenericApiModel<List<HospitalsModel>>>> getProjectList();
Future<Either<Failure, GenericApiModel<dynamic>>> HISCreateAdvancePayment( Future<Either<Failure, GenericApiModel<dynamic>>> HISCreateAdvancePayment(
{required String paymentMethodName, required num paidAmount, required String paymentReference, required String patientID, required int projectID, required String depositorName}); {required String paymentMethodName,
required num paidAmount,
required String paymentReference,
required String patientID,
required int projectID,
required String depositorName});
Future<Either<Failure, GenericApiModel<dynamic>>> addAdvanceNumberRequest({required String advanceNumber, required String paymentReference}); Future<Either<Failure, GenericApiModel<dynamic>>> addAdvanceNumberRequest({required String advanceNumber, required String paymentReference});
@ -52,7 +57,10 @@ class HabibWalletRepoImp implements HabibWalletRepo {
// throw Exception("lab list is empty"); // throw Exception("lab list is empty");
// } // }
final List<PatientAdvanceBalanceResponseModel> balanceAmountList = list.map((item) => PatientAdvanceBalanceResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<PatientAdvanceBalanceResponseModel>(); final List<PatientAdvanceBalanceResponseModel> balanceAmountList = list
.map((item) => PatientAdvanceBalanceResponseModel.fromJson(item as Map<String, dynamic>))
.toList()
.cast<PatientAdvanceBalanceResponseModel>();
for (var element in balanceAmountList) { for (var element in balanceAmountList) {
element.totalAmount = response['TotalAdvanceBalanceAmount']; element.totalAmount = response['TotalAdvanceBalanceAmount'];
@ -117,7 +125,12 @@ class HabibWalletRepoImp implements HabibWalletRepo {
@override @override
Future<Either<Failure, GenericApiModel>> HISCreateAdvancePayment( Future<Either<Failure, GenericApiModel>> HISCreateAdvancePayment(
{required String paymentMethodName, required num paidAmount, required String paymentReference, required String patientID, required int projectID, required String depositorName}) async { {required String paymentMethodName,
required num paidAmount,
required String paymentReference,
required String patientID,
required int projectID,
required String depositorName}) async {
Map<String, dynamic> request = { Map<String, dynamic> request = {
"CustName": depositorName, "CustName": depositorName,
"CustID": patientID, "CustID": patientID,
@ -319,7 +332,7 @@ class HabibWalletRepoImp implements HabibWalletRepo {
GenericApiModel<dynamic>? apiResponse; GenericApiModel<dynamic>? apiResponse;
Failure? failure; Failure? failure;
await apiClient.post( await apiClient.post(
CHECK_IF_PATIENT_ADMITTED, ApiConsts.checkIfPatientAdmitted,
body: requestBody, body: requestBody,
onFailure: (error, statusCode, {messageStatus, failureType}) { onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType; failure = failureType;

@ -557,7 +557,12 @@ class HabibWalletViewModel extends ChangeNotifier {
Function(dynamic)? onSuccess, Function(dynamic)? onSuccess,
Function(String)? onError}) async { Function(String)? onError}) async {
final result = await habibWalletRepo.HISCreateAdvancePayment( final result = await habibWalletRepo.HISCreateAdvancePayment(
paymentMethodName: paymentMethodName, paidAmount: paidAmount, paymentReference: paymentReference, patientID: patientID, projectID: projectID, depositorName: depositorName); paymentMethodName: paymentMethodName,
paidAmount: paidAmount,
paymentReference: paymentReference,
patientID: patientID,
projectID: projectID,
depositorName: depositorName);
result.fold( result.fold(
// (failure) async => await errorHandlerService.handleError(failure: failure), // (failure) async => await errorHandlerService.handleError(failure: failure),
@ -579,7 +584,8 @@ class HabibWalletViewModel extends ChangeNotifier {
); );
} }
Future<void> addAdvanceNumberRequest({required String advanceNumber, required String paymentReference, Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> addAdvanceNumberRequest(
{required String advanceNumber, required String paymentReference, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await habibWalletRepo.addAdvanceNumberRequest(advanceNumber: advanceNumber, paymentReference: paymentReference); final result = await habibWalletRepo.addAdvanceNumberRequest(advanceNumber: advanceNumber, paymentReference: paymentReference);
result.fold( result.fold(
@ -631,7 +637,8 @@ class HabibWalletViewModel extends ChangeNotifier {
lakumAccountInfo = LakumInquiryInformationResponseModel(); lakumAccountInfo = LakumInquiryInformationResponseModel();
notifyListeners(); notifyListeners();
final result = await habibWalletRepo.getLakumAccountInformation(identificationNumber: getIt.get<AppState>().getAuthenticatedUser()!.patientIdentificationNo ?? ""); final result = await habibWalletRepo.getLakumAccountInformation(
identificationNumber: getIt.get<AppState>().getAuthenticatedUser()!.patientIdentificationNo ?? "");
result.fold( result.fold(
// (failure) async => await errorHandlerService.handleError(failure: failure), // (failure) async => await errorHandlerService.handleError(failure: failure),

@ -215,28 +215,28 @@ class InvoiceListCard extends StatelessWidget {
iconSize: 14.h, iconSize: 14.h,
), ),
), ),
// if (getInvoicesListResponseModel.isAllowRefund == true) ...[ if (getInvoicesListResponseModel.isAllowRefund == true) ...[
// SizedBox(width: 8.w), SizedBox(width: 8.w),
// Expanded( Expanded(
// child: CustomButton( child: CustomButton(
// text: LocaleKeys.requestRefund.tr(context: context), text: LocaleKeys.requestRefund.tr(context: context),
// onPressed: () { onPressed: () {
// _handleRefundInvoiceTap(context); _handleRefundInvoiceTap(context);
// }, },
// icon: AppAssets.refundIcon, icon: AppAssets.refundIcon,
// iconColor: AppColors.caloriesCalculatorColor, iconColor: AppColors.caloriesCalculatorColor,
// backgroundColor: AppColors.blueColor.withValues(alpha: 0.14), backgroundColor: AppColors.blueColor.withValues(alpha: 0.14),
// borderColor: AppColors.primaryRedColor.withValues(alpha: 0.01), borderColor: AppColors.primaryRedColor.withValues(alpha: 0.01),
// textColor: AppColors.caloriesCalculatorColor, textColor: AppColors.caloriesCalculatorColor,
// fontSize: 14.f, fontSize: 14.f,
// fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
// borderRadius: 12.r, borderRadius: 12.r,
// padding: EdgeInsets.symmetric(horizontal: 10.w), padding: EdgeInsets.symmetric(horizontal: 10.w),
// height: 40.h, height: 40.h,
// iconSize: 14.h, iconSize: 14.h,
// ), ),
// ), ),
// ] ]
], ],
), ),
], ],

@ -1,3 +1,4 @@
import 'dart:developer';
import 'dart:io'; import 'dart:io';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
@ -114,6 +115,7 @@ class _RefundRequestCreatePageState extends State<RefundRequestCreatePage> {
refundReason: !_canSelectIndividualProcedures ? "Inpatient/Package invoice" : null, refundReason: !_canSelectIndividualProcedures ? "Inpatient/Package invoice" : null,
)) ))
.toList(); .toList();
_refundRequestViewModel.setProcedures( _refundRequestViewModel.setProcedures(
procedures, procedures,
needsITGApproval: details.needITGApproval ?? false, needsITGApproval: details.needITGApproval ?? false,

Loading…
Cancel
Save