send method

Future<void> send(
  1. String sessionId,
  2. int status
)

Implementation

Future<void> send(String sessionId, int status) async {
  Header header = Header();
  HCP? hcp;
  await DocereeAd().getHCPData().then((value) => hcp = value);
  String? uid = "";
  await header.getDeviceId().then((value) => uid = value);
  var url = Uri.parse("${Network.getBaseUrl()}${Network.patientSessionUrl}?uid=$uid&sid=$sessionId&hid=${hcp?.hcpId}&status=$status&eType=4");

  try {
    // Make the GET request
    var response = await http.get(url);
    if (response.statusCode == 200) {
      // Request was successful
      Log("PatientSessionApi").i('Status: ${response.statusCode}');
    } else {
      // Request failed
      Log("PatientSessionApi").i('Status: ${response.statusCode}');
    }
  } catch (e) {
    Log("PatientSessionApi").i('Error: $e');
  }
}