File tree 1 file changed +4
-6
lines changed
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 4
4
import os .path
5
5
6
6
7
- def import_bundle (client , filename ):
7
+ async def import_bundle (client , filename ):
8
8
with open (filename ) as fd :
9
9
patient_json = json .load (fd )
10
10
bundle = client .resource ('Bundle' )
11
11
bundle ['type' ] = 'transaction'
12
- bundle ._get_path = lambda : ''
13
12
bundle ['entry' ] = patient_json ['entry' ]
14
- bundle .save ()
13
+ await bundle .save ()
15
14
16
15
17
- def import_dataset (client , dataset_path ):
16
+ async def import_dataset (client , dataset_path ):
18
17
sys .stdout .write ("Import progress: 0% \r " )
19
18
20
19
filenames = [
@@ -23,10 +22,9 @@ def import_dataset(client, dataset_path):
23
22
24
23
total_count = len (filenames )
25
24
for index , filename in enumerate (filenames ):
26
- import_bundle (client , os .path .join (dataset_path , filename ))
25
+ await import_bundle (client , os .path .join (dataset_path , filename ))
27
26
progress = int (float (index + 1 ) / float (total_count ) * 100 )
28
27
sys .stdout .write ("Import progress: %d%% \r " % progress )
29
28
sys .stdout .flush ()
30
29
sys .stdout .write ("Import progress: 100%\n " )
31
30
sys .stdout .write ("{0} bundles imported" .format (total_count ))
32
-
You can’t perform that action at this time.
0 commit comments