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

investigate CQF Ruler 0.13.0 error #248

Open
mattStorer opened this issue Jan 16, 2025 · 5 comments
Open

investigate CQF Ruler 0.13.0 error #248

mattStorer opened this issue Jan 16, 2025 · 5 comments
Assignees
Labels
bug Something isn't working CQL Change will be made in CQL Repo: https://github.com/OHSUCMP/htnu18ig

Comments

@mattStorer
Copy link
Collaborator

just encountered this error on the COACH Sandbox (coach-sandbox.ohsu.edu) using the "Test1, MBS" Patient, when using CQF Ruler 0.13.0:

Image

I verified that this error does not occur when running with CQF Ruler 0.5.0.

@mattStorer mattStorer added the bug Something isn't working label Jan 16, 2025
@mattStorer mattStorer self-assigned this Jan 16, 2025
@mattStorer
Copy link
Collaborator Author

I suspect this error may relate to some special MedicationRequest resources I have associated with this record.

  • One MedicationRequest references a Medication by reference
  • One MedicationRequest references a Medication by contained reference (so included within the referencing MedicationRequest)
  • One MedicationRequest references a Medication by identifier

It's weird that v0.13.0 can't handle this when apparently v0.5.0 can. But there's not that many resources on this record to begin with, and I don't believe this issue used to occur when I tested with it.

@mattStorer
Copy link
Collaborator Author

CQF Ruler 0.5.0 pom.xml has <cql-engine.version>1.5.9</cql-engine.version>, while CQF Ruler 0.13.0 pom.xml has <cql-engine.version>2.7.0</cql-engine.version> - it may be the case that the CQL generated by https://github.com/OHSUCMP/htnu18ig is incompatible somehow?

Should consider this as a possibility, it could be that the CQL is fine in text, it's just not transforming in a compatible way. Or something. Maybe?

@mattStorer
Copy link
Collaborator Author

UPDATE: this issue is triggered by a resource containing a reference by identifier. Has nothing to do with contained references, those work fine.

@mattStorer
Copy link
Collaborator Author

I believe the issue relates to this function in OHSUHTNCommon.cql:

define function getMedication(Rx MedicationRequest):
  if Rx.medication is FHIR.Reference then
    singleton from ([Medication: id in Last(Split(Rx.medication.reference, '/'))])
  else
    Medication {code: Rx.medication}

A MedicationRequest resource may have an Rx.medication that is a FHIR.Reference, but here the code presumes the reference to be by ID, splitting it by / and taking the Last part of that (which will be the id for that Medication).

However, in this case, the reference is an identifier, which includes a system and code. So that's one complicating factor. Another complicating factor is that a Medication may have many identifiers, so it would need to check each of them.

There may be an easy way to accomplish this, we may not need to grab identifier components and iterate over Medication.identifier. gotta dig into this.

@mattStorer
Copy link
Collaborator Author

@mattStorer mattStorer added the CQL Change will be made in CQL Repo: https://github.com/OHSUCMP/htnu18ig label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CQL Change will be made in CQL Repo: https://github.com/OHSUCMP/htnu18ig
Projects
None yet
Development

No branches or pull requests

1 participant