10
10
11
11
logger = logging .getLogger (bb2logging .HHS_SERVER_LOGNAME_FMT .format (__name__ ))
12
12
13
+ # This is likely not needed, still a bit unclear on how we will run it for TEST, then SBX, then PROD
13
14
FHIR_BASE_URL = "https://{ENV}.bluebutton.cms.gov/v2/fhir/"
14
15
MBI_URL = "http://hl7.org/fhir/sid/us-mbi"
15
16
@@ -31,34 +32,21 @@ def add_arguments(self, parser):
31
32
default = True ,
32
33
help = 'Show what would be updated without making changes'
33
34
)
34
- parser .add_argument (
35
- '--env' ,
36
- type = str ,
37
- default = "test" ,
38
- help = 'Show what would be updated without making changes'
39
- )
40
35
41
36
def handle (self , * args , ** options ):
42
- # batch_size = options['batch_size']
43
- # dry_run = options['dry-run']
44
- # env = options['env']
45
- batch_size = 10
46
- dry_run = False
47
- env = 'test'
48
- script_url = FHIR_BASE_URL .format (ENV = env )
37
+ batch_size = options ['batch_size' ]
38
+ dry_run = options ['dry-run' ]
49
39
logger .info ("batch size %s" % (batch_size ))
50
- logger .info ("env %s" % (env ))
51
- logger .info ("script_url %s" % (script_url ))
52
40
53
41
records = self .retrieve_records (batch_size )
54
- self .process_records (records , script_url , dry_run )
42
+ self .process_records (records , dry_run )
55
43
56
44
def retrieve_records (self , batch_size : int ) -> List [Crosswalk ]:
57
45
null_mbi_records = Crosswalk .objects .filter (_user_mbi__isnull = True )[:batch_size ]
58
46
logger .info ("# of records returned %s" % (len (null_mbi_records )))
59
47
return null_mbi_records
60
48
61
- def process_records (self , crosswalk_records : List [Crosswalk ], script_url : str , dry_run : bool ) -> None :
49
+ def process_records (self , crosswalk_records : List [Crosswalk ], dry_run : bool ) -> None :
62
50
for crosswalk in crosswalk_records :
63
51
try :
64
52
patient_info = 0
0 commit comments