|
|
|
@ -255,6 +255,7 @@ class AppSettings {
|
|
|
|
|
static String deleteRecordUrl = host + 'deleteRecord';
|
|
|
|
|
static String deleteFindingsUrl = host + 'uploads-findings-prescription';
|
|
|
|
|
static String deletePrescriptionsUrl = host + 'uploads-prescription-prescription';
|
|
|
|
|
static String deleteReportsUrl = host + 'uploads-reports-prescription';
|
|
|
|
|
static String deleteRecordsUrl = host + 'delete-url';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1186,32 +1187,32 @@ class AppSettings {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static Future<bool> deleteFindings(fileName) async {
|
|
|
|
|
static Future<String> deleteFindings(fileName) async {
|
|
|
|
|
var uri = Uri.parse(deleteFindingsUrl + '/' + customerId+'/'+fileName);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
var response = await http.delete(uri, headers: await buildRequestHeaders());
|
|
|
|
|
|
|
|
|
|
if (response.statusCode == 200) {
|
|
|
|
|
return true;
|
|
|
|
|
return response.body;
|
|
|
|
|
} else if (response.statusCode == 401) {
|
|
|
|
|
bool status = await AppSettings.resetToken();
|
|
|
|
|
if (status) {
|
|
|
|
|
response = await http.delete(uri, headers: await buildRequestHeaders());
|
|
|
|
|
if (response.statusCode == 200) {
|
|
|
|
|
return true;
|
|
|
|
|
return response.body;
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
print(e);
|
|
|
|
|
return false;
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1244,6 +1245,64 @@ class AppSettings {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static Future<String> deleteReports(fileName) async {
|
|
|
|
|
var uri = Uri.parse(deleteReportsUrl + '/' + customerId+'/'+fileName);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
var response = await http.delete(uri, headers: await buildRequestHeaders());
|
|
|
|
|
|
|
|
|
|
if (response.statusCode == 200) {
|
|
|
|
|
return response.body;
|
|
|
|
|
} else if (response.statusCode == 401) {
|
|
|
|
|
bool status = await AppSettings.resetToken();
|
|
|
|
|
if (status) {
|
|
|
|
|
response = await http.delete(uri, headers: await buildRequestHeaders());
|
|
|
|
|
if (response.statusCode == 200) {
|
|
|
|
|
return response.body;
|
|
|
|
|
} else {
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
print(e);
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*static Future<String> deleteFindings(fileName) async {
|
|
|
|
|
var uri = Uri.parse(deletePrescriptionsUrl + '/' + customerId+'/'+fileName);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
var response = await http.delete(uri, headers: await buildRequestHeaders());
|
|
|
|
|
|
|
|
|
|
if (response.statusCode == 200) {
|
|
|
|
|
return response.body;
|
|
|
|
|
} else if (response.statusCode == 401) {
|
|
|
|
|
bool status = await AppSettings.resetToken();
|
|
|
|
|
if (status) {
|
|
|
|
|
response = await http.delete(uri, headers: await buildRequestHeaders());
|
|
|
|
|
if (response.statusCode == 200) {
|
|
|
|
|
return response.body;
|
|
|
|
|
} else {
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
print(e);
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static Future<bool> deleteRecords(payload, recordId) async {
|
|
|
|
|
var uri = Uri.parse(deleteRecordsUrl + '/' + customerId+'/'+recordId);
|
|
|
|
|