Skip to content

Commit

Permalink
refactor: delete comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonKonar committed Mar 26, 2024
1 parent 0976572 commit 9288361
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions service/blaze_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,19 +239,17 @@ def delete_fhir_resource(self, resource_type: str, param_value: str, search_para
if resource_type.capitalize() == "Patient":
patient_reference = url[url.find("Patient/"):]
logger.info(f"In order to delete Patient successfully, "

Check warning on line 241 in service/blaze_service.py

View check run for this annotation

Codecov / codecov/patch

service/blaze_service.py#L239-L241

Added lines #L239 - L241 were not covered by tests
f"all resources which reference this patient needs to be deleted as well")
f"all resources which reference this patient needs to be deleted as well.")
self.delete_fhir_resource("Condition", patient_reference, "reference")
self.delete_fhir_resource("Specimen", patient_reference, "reference")

Check warning on line 244 in service/blaze_service.py

View check run for this annotation

Codecov / codecov/patch

service/blaze_service.py#L243-L244

Added lines #L243 - L244 were not covered by tests
deleted_resource = requests.get(url=url, auth=self._credentials).json()
logger.debug(f"{deleted_resource}")
delete_response = requests.delete(url=url, auth=self._credentials)
# logger.debug(f"delete resource json response: {delete_response.json()}")
if delete_response.status_code != 204:
reason_index = delete_response.text.find("diagnostics")
if reason_index != -1:
logger.debug(f"could not delete. Reason: {delete_response.text[reason_index:]}")
logger.debug(f"response status: {delete_response.status_code}")
# return requests.delete(url=url, auth=self._credentials).status_code
return delete_response.status_code

Check warning on line 253 in service/blaze_service.py

View check run for this annotation

Codecov / codecov/patch

service/blaze_service.py#L247-L253

Added lines #L247 - L253 were not covered by tests

def is_resource_present_in_blaze(self, resource_type: str, identifier: str) -> bool:
Expand Down

0 comments on commit 9288361

Please sign in to comment.