【发布时间】:2019-10-09 12:36:54
【问题描述】:
我正在针对 Smile (hapi) CDR Fhir 服务器使用 .NET Fhir 客户端。我有 3235 名患者正在尝试使用下面的代码检索,但从未超过 2000 名。我尝试使用而不使用 no-cache 选项添加标题。我知道服务器有更多记录,因为我发出了Patient/?_summary=count,它给出了我期望的记录总数(3235)。
我禁用了服务器缓存,刷新了索引,但总是得到正好 2000 条记录。我还尝试了使用 Get() 和 Search() 方法来检索患者的不同方法,但都得出了相同的结果。谁能建议另一种方法来让正确数量的患者返回或提示我可能做错了什么?
var patients = new List<Patient>();
var bundle = (Bundle)client.Get("Patient");
while (bundle != null)
{
patients.AddRange(bundle.Entry.Select(e => e.Resource as Patient));
bundle = client.Continue(bundle);
}
我已尝试使用包含缓存控制标头的几种变体,但计数保持不变。
client.OnBeforeRequest += (object sender, BeforeRequestEventArgs e) =>
{
e.RawRequest.Headers.Clear();
e.RawRequest.Headers.Add("Accept", "application/fhir+json;fhirVersion=4.0");
e.RawRequest.Headers.Add("Cache-Control", "no-cache");
};
【问题讨论】: