usnistgov / iheos-toolkit2

XDS Toolkit
https://ihexds.nist.gov
45 stars 25 forks source link

Support optional trailing separator when Format is XON|XCN|XTN #594

Closed skbhaskarla closed 5 months ago

skbhaskarla commented 11 months ago

https://profiles.ihe.net/ITI/TF/Volume3/ch-4.2.html#4.2.3.3.7

Example part in question:
<rim:Value>|12345^LaShawn^James^^Dr^MD</rim:Value>

In gov.nist.toolkit.valregmetadata.datatype.XonXcnXtnFormat#validate, replace barCount guard with if ! (parts.length > 0 && parts.length <= 3) then error

Change value assignment to

if parts.length > 0 
xon = parts[0];
if parts.length > 1
xcn = parts[1];
if parts.length == 3
xtn = parts[2];

Original issue submitter reference: https://groups.google.com/g/ihe-xds-implementors/c/-DNiTuhRZPc