Stream: dotnet
Topic: Validating Coding Systems
PS (Mar 19 2020 at 04:27):
Hi,
Is there any way that validator gives success only for certain codes and coding system which is predefined in some json file or dictionary?
Thanks.
Mirjam Baltus (Mar 19 2020 at 07:39):
Yes. You will need to create a ValueSet resource with the codes you want to use in it. Then create a profile, binding that ValueSet to the field where the codes will be filled in. Use a 'required' binding. Now with the input of this profile and your ValueSet, the validator can validate a resource against the profile and will give an error when a different code is used.
PS (Apr 02 2020 at 06:56):
Mirjam Baltus said:
Yes. You will need to create a ValueSet resource with the codes you want to use in it. Then create a profile, binding that ValueSet to the field where the codes will be filled in. Use a 'required' binding. Now with the input of this profile and your ValueSet, the validator can validate a resource against the profile and will give an error when a different code is used.
Is there any way that we can pass value set resource in the validator settings instead of putting in the Structure Definition as the list keeps on changing
Mirjam Baltus (Apr 02 2020 at 08:19):
@PS : You only set the binding in the StructureDefinition, not list all of the codes there. The binding is set to the canonical URL of your ValueSet resource. The validator will lookup that resource by URL when it wants to validate an instance. So if your ValueSet contents have changed, it will validate against the new codes.
Of course you will have to be careful with changing the ValueSet after you have published your profile, since that might break existing implementations if the binding is set to 'required'.
Last updated: Apr 12 2022 at 19:14 UTC