Skip to content

Conversation

@krivard
Copy link
Contributor

@krivard krivard commented Jun 22, 2022

Description

The addition of broad-except was only needed because we made sequential assumptions about the format of filenames. If we use regular expressions instead, we can return the failover timestamp (1900-01-01) without needing an exception to be thrown.

Changelog

Itemize code/test/documentation changes and files added/removed.

  • .pylintrc - remove broad-except
  • download_claims_ftp_files.py - convert get_timestamp to regular expressions

@krivard krivard requested a review from jingjtang June 22, 2022 20:36
logger.info("Transfer in progress", filename=filename, percent=rough_percent_transferred)


FILENAME_TIMESTAMP = re.compile(r".*EDI_AGG_INPATIENT_(?P<ymd>[0-9]*)_(?P<hm>[0-9]*)[^0-9]*")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to check with

FILENAME_TIMESTAMP = re.compile(r".*EDI_AGG_(.*?)PATIENT_(?P<ymd>[0-9]*)_(?P<hm>[0-9]*)[^0-9]*")

since we consider the number of all the files available in the hosp/receiving dir but not just INPATIENT files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does claims_hosp need the outpatient files as well? Or are those processed by doctor-visits instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR don't use outpatient files. But the code does check the number of all the files available. I am not sure why Maria design it in this way. If we don't check the inpatient files here, it's better to also update the assertion statement

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's better to also update the assertion statement

done

@krivard krivard requested a review from jingjtang June 24, 2022 21:27
Copy link
Contributor

@jingjtang jingjtang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@krivard krivard merged commit d1ffb14 into productionize-claims_hosp Jun 24, 2022
@krivard krivard deleted the krivard/pch-no-general-except branch June 24, 2022 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants