-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Summary
The xsd for the IHE CSD profile has ID types for identifiers. This seems to be a mis-application of the goal of xs:ID which is intended for identifying XML nodes in an XML document, not to tag data elements as semantic unique identifiers in some source dataset.
(we refer to xs as the "http://www.w3.org/2001/XMLSchema" namespace)
The xs:id type renders a document invalid if more than one element across the whole document has the same ID, and is used to denote a 'key' by which to identify an XML node, not an indicator that in some system the data field is to be treated as a unique identifier).
Issue Description
The use of xs:id has the following problems:
- From a high level perspective it places restrictions on content (facility IDs) based on API format choice (xml), which is not a good design sequencing, because other arbitrary formats could have other restrictions.
- It places restrictions on the format and types of facility identifiers can use. For example, Rwanda uses FOSA IDs which are numeric. xs:id identifiers cannot be numeric or start with a number. Sometimes misused xs:id restrictions are sidestepped by appending magic strings to numeric identifiers "FOSA123", but this is a 'patch' behavior that leads to other issues for API consumers as the string is not part of the identifier and needs to be communicated out of band.
- It makes it impossible to have an organization, a provider, and/or a facility with the same ID in the same returned document. Because xs:id is used to identify XML nodes in a document, if an organization is identified as "PIH" then neither a provider or facility could be identified as such, anywhere whatsoever in the document, which breaks the goal of orthogonality of these data sets.
- It makes it impossible for a return document to include more than one copy of the same facility object (this would point to other issues with API design). Examples impossible to implement that have been documented in the field include be responding to a query of facilities nested by providers, or retrieving more than one past version of a facility object in the same request.
- XPath navigability and other putative benefits of using xs:id within an xml document can be attained with other constructs like xs:unique.
Recommendation
Remove xs:id from CSD schema definitions.
Then, if the IHE group really feels the XML documents should restrict identifiers within a container they could xs:unique elements appropriately scoped to the container element. Even then some scenarios above would be constrained if the scope of the xs:unique attributes are not carefully designed; and there is very little value to the client or implementer to specify that uniqueness in schema; so it could be left to a future version.
More Information
http://www.w3.org/TR/xml-id/ (Specifically http://www.w3.org/TR/xml-id/#processing)