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