hl7-fhir - 将批量数据发送到 Azure FHIR 服务器
问题描述
我正在尝试处理包含超过 20000 个患者信息的 csv 文件。共有 50 列,每个患者将有多行作为其每小时数据。大多数列属于观察资源类型。比如心率、体温、血压。
我已成功将数据转换为 FHIR 格式。但是,当我尝试将数据推送到 FHIR 服务器中时,服务器会抛出一个错误,说最多只允许数据 500 个条目。
即使我等待多达 500 个条目并推送 json 文件,也需要花费大量时间来掩盖 20000 * 50 。有没有将数据批量插入到 azure fhir 服务器的有效方法?
目前,我正在使用以下代码。但看起来它需要相当多的时间和资源。因为我的 csv 文件中有大约 70 万行。
def export_template(self, template):
if self.export_max_500 is None:
self.export_max_500 = template
else:
export_max_500_entry = self.export_max_500["entry"]
template_entry = template["entry"]
self.export_max_500["entry"] = export_max_500_entry + template_entry
if len(self.export_max_500["entry"]) > 500:
template["entry"] = self.export_max_500["entry"][:495]
self.export_max_500["entry"] = self.export_max_500["entry"][495:]
self.send_to_server(template)
解决方案
最有效的方法是不发送多个(批量)包。它实际上是并行运行许多单独的请求。您的问题是您按顺序发送这些并在往返时间上受到巨大影响。你可以看看类似这样的加载器:https ://github.com/hansenms/FhirLoader ,它并行化了请求。您还需要增加服务上的 RU,以确保您有足够的吞吐量来获取数据。
推荐阅读
- python - 在 Pytorch 中使用枚举的 ValueError(HDF5 数据)
- javascript - 附件路径不能从字符串转换为可读数组
- c - 从 .txt 文件创建单链表并反转 C 中每行的奇数
- wordpress - 我正在寻找响应式的数据表模板/框架
- reactjs - 在 React Bootstrap 表单中停止验证 React Form 组件中的一个字段
- go - 如何正确地从 exec Pod 流式传输日志
- r - 尝试计算相关矩阵时如何解释此错误的含义?
- ip - Windows 10 Command Prompt ADB over Wireless Network 中“无法连接”错误的解决方案
- javascript - 为什么不等于where子句查询需要在firestore中排序?
- ruby-on-rails - Friendly_id 没有出现在 Rails 上