remove old file get api use
This commit is contained in:
parent
8912e77b03
commit
d7e4ac134d
19 changed files with 80 additions and 109 deletions
|
|
@ -444,7 +444,7 @@ class _BuildPatientsListState extends State<BuildMyPatientListList> {
|
|||
patientManagerProvider.myPaitentList![index].app_id, context)
|
||||
.then((user) async {
|
||||
user;
|
||||
String url = await MihFileApi.getMinioFileUrl(user!.pro_pic_path);
|
||||
String url = MihFileApi.getMinioFileUrlV2(user!.pro_pic_path);
|
||||
patientManagerProvider.setSelectedPatientProfilePicUrl(url);
|
||||
});
|
||||
patientProfileChoicePopUp(
|
||||
|
|
|
|||
|
|
@ -38,16 +38,16 @@ class _BuildClaimStatementFileListState
|
|||
int progress = 0;
|
||||
late StreamSubscription progressStream;
|
||||
|
||||
Future<String> getFileUrlApiCall(String filePath) async {
|
||||
String teporaryFileUrl = "";
|
||||
await MihFileApi.getMinioFileUrl(
|
||||
filePath,
|
||||
).then((value) {
|
||||
teporaryFileUrl = value;
|
||||
});
|
||||
return teporaryFileUrl;
|
||||
}
|
||||
|
||||
// Future<String> getFileUrlApiCall(String filePath) async {
|
||||
// String teporaryFileUrl = "";
|
||||
// await MihFileApi.getMinioFileUrl(
|
||||
// filePath,
|
||||
// ).then((value) {
|
||||
// teporaryFileUrl = value;
|
||||
// });
|
||||
// return teporaryFileUrl;
|
||||
// }
|
||||
//
|
||||
String getFileName(String path) {
|
||||
//print(pdfLink.split(".")[1]);
|
||||
return path.split("/").last;
|
||||
|
|
@ -282,14 +282,13 @@ class _BuildClaimStatementFileListState
|
|||
onTap: () async {
|
||||
MihFileViewerProvider fileViewerProvider =
|
||||
context.read<MihFileViewerProvider>();
|
||||
await getFileUrlApiCall(patientManagerProvider
|
||||
.patientClaimsDocuments![index].file_path)
|
||||
.then((urlHere) {
|
||||
//print(url);
|
||||
fileViewerProvider.setFilePath(patientManagerProvider
|
||||
.patientClaimsDocuments![index].file_path);
|
||||
fileViewerProvider.setFileLink(urlHere);
|
||||
});
|
||||
String fileUrl = MihFileApi.getMinioFileUrlV2(
|
||||
patientManagerProvider
|
||||
.patientClaimsDocuments![index].file_path);
|
||||
//print(url);
|
||||
fileViewerProvider.setFilePath(patientManagerProvider
|
||||
.patientClaimsDocuments![index].file_path);
|
||||
fileViewerProvider.setFileLink(fileUrl);
|
||||
|
||||
viewFilePopUp(
|
||||
patientManagerProvider,
|
||||
|
|
|
|||
|
|
@ -38,16 +38,16 @@ class _BuildFilesListState extends State<BuildFilesList> {
|
|||
int progress = 0;
|
||||
late StreamSubscription progressStream;
|
||||
|
||||
Future<String> getFileUrlApiCall(String filePath) async {
|
||||
String teporaryFileUrl = "";
|
||||
await MihFileApi.getMinioFileUrl(
|
||||
filePath,
|
||||
).then((value) {
|
||||
teporaryFileUrl = value;
|
||||
});
|
||||
return teporaryFileUrl;
|
||||
}
|
||||
|
||||
// Future<String> getFileUrlApiCall(String filePath) async {
|
||||
// String teporaryFileUrl = "";
|
||||
// await MihFileApi.getMinioFileUrl(
|
||||
// filePath,
|
||||
// ).then((value) {
|
||||
// teporaryFileUrl = value;
|
||||
// });
|
||||
// return teporaryFileUrl;
|
||||
// }
|
||||
//
|
||||
String getFileName(String path) {
|
||||
//print(pdfLink.split(".")[1]);
|
||||
return path.split("/").last;
|
||||
|
|
@ -309,14 +309,13 @@ class _BuildFilesListState extends State<BuildFilesList> {
|
|||
onTap: () async {
|
||||
MihFileViewerProvider fileViewerProvider =
|
||||
context.read<MihFileViewerProvider>();
|
||||
await getFileUrlApiCall(patientManagerProvider
|
||||
.patientDocuments![index].file_path)
|
||||
.then((urlHere) {
|
||||
//print(url);
|
||||
fileViewerProvider.setFilePath(patientManagerProvider
|
||||
.patientDocuments![index].file_path);
|
||||
fileViewerProvider.setFileLink(urlHere);
|
||||
});
|
||||
String fileUrl = MihFileApi.getMinioFileUrlV2(
|
||||
patientManagerProvider
|
||||
.patientDocuments![index].file_path);
|
||||
//print(url);
|
||||
fileViewerProvider.setFilePath(patientManagerProvider
|
||||
.patientDocuments![index].file_path);
|
||||
fileViewerProvider.setFileLink(fileUrl);
|
||||
viewFilePopUp(
|
||||
patientManagerProvider,
|
||||
patientManagerProvider.patientDocuments![index].file_name,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_providers/mzansi_profile_provider.dart';
|
||||
|
|
@ -61,12 +62,9 @@ class _PatientDocumentsState extends State<PatientDocuments> {
|
|||
int statusCode =
|
||||
await MihPatientServices().addPatientFile(file, patientManagerProvider);
|
||||
if (statusCode == 201) {
|
||||
setState(() {
|
||||
selectedFileController.clear();
|
||||
});
|
||||
var fname = file!.name.replaceAll(RegExp(r' '), '-');
|
||||
// end loading circle
|
||||
Navigator.of(context).pop();
|
||||
context.pop();
|
||||
String message =
|
||||
"The file $fname has been successfully generated and added to ${patientManagerProvider.selectedPatient!.first_name} ${patientManagerProvider.selectedPatient!.last_name}'s record. You can now access and download it for their use.";
|
||||
successPopUp("Successfully Uplouded File", message);
|
||||
|
|
@ -77,6 +75,8 @@ class _PatientDocumentsState extends State<PatientDocuments> {
|
|||
|
||||
Future<void> uploadSelectedFile(
|
||||
PatientManagerProvider patientManagerProvider, PlatformFile? file) async {
|
||||
KenLogger.success(
|
||||
"Patient app id: ${patientManagerProvider.selectedPatient!.app_id}");
|
||||
var response = await MihFileApi.uploadFile(
|
||||
patientManagerProvider.selectedPatient!.app_id,
|
||||
env,
|
||||
|
|
@ -84,6 +84,7 @@ class _PatientDocumentsState extends State<PatientDocuments> {
|
|||
file,
|
||||
context,
|
||||
);
|
||||
KenLogger.success("Response code: $response");
|
||||
if (response == 200) {
|
||||
await addPatientFileLocationToDB(patientManagerProvider, file);
|
||||
} else {
|
||||
|
|
@ -462,6 +463,9 @@ class _PatientDocumentsState extends State<PatientDocuments> {
|
|||
onPressed: () {
|
||||
context.pop();
|
||||
context.pop();
|
||||
setState(() {
|
||||
selectedFileController.clear();
|
||||
});
|
||||
},
|
||||
buttonColor: MihColors.primary(),
|
||||
elevation: 10,
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class _PatientProfileState extends State<PatientProfile> {
|
|||
AppUser? patientUserDetails = await MihUserServices().getMIHUserDetails(
|
||||
patientManagerProvider.selectedPatient!.app_id, context);
|
||||
String patientProPicUrl =
|
||||
await MihFileApi.getMinioFileUrl(patientUserDetails!.pro_pic_path);
|
||||
MihFileApi.getMinioFileUrlV2(patientUserDetails!.pro_pic_path);
|
||||
patientManagerProvider.setSelectedPatientProfilePicUrl(patientProPicUrl);
|
||||
}
|
||||
patientManagerProvider.setPersonalMode(mzansiProfileProvider.personalHome);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue