getPatientList method
Future
getPatientList(
{ - dynamic policyId,
- dynamic policyTypeId,
})
Implementation
Future getPatientList({policyId, policyTypeId}) async {
var checkStatusCode;
try {
var decodedResponse;
final response = await http.get(
Uri.parse(
'${choice_Base_Url}intimate-claims-patients-list?policy_id=${policyId}&policy_type=${policyTypeId}'),
headers: {"Authorization": choiceToken});
TokenRefresh(refreshtoken: response.headers['authorization'].toString());
checkStatusCode = response.statusCode;
decodedResponse = json.decode(response.body);
if (response.statusCode == 200) {
patientList = decodedResponse['data']['patients'];
employeeDetails = decodedResponse['data']['employee_details'];
} else {
getErrorMessage(decodedResponse['message']);
Get.back();
}
} catch (err) {
AutoLogoutThreeTry();
if (checkStatusCode == 401) {
await getPatientList(policyId: policyId, policyTypeId: policyTypeId);
(commonContext as Element).reassemble();
} else {}
}
}