@@ -51,9 +51,9 @@ def __str__(self):
5151 def make_request_with_backoff (
5252 http_method : str ,
5353 url : str ,
54+ headers : dict = None ,
5455 expected_status_code : int = 200 ,
5556 expected_connection_failure : bool = False ,
56- headers : dict = None ,
5757 max_retries : int = 5 ,
5858 delay_seconds : float = 2.0 ,
5959 ** kwargs
@@ -118,18 +118,18 @@ def create_a_deleted_immunization_resource(self, resource: dict = None) -> dict:
118118
119119 def get_immunization_by_id (self , event_id , expected_status_code : int = 200 ):
120120 return self .make_request_with_backoff (
121- "GET" ,
122- f"{ self .url } /Immunization/{ event_id } " ,
123- expected_status_code ,
124- headers = self . _update_headers ()
121+ http_method = "GET" ,
122+ url = f"{ self .url } /Immunization/{ event_id } " ,
123+ headers = self . _update_headers () ,
124+ expected_status_code = expected_status_code
125125 )
126126
127127 def create_immunization (self , imms , expected_status_code : int = 201 ):
128128 response = self .make_request_with_backoff (
129- "POST" ,
130- f"{ self .url } /Immunization" ,
131- expected_status_code ,
129+ http_method = "POST" ,
130+ url = f"{ self .url } /Immunization" ,
132131 headers = self ._update_headers (),
132+ expected_status_code = expected_status_code ,
133133 json = imms
134134 )
135135
@@ -147,28 +147,28 @@ def create_immunization(self, imms, expected_status_code: int = 201):
147147
148148 def update_immunization (self , imms_id , imms , expected_status_code : int = 200 ):
149149 return self .make_request_with_backoff (
150- "PUT" ,
151- f"{ self .url } /Immunization/{ imms_id } " ,
152- expected_status_code ,
150+ http_method = "PUT" ,
151+ url = f"{ self .url } /Immunization/{ imms_id } " ,
153152 headers = self ._update_headers (),
153+ expected_status_code = expected_status_code ,
154154 json = imms
155155 )
156156
157157 def delete_immunization (self , imms_id , expected_status_code : int = 204 ):
158158 return self .make_request_with_backoff (
159- "DELETE" ,
160- f"{ self .url } /Immunization/{ imms_id } " ,
161- expected_status_code ,
162- headers = self . _update_headers ()
159+ http_method = "DELETE" ,
160+ url = f"{ self .url } /Immunization/{ imms_id } " ,
161+ headers = self . _update_headers () ,
162+ expected_status_code = expected_status_code ,
163163 )
164164
165165 def search_immunizations (self , patient_identifier : str , immunization_target : str , expected_status_code : int = 200 ):
166166 return self .make_request_with_backoff (
167- "GET" ,
168- f"{ self .url } /Immunization?patient.identifier={ patient_identifier_system } |{ patient_identifier } "
167+ http_method = "GET" ,
168+ url = f"{ self .url } /Immunization?patient.identifier={ patient_identifier_system } |{ patient_identifier } "
169169 f"&-immunization.target={ immunization_target } " ,
170- expected_status_code ,
171- headers = self . _update_headers ()
170+ headers = self . _update_headers () ,
171+ expected_status_code = expected_status_code
172172 )
173173
174174 def search_immunizations_full (
@@ -184,10 +184,10 @@ def search_immunizations_full(
184184 url = f"{ self .url } /Immunization?{ query_string } "
185185
186186 return self .make_request_with_backoff (
187- http_method ,
188- url ,
189- expected_status_code ,
187+ http_method = http_method ,
188+ url = url ,
190189 headers = self ._update_headers ({"Content-Type" : "application/x-www-form-urlencoded" }),
190+ expected_status_code = expected_status_code ,
191191 data = body
192192 )
193193
0 commit comments