Skip to content

Commit

Permalink
refactor: delete comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonKonar authored and RadovanTomik committed Mar 27, 2024
1 parent 2711dcb commit cc04c40
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, "
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")
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

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

0 comments on commit cc04c40

Please sign in to comment.