firely-net-sdk
firely-net-sdk copied to clipboard
Terminology service raises warningi for mimetypes
When adding a mimetype (EG: DocumentReference.content.attachment.contentType) the terminology service raises a warning. For example, when using the "text/plain" mimetype, the service raises this warning:
Terminology service failed while validating code 'text/plain' (system ''): Cannot resolve canonical reference 'urn:ietf:bcp:13' to CodeSystem
Is this expected behavior? It is just a warning so we can ignore it, but it would be nice if there was a way to remove this warning from being raised.
Yes it is. This valueset is actually a bit special, since it cannot be defined using a normal FHIR Valueset definition (much like the valueset covering languages). But you are right, it would be nice to just suppress the warning in that case, since this is never going to function well (unless we hand-built a specific mime-type validator).
I'll turn this into a feature-request.
We could also just include a specific ValueSet definition for the common ones?
What we need to do is add another implementation for ITerminologyService that will be able to validate bcp13 and possibly iso3166. This is a hand-written service that does not depend on external codesystems, and that will validate the mime-types based on some general rules (e.g. the syntax, the allowed list of top-level types, see https://www.rfc-editor.org/rfc/rfc4288). For iso3166 and languages we could do a basic syntax check, since I don't feel like updating the list whenever iso does.
For my server I just loaded a version of the code system in and let that resolve and it works just fine (and yes that makes me responsible for keeping that up to date, but it's pretty uncommon, and a pretty easy change to update when it is encountered) http://qforms-server.azurewebsites.net/CodeSystem/bf86255634a84fd6b29a9caa45ee6699 Just a really easy workaround for those that want to do it right away.
You mean iso3166, I guess? It's harder for the languages (since these are combinations of country*language - and impossible for bcp13). But yes, for iso3166 is should be possible if you maintain it.
Implementation:
- we will create an other implementation of
ITerminologyService
, where we implement the ValidateCode manually for the valueset http://hl7.org/fhir/ValueSet/mimetypes. - This new implementation should be combined with other TSs, like
LocalTerminologyService