FHIR Chat · optional datatype validation · implementers

Stream: implementers

Topic: optional datatype validation


view this post on Zulip Kirstine Rosenbeck Gøeg (Sep 18 2020 at 11:53):

I have gotten reports that validation fails, if an attribute with an optional datatype e.g. value[x] is only constrained on datatype. Which would mean that an Observation.value[x] constrained to string, without any other profiling done to the value[x] field, will not validate. Differential looks like this:
,
{
"id" : "Observation.value[x]",
"path" : "Observation.value[x]",
"type" : [
{
"code" : "string"
}
]
},

Has anyone else experienced this? If yes, why is it that it doesn't validate?

view this post on Zulip Grahame Grieve (Sep 18 2020 at 11:56):

can you provide a full profile and an instance? I'm not quite sure what you mean

view this post on Zulip Kirstine Rosenbeck Gøeg (Sep 18 2020 at 12:06):

I have both a profile and an example on this one: http://build.fhir.org/ig/Kirstinerosenbeck/FKInfo/branches/master/StructureDefinition-KLCommonCareSocialInformation.html
(I know the profile has a stupid name, because everything is "information", and that the IG has a silly path - it is a work i progress)

view this post on Zulip Grahame Grieve (Sep 22 2020 at 11:19):

so I validated this resource against the profile http://kl.dk/fhir/common/caresocial/StructureDefinition/KLCommonCareSocialInformation using the package from that branch:

{
  "resourceType" : "Observation",
  "id" : "MobilityInformation",
  "meta" : {
    "profile" : [
      "http://kl.dk/fhir/common/caresocial/StructureDefinition/KLCommonCareSocialInformation"
    ]
  },
  "status" : "final",
  "code" : {
    "coding" : [
      {
        "system" : "urn:oid:1.2.208.176.2.21",
        "code" : "J3",
        "display" : "Mobilitet"
      }
    ]
  },
  "subject" : {
    "reference" : "Patient/Judith"
  },
  "effectiveDateTime" : "2020-08-11T15:28:17-01:00",
  "valueString" : "Judith har faldtendens, men er meget dedikeret ift. at lære at bruge sin rollator indendørs og udendørs, og desuden går hun en tur på 30min hver dag"
}

view this post on Zulip Grahame Grieve (Sep 22 2020 at 11:19):

I got this output:

view this post on Zulip Grahame Grieve (Sep 22 2020 at 11:19):

|FHIR Validation tool Version 5.1.11-SNAPSHOT (Git# 8a11bd2e9b6f). Built 2020-09-16T06:48:26.711+10:00 (6 days old)
  Java:   1.8.0_251 from C:\Program Files\Java\jre1.8.0_251 on amd64 (64bit). 14526MB available
  Paths:  Current = c:\temp, Package Cache = C:\Users\graha\.fhir\packages
  Params: C:\temp\mobility.json -ig C:\temp\package-dk.tgz -profile http://kl.dk/fhir/common/caresocial/StructureDefinition/KLCommonCareSocialInformation
Scanning for versions (no -version parameter):
  Package C:\temp\package-dk.tgz: 4.0
-> use version 4.0
Loading
  Load FHIR v4.0 from hl7.fhir.r4.core#4.0.1 - 4575 resources (00:03.0826)
  Terminology server http://tx.fhir.org - Version 1.0.349 (00:02.0927)
  Load C:\temp\package-dk.tgz+  .. load IG from hl7.fhir.us.core#3.1.0 - 228 resources (00:00.0922)
  Get set...  go (00:00.0002)
Validating
  Profiles: [http://kl.dk/fhir/common/caresocial/StructureDefinition/KLCommonCareSocialInformation]
  Validate C:\temp\mobility.json 00:00.0116
Done. Times: Loading: 00:08.0168, validation: 00:00.0116

*FAILURE*: 1 errors, 0 warnings, 1 notes
  Error @ Observation.code (line 11, col17) : None of the codes provided are in the value set http://kl.dk/fhir/common/caresocial/ValueSet/KLInformationCodes (http://kl.dk/fhir/common/caresocial/ValueSet/KLInformationCodes), and a code from this value set is required) (codes = urn:oid:1.2.208.176.2.21#J3)
  Information @ Observation.code.coding[0] (line 12, col8) : Code System URI 'urn:oid:1.2.208.176.2.21' is unknown so the code cannot be validated

view this post on Zulip Kirstine Rosenbeck Gøeg (Sep 23 2020 at 08:00):

Thanks. That is an expected error - sorry I didn't catch that before I decided this was a great example. No errors regarding the validation of valueString so that is great. Wonder if @Signe Hejgaard Kristoffersen could remember more details about what it is that won't validate in their system?


Last updated: Apr 12 2022 at 19:14 UTC