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

Feature request to allow the additional processing of valuesets as they are returned #32

Open
SomethingSexy opened this issue Apr 17, 2024 · 0 comments

Comments

@SomethingSexy
Copy link
Contributor

Hey @cmoesel hope you don't mind entertaining another requirement we have. I would like to see if we could fit it into this library in a non-obtrusive way. If you think this is beyond the goals of this library that is ok. I will also implement it, if we can agree on a solution.

We have a requirement where either locally loaded valuesets, or externally loaded valuesets, in certain scenarios when the valueset might contain a code with a specific system, such as a CPT code, we also want to map that same code to a HCPCS code, if that same code exists in both valuesets.

We do not want to modify the external data we are processing and include both codes and valuesets and we would like to avoid modify the CQL as well.

I am wondering if there is a way we could fit it in here. I have a couple ideas that might open things up to other features in the future as well.

  1. When calling ensureValueSets* functions, as part of our new options object we could include a callback function that would optionally be called after we download the valueset and when we are looping through the codes. This callback would accept { code, service, version } and optionally return an array of additional codes that might need to be added. This has the benefit of being handled when we are already looping through the codes. The negative here is that we could only really add additional codes or do nothing (unless we came up with a more complicated return signature for this callback function).
  2. Add a final callback, after we download the valueset but before we create the Code and Valueset objects that would optionally be called that would pass in the entire list of codes that were downloaded from that valueset as a pure function with a return signature of an array of codes. This would allow the caller to modify the list however they wanted and then return a new list. The benefit here is that it is a bit more robust for anyones needs, the downside would be potentially having to loop through the array of codes again, depending on the need of the user.

Also open to other ideas or any thoughts you have.

Thank you!

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

1 participant