o.salas - you say that you are a software developer. Are you trying to develop the logic for If > Then statements in a software program, or something similar? If the answer is "Yes", then you are asking your questions in the wrong place.
I assume you are asking a software program If > Then type of logic question. The kinds of statements you are making do not come up in our billing routines.
If we need to include an NDC in our billing, the NDC comes from the manufacturer of the product in view. Usually the NDC is included on the packaging of the product. Or, we simply Google the product name + NDC Number and it pops up in the search results.
I don't have time to research this, but I know there are web links to various IT folks / departments who are involved in creating the data sets and rules for the same for CMS. In particular, there is a technology office whose name I cannot remember at the moment, so I have nothing with which to google for their website. This link might give you some information that you can use to start researching on your own. If you already know about this page, then nevermind.
https://www2a.cdc.gov/vaccines/iis/iisstandards/vaccines.asp?rpt=ndc