Skip to content
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

FHIRPath with extension token fails with function error and throws an exception - request for support of extension #21

Closed
coline14s opened this issue Jun 28, 2023 · 7 comments

Comments

@coline14s
Copy link

Q: Does fhirpathy support “extensions”
I think it does since when I do this search on the test subdirectory, I get a number of test cases with extension examples. When i run my evaluates, i get exceptions inside my try loop for these examples.

TEST 1:
These FHIRPath:
ExplanationOfBenefit.extension('https://bluebutton.cms.gov/resources/variables/dsh_op_clm_val_amt').valueMoney.value
ExplanationOfBenefit.billablePeriod.extension('https://bluebutton.cms.gov/resources/variables/claim_query_cd').valueCoding.code

Throw an exception for the attached ExplanationOfBenefit FHIR Resource. I know the extension does not exist for the EOB examples, but should the evaluate throw an exception?

TEST 2:
This FHIRPath fails when run against the patient resource attached (in zip). Same question except this path seems like it should work, the extension is inside the identifier coding.

Patient.identifier.where(type.coding.extension('https://bluebutton.cms.gov/resources/codesystem/identifier-currency').valueCoding.code = 'current').where(system = 'http://hl7.org/fhir/sid/us-mbi').value

jsonFiles.zip

Any help is appreciated!
Thanks

@coline14s
Copy link
Author

Believe that the presence of the token "extension" in the FHIRPath generates a exception. This issue was created to confirm that this is the expected behavior please. Thanks

FYI - Here were all my FHIRPaths that created an exception for the resources attached above:
ExplanationOfBenefit.billablePeriod.extension('https://bluebutton.cms.gov/resources/variables/claim_query_cd').valueCoding.code
ExplanationOfBenefit.extension('https://bluebutton.cms.gov/resources/variables/ime_op_clm_val_amt').valueMoney.value
ExplanationOfBenefit.extension('https://bluebutton.cms.gov/resources/variables/ime_op_clm_val_amt').valueMoney.value
ExplanationOfBenefit.extension('https://bluebutton.cms.gov/resources/variables/dsh_op_clm_val_amt').valueMoney.value
ExplanationOfBenefit.extension('https://bluebutton.cms.gov/resources/variables/clm_mdcr_non_pmt_rsn_cd').valueCoding.code
ExplanationOfBenefit.extension('https://bluebutton.cms.gov/resources/variables/clm_uncompd_care_pmt_amt').valueMoney.value
ExplanationOfBenefit.facility.extension('https://bluebutton.cms.gov/resources/variables/clm_fac_type_cd').value.code
ExplanationOfBenefit.extension('https://bluebutton.cms.gov/resources/variables/clm_srvc_clsfctn_type_cd').valueCoding.code
Patient.identifier.where(type.coding.extension('https://bluebutton.cms.gov/resources/codesystem/identifier-currency').valueCoding.code = 'current').where(system = 'http://hl7.org/fhir/sid/us-mbi').value

@coline14s coline14s changed the title FHIRPAth with extensions seem to fail (function errors) and throws an exception FHIRPath with extension token seems to fail (function errors) and throw an exception Jun 29, 2023
@coline14s
Copy link
Author

Reduced my example to a single test - confirmed that extension is not supported in the release i installed through pip, but wondered if there is a new version with support for extension.

Error
Exception has occurred: Exception
Not implemented: extension
File "/Users/colinwearring/code/pyFiles/fhirpathpy _evaluate.py", line 195, in
result = evaluate(patient, "Patient.identifier.where(type.coding.extension('https://bluebutton.cms.gov/resources/codesystem/identifier-currency').valueCoding.code = 'current').where(system = 'http://hl7.org/fhir/sid/us-mbi').value", [])
Exception: Not implemented: extension

Attached simple test case.
fhirpathpy _evaluate.py.zip

@coline14s coline14s changed the title FHIRPath with extension token seems to fail (function errors) and throw an exception FHIRPath with extension token fails with function error and throws an exception - request for support of extension Jun 30, 2023
@ir4y
Copy link
Member

ir4y commented Jul 1, 2023

Hi @coline14s

Thank you for your contribution. Unfortunately extension is not implemented yet.
I will have a look at it next week and most likely implement and release a new version.

ir4y added a commit that referenced this issue Jul 1, 2023
@ir4y ir4y mentioned this issue Jul 4, 2023
@ir4y
Copy link
Member

ir4y commented Jul 4, 2023

@coline14s the simple implementation that works for your case is done.
Please feel free to install it from github.

However extension on primitive types is not supported yet, this part is WIP #22
The new version of the library will be released once primitive types will be supported.

@ir4y
Copy link
Member

ir4y commented Jul 5, 2023

@coline14s new version 0.2.1 with extension support has been released.

@ir4y ir4y closed this as completed Jul 5, 2023
@coline14s
Copy link
Author

thanks ir4y - really appreciated - we're using in a demonstration at the CMS FHIR Connectathon, so if extension works for that example, it will make an excellent impression. testing now.

@coline14s
Copy link
Author

Tested and works like a champ! Really great outcome! Can't thank you enough.
Here's our track if folks are interested:
https://confluence.hl7.org/display/FHIR/2023+-+07+CMS+BCDA%2C+AB2D+and+DPC+Introduction+and+Workshop+-+Connectathon+2023-07

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

No branches or pull requests

2 participants