-
Notifications
You must be signed in to change notification settings - Fork 8
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
Issue with accessing FHIR Data types #59
Comments
Thank you for taking the time to open an issue! I'm using the cqlplayground to tinker around a bit with the code you linked and I have found a few things but I'm still working on a getting you a proper response. So changing I think there may be a bug in the engine regarding the conversion of said FHIR.Quantity into a system type that you can compare the value of, but I'm not quite done looking into that at this time. I'll try to get you an update on this as soon as i can but since it's almost the weekend no promises before Monday :) |
Thanks, @evan-gordon, for the quick response. Let me know if I can help to provide more details. Thanks for creating such a great tool! |
Hi @darena-pjindal, I had some free time and was able to do a lil investigation. It turns out this has to do with a discrepancy in how FHIR protocol buffers represent decimals and how the CQL FHIR ModelInfo statically expects decimal.value properties to behave. #60 should fix the issue you were facing in "HasHypertension" with the following modifications:
I was able to verify this ran in our cql playground (with #60) against the default data without errors, though didn't look at the rest of your logic carefully. I think there's at least one other bug or improvement to be made here, but hopefully this should unblock your explorations! |
Thanks @suyashkumar. That worked |
Awesome, great to hear! Let us know if you run into any other issues. |
@suyashkumar—Actually, I am still having a conversion issue. I don't remember what query I tried over the weekend, but this doesn't seem to work. It says Error: failed to eval: failed during CQL evaluation: Explore 1.2.3, internal error—can not convert System.String to a float64. library Explore version '1.2.3' include FHIRHelpers version '4.0.1' called FHIRHelpers context Patient define "IsMale": define "HasHypertension": |
@darena-pjindal are you using the latest commit on main that includes my PR #60? I'm able to get it to work in the playground with default data at HEAD. If not, let's see if we can debug some more. |
@suyashkumar - my bad :(. I was using it on a machine with the old version. I was wondering how it suddenly stopped working again :). Thanks so much. |
No problem at all, glad it's working! Thanks again for giving our tools a try--please do open any more issues that you run into in the future! |
Glad to hear you're unblocked @darena-pjindal ! Let us know if anything else comes up! @suyashkumar thanks for your quick work here! Closing the issue as resolved. |
Hello - I have been trying some very simple queries but it seems to not recognize the basic FHIR types. Am I don't something wrong here? Here is one of the query I tried.
library SampleTest version '0.0.1'
using FHIR version '4.0.1'
include FHIRHelpers version '4.0.1' called FHIRHelpers
context Patient
define "IsMale":
Patient.gender = 'male'
define "HasHypertension":
exists (
[Observation] O
where exists (O.code.coding C where C.code = 'sys-bld-prs')
and O.value is Quantity
and O.value.value > 140
)
define "HasGlucoseObservation":
exists (
[Observation] O
where exists (O.code.coding C where C.code = 'gluc')
)
define "MeetsCriteria":
"IsMale"
and "HasHypertension"
define "Recommendation":
if "MeetsCriteria" then 'Recommend monitoring blood pressure and lifestyle changes'
else 'No specific recommendation'
define "Rationale":
if "MeetsCriteria" then 'Patient meets criteria for hypertension monitoring'
else 'Patient does not meet criteria for hypertension monitoring'
define "Errors":
null
The text was updated successfully, but these errors were encountered: