简体   繁体   English

向 Azure FHIR 服务器发送批量数据

[英]Sending bulk data to Azure FHIR Server

I am trying to process a csv files which contains more than 20000 patient information.我正在尝试处理包含超过 20000 个患者信息的 csv 文件。 There are totally 50 columns and each patient will have multiple rows as its the hourly data.总共有 50 列,每个患者将有多行作为其每小时数据。 Most of the columns belong to Observation resource type.大多数列属于观察资源类型。 Like Heart Rate, Temperature, Blood Pressure.比如心率、体温、血压。

I have successfully transformed the data into FHIR format.我已成功将数据转换为 FHIR 格式。 however, when i try to push the data inside FHIR server, the server throws an error saying maximum of 500 entries are only allowed for the data.但是,当我尝试将数据推送到 FHIR 服务器中时,服务器会抛出一个错误,说最多只允许数据 500 个条目。

Even if i wait up to 500 entries and push the json file, its taking quite a lot time to cover up 20000 * 50. Is there any efficient way of bulk inserting the data into the azure fhir server?即使我等待多达 500 个条目并推送 json 文件,也需要花费大量时间来掩盖 20000 * 50。是否有任何有效的方法将数据批量插入 azure fhir 服务器?

Currently, i am using the following code.目前,我正在使用以下代码。 But looks like its going to take quite a lot time and resource.但看起来它需要相当多的时间和资源。 As there are around 0.7 million rows in my csv file.因为我的 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)

The most efficient way is not to send multiple (batch) bundles.最有效的方法是不发送多个(批量)包。 It is actually to do many individual requests running in parallel.它实际上是并行运行许多单独的请求。 Your problem is that you are sending these in sequentially and taking a huge hit on the round-trip time.您的问题是您按顺序发送这些并在往返时间上受到巨大影响。 You can take a look at something like this loader: https://github.com/hansenms/FhirLoader , which parallelizes the requests.你可以看看类似这样的加载器: https://github.com/hansenms/FhirLoader ,它并行化了请求。 You will also want to up the RUs on your service to make sure you have enough throughput to get the data in.您还需要增加服务上的 RU,以确保您有足够的吞吐量来获取数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM