我正在尝试处理包含超过 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)