-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds LX and REF for transactions #14
Conversation
This resolves all stdout warnings of Identifier: LX not handled in transaction loop. Identifier: REF not handled in transaction loop. While these fields don't seem super useful no warnings is quite nice. This also adds a nevada medicaid sample found here https://www.medicaid.nv.gov/Downloads/provider/Sample_835_File.pdf [AT-5936] Signed-off-by: Russell Osborne <[email protected]>
f3fe700
to
6e1f542
Compare
@property | ||
def production_date(self) -> datetime.datetime: | ||
return self.date.date |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a convenience method.
|
||
elif identifier in cls.terminating_identifiers: | ||
return transaction, segments, segment | ||
|
||
else: | ||
segment = None | ||
message = f'Identifier: {identifier} not handled in transaction loop.' | ||
message = f'Identifier: {identifier} not handled in transaction loop. {segment}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found seeing the segment right away VERY useful to go check specs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Freaking neeeeeeeeed a better pattern here. But yes, this is gud 👍
segment = split_segment(segment) | ||
|
||
self.identifier = segment[0] | ||
self.number = segment[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still feel the need for a base class here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fo sho
@@ -12,6 +12,8 @@ python = "^3.9" | |||
pandas = "^2.0.3" | |||
pytest = "^8.1.1" | |||
|
|||
[tool.poetry.dev-dependencies] | |||
ruff = "*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Snuck this in.
@@ -4,6 +4,7 @@ | |||
import pytest | |||
|
|||
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) | |||
sys.path.append(os.path.join(os.path.dirname(__file__), 'utils')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Open to different approaches here, but I wanted to separate the test helpers from the tests.
def get_claim_by_control_number(transaction_set, claim_id): | ||
for transaction in transaction_set.transactions: | ||
for claim in transaction.claims: | ||
if claim.claim.patient_control_number == claim_id: | ||
return claim | ||
|
||
assert False, f'Claim with ID {claim_id} not found' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this to be easier to hard check specific values in the test suite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some thoughts, otherwise, totally fine to keep the 🚂-🚋-🚋-🚋 moving!
return ref | ||
|
||
@property | ||
def production_date(self) -> datetime.datetime: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def production_date(self) -> datetime.datetime: | |
def production_date(self) -> datetime.date: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now it's parsed to a datetime.
def reference_identification_number(self) -> Optional[ReferenceSegment]: | ||
for ref in self.references: | ||
if ref.qualifier == 'Reference Identification Number': | ||
return ref |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I trust that this is the way. If we have multiple refs, are we wanting to return the moment it hits that value? or should there be a more "hardened" rule on the return. Just checking not ⚔️
# https://www.cms.gov/medicare/billing/electronicbillingeditrans/downloads/835-flatfile.pdf | ||
'EV': 'Reference Identification Number', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
o my gracious linking these out would be lovely
"python.testing.pytestArgs": ["tests"], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true | ||
"python.testing.pytestEnabled": true, | ||
"python.analysis.extraPaths": ["./tests"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we committing vscode settings?
|
||
elif identifier in cls.terminating_identifiers: | ||
return transaction, segments, segment | ||
|
||
else: | ||
segment = None | ||
message = f'Identifier: {identifier} not handled in transaction loop.' | ||
message = f'Identifier: {identifier} not handled in transaction loop. {segment}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Freaking neeeeeeeeed a better pattern here. But yes, this is gud 👍
segment = split_segment(segment) | ||
|
||
self.identifier = segment[0] | ||
self.number = segment[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fo sho
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) | ||
sys.path.append(os.path.join(os.path.dirname(__file__), 'utils')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are not pytest.ini for backwards compatibility and what not, is that correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ironically these are all pytest fixtures 🤔
def get_claim_by_control_number(transaction_set, claim_id): | ||
for transaction in transaction_set.transactions: | ||
for claim in transaction.claims: | ||
if claim.claim.patient_control_number == claim_id: | ||
return claim | ||
|
||
assert False, f'Claim with ID {claim_id} not found' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great 👍
This resolves all stdout warnings of
Identifier: LX not handled in transaction loop.
Identifier: REF not handled in transaction loop.
While these fields don't seem super useful no warnings is quite nice.
This also adds a nevada medicaid sample found here https://www.medicaid.nv.gov/Downloads/provider/Sample_835_File.pdf
Specs are here
https://www.cms.gov/medicare/billing/electronicbillingeditrans/downloads/835-flatfile.pdf
Grep for EV, and TJ
AT-5936