usnistgov / iheos-toolkit2

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

Improper length requirement on root^extension #597

Open JohnMoehrke opened 11 months ago

JohnMoehrke commented 11 months ago

https://github.com/usnistgov/iheos-toolkit2/blob/61b612a7378e1df32f8685ac13f1a14b1bf69002/validators-registry-metadata/src/main/java/gov/nist/toolkit/valregmetadata/validators/RegistryObjectValidator.java#L116C1-L116C1

I don't think that this 15 character limit is legitimate. Where did this requirement come from? Even elsewhere where CXi is used IHE clearly specifies that any underlying HL7 v2 requirement on extension to be 15 characters does not apply. And certainly does not apply to CDA document/id which is HL7 v3 II.

skbhaskarla commented 9 months ago

Hi @JohnMoehrke The code you referenced enforces 16 characters max, not 15. See requirements here:

The structure and format of this Id shall be consistent with the specification corresponding to the formatCode attribute. (e.g. for a DICOM standard document a 64-character numeric UID, for an HL7 CDA format a serialization of the CDA Document Id extension and root in the form "oid^extension", where OID is a 64 digits max, and the Id is a 16 UTF-8 char max. If the OID is coded without the extension then the '^' character shall not be included.).

Reference: https://hl7.org/fhir/R4/documentreference-definitions.html#masterIdentifier

JohnMoehrke commented 9 months ago

I will look into this. The text you quote has been removed from FHIR in R5, which would seem to indicate that it was not perfectly correct.

I noticed this problem when working with a developer that had extensions larger than 15 characters.

skbhaskarla commented 9 months ago

The initial version of the NIST HL7 FHIR Toolkit was built into the NIST XDS Toolkit, so some of the FHIR-based validation was enforced in XDS Toolkit validators.

The FHIR Toolkit code now exists as its own toolkit code base so the older validation code might not be necessary in XDS Toolkit.

JohnMoehrke commented 9 months ago

I am sure that even the English is expressing that the id must be at least 80 characters.

CDA Document Id extension and root in the form "oid^extension", where OID is a 64 digits max, and the Id is a 16 UTF-8 char max.

so OID at 64, and extension at 16 => 80 (plus one more for the '^')

JohnMoehrke commented 9 months ago

I am checking with Tone and Keith... But also on zulip https://chat.fhir.org/#narrow/stream/229921-CDA/topic/CDA.20id.20format.20requirements

skbhaskarla commented 9 months ago

I am sure that even the English is expressing that the id must be at least 80 characters.

CDA Document Id extension and root in the form "oid^extension", where OID is a 64 digits max, and the Id is a 16 UTF-8 char max.

so OID at 64, and extension at 16 => 80 (plus one more for the '^')

I was only referring to the source code line you asked a question about, this has nothing to do with the first part of the array.

JohnMoehrke commented 9 months ago

okay. My question to Keith and zulip has not yet gotten an answer. Tone indicated he has no knowledge of a limit like this.

JohnMoehrke commented 9 months ago

I have found in the "CDA R2 Normative Web Edition" the section on the Instance Identifier (II). It has no length requirements. I can't copy the whole thing, but you should be able to get access to this.

Here is the path fragment within this publication CDA_R2_NormativeWebEdition2005/infrastructure/datatypes/datatypes.htm#prop-II.extension

JohnMoehrke commented 9 months ago

Note that within IHE we do have a 64 character max. However there are plenty of discussions that this should not be considered a hard limit. There are some that can handle more and they want to have longer values. So even this should not be considered a hard requirement https://profiles.ihe.net/ITI/TF/Volume3/ch-4.2.html#4.2.3.2.18