Proper logical references and Uniform Resource Identifier References

Hi.

  1. How to create proper URI for CodeableConcept.System?
  2. Ex: my app generates some custom value that I should use for codings, let’s say - business identifier.

{

“system”: “urn:{myappname}”,

“value”: “a1d4ee8aba494ca”

}

  1. So is it correct to use “system”: “urn:{myappname}”?

  2. Or even something like “urn:{myappname}:{mycustomcodetype}”?

  3. Or another example my system want to push message with custom event type
    “eventCoding”: {

“system”: “urn:{myappname}”,

“code”: “{my custom code}”

},
Is it correct? Is it better to use “urn:{myappname}:event-type”?

Any advice?
Thanks

The w3c has formal rules for constructing a urn. The syntax is urn:namespace:namespace-specific string. The namespace needs to be one of the standard ones or needs to be a number registered with IANA. You can’t just invent your own. However, you can just define a namespace as a guid - so urn:uuid:[your guid here]. All that said, your implementers will look much more kindly on you if you use a URL because that’s going to be human readable and understandable and, in the ideal state, will actually resolve to the code system you’ve defined - which lets others understand what the heck your codes actually mean.

2 Likes

Thanks for the answer.

Do you mean, while it is restricted to use non-registered URNs, it is okay to use non-registered URLs?
So for me, it will be something like:
https://mysite.com/fhir/{mycustomcodetype} ?

The only “schemes” involved for URLs are things like “http:” or “ftp:”. You just follow the regular rules beneath those.

You might want to use https://mysite.com/fhir/CodeSystem/mycustomcodetype - that way you’re following the standard RESTful convention. However, it’s not a requirement.

1 Like