Clinical Sync Batch Engine: first commit
This commit is contained in:
@@ -32,7 +32,7 @@ public class VigilCareApiClient
|
||||
var response = await _http.PostAsJsonAsync("/api/v1/patients", req);
|
||||
response.EnsureSuccessStatusCode();
|
||||
var envelope = await response.Content.ReadFromJsonAsync<ApiResponse<PatientResponse>>();
|
||||
return envelope!.Data;
|
||||
return envelope!.Data!;
|
||||
}
|
||||
|
||||
public async Task<EncounterResponse> OpenEncounterAsync(Guid patientId, OpenEncounterRequest req)
|
||||
@@ -40,7 +40,7 @@ public class VigilCareApiClient
|
||||
var response = await _http.PostAsJsonAsync($"/api/v1/patients/{patientId}/encounters", req);
|
||||
response.EnsureSuccessStatusCode();
|
||||
var envelope = await response.Content.ReadFromJsonAsync<ApiResponse<EncounterResponse>>();
|
||||
return envelope!.Data;
|
||||
return envelope!.Data!;
|
||||
}
|
||||
|
||||
public async Task SendObservationBatchAsync(
|
||||
@@ -89,7 +89,7 @@ public class VigilCareApiClient
|
||||
|
||||
var envelope = await ordersResponse.Content
|
||||
.ReadFromJsonAsync<ApiResponse<PagedResponse<OrderResponse>>>();
|
||||
var order = FindPendingOrder(envelope?.Data.Items ?? [], orderDescription);
|
||||
var order = FindPendingOrder(envelope?.Data?.Items ?? [], orderDescription);
|
||||
if (order is null)
|
||||
return false;
|
||||
|
||||
@@ -117,7 +117,7 @@ public class VigilCareApiClient
|
||||
if (!response.IsSuccessStatusCode) return new();
|
||||
var envelope = await response.Content
|
||||
.ReadFromJsonAsync<ApiResponse<PagedResponse<AlertResponse>>>();
|
||||
return envelope?.Data.Items.ToList() ?? new();
|
||||
return envelope?.Data?.Items?.ToList() ?? new();
|
||||
}
|
||||
|
||||
public async Task<News2Response?> GetCurrentNews2Async(Guid encounterId)
|
||||
|
||||
Reference in New Issue
Block a user