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

Update ST header layout #21

Closed
wants to merge 1 commit into from
Closed

Conversation

boxfoot
Copy link
Contributor

@boxfoot boxfoot commented Dec 22, 2020

Add support for ST03 element (Implementation Convention Reference)

I'm working with a TP who requires the ST03 element for validation, but adding that element causes a validation error because it's not in the layout. I've added it manually in my own project but thought it could be helpful to submit here, too.

Add support for ST03 element (Implementation Convention Reference)
@sonarcloud
Copy link

sonarcloud bot commented Dec 22, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@ahuggins-nhs
Copy link
Contributor

ahuggins-nhs commented Dec 22, 2020

@boxfoot Not all industries support ST03 in their EDI exchanges, nor is ST03 consistently a minimum 35 chars in length. I think it might maybe always match the GS08 when present?

For example, two different implementation docs which have differing min/max:
https://tuftshealthplan.com/documents/employers/guides/834-999-companion-guide-version-5010
https://files.nc.gov/ncdor/documents/files/motorfuels_edi_guide.pdf?qn9wmFdW8vQFYYmTIvwx9UUv4tZksA4E

Regardless, another user had a similar case and graciously provided options to provide custom segment headers. #13

My recommendation would be to use the custom segment header functionality. If that's not sufficient, do you have a recommendation on how to improve the validation, or code changes to the ST segment validation logic?

@boxfoot
Copy link
Contributor Author

boxfoot commented Dec 22, 2020

@ahuggins-nhs thanks for the quick reply. Looks like I swapped MIN and MAX.

I've been using the custom segment header functionality already and can continue doing that -- especially since this change isn't universally relevant.

Re: validation, I think it might make sense to eventually have a validation system that tracks more information about each element, including min, max, required, format etc -- I've built out something similar for my own project for all of the industry-specific segments. While we can't for license reasons include a spec like that in the node-x12 library, there could be script which generates that information from the XSD schema -- in fact, it looks from other issues like some folks are already doing something like that.

For my limited purposes, the main problem was really the COUNT attribute, because it requires a specific value. So a more limited approach for just ST and just here could be to replace COUNT with COUNT_MIN (===2) and COUNT_MAX (===3).

@ahuggins-nhs
Copy link
Contributor

@boxfoot I decided to get this in while I'm fixing a different issue. Branch is https://github.com/ahuggins-nhs/node-x12/tree/patch-1

PR is #27

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

Successfully merging this pull request may close these issues.

2 participants