Clinical Sync Batch Engine: first commit

This commit is contained in:
voltsrage
2026-06-23 03:02:30 +08:00
parent 90b8baa2a1
commit c9994b1ba2
60 changed files with 3547 additions and 31 deletions
@@ -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)