-
Notifications
You must be signed in to change notification settings - Fork 137
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
[WIP] Add posibility to register external code lists. #198
base: master
Are you sure you want to change the base?
Conversation
@RomanKapitonov WOW, this is fantastic! This will be one of those key features will be very handy to have. I have to take a deeper dive and study your PR but out of the gate, I see that the new logic returns an empty if the code list does not exist. What do you think about perhaps having some way to alert that the code list does not exist? I could foresee someone making a typo and perhaps not realizing this or worse yet getting the wrong code list. Will take a deeper dive and report back. Isi |
@irobayna Thank you! I'm planning to continue working on the PR sometime this week. I've actually added a warning upon referencing a non-existing external list but then decided to get rid of it. I'm going to add it back along with documentation and some examples of usage. |
@irobayna I've been looking through some of the specs for 270/271/837I and others, and it looks like some of the code lists might have "sub-lists". This concept is also covered by stupidedi. For example, the definition of DMG segment might contain element DMG10 which is data element 1270. Based on how 1270 is defined it looks like the element may contain a reference to the external code list. But that doesn't make much sense to me. How would it be used? I mean let's say a DMG segment has some value in DMG10, which in terms is a reference to the external code list:
Say we have a DMG:
Then how will code list "65" be used? |
Hey @RomanKapitonov, this looks promising! I really like the ability to have the lookup values in the pretty printed output. I also agree with removing the One thing I'm not sold on is having a mutable global variable, I would like to use an approach that allows different files to use different external code list implementations (e.g., maybe it depends on who the sender or receiver is), without the two files interfering with each other's external code list table. That also reduces the risk that code in an unrelated part of your application (or loaded via a third-party library) could change that global variable; if instead it's part of My first thought was to pass the Looking at the bigger picture, that would place the process of linking an element to an external code list as late as possible -- only right when we need to check its membership or pretty print it. However, we have all the info needed when we are constructing the element value (i.e., this is Normally Instead, I think we can pass an updated Side note: we already do something similar in Now one important unresolved issue remains: when one element determines which code list applies to another element. That's what is going on with In summary, eventually
In the short term, we can make some progress by updating Once that's working I think it wouldn't be much of a leap to create a new data type similar to Hopefully I haven't taken the fun out of it and it makes sense. This idea might have some problems once you get down to actually implementing it... before typing this up I had at least two ill-conceived ideas that fell apart as I was trying to explain them :-) |
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.
Whoops, I should've posted this comment here as my code review.
Addresses #161
Below is a sample implementation as a simple proof of concept, which may definitely be extended further. I would like to initiate a discussion on the pros/cons of the suggested approach.
@irobayna @kputnam Guys, I would like to know your thoughts on this.