FHIR Chat · Since type Identifier is not a primitive, it cannot.... · dotnet

Stream: dotnet

Topic: Since type Identifier is not a primitive, it cannot....


view this post on Zulip Phillip Partridge (Dec 13 2019 at 14:42):

Busy adding a FHIR connection to our healthcare application.

We are using the fhir-net-api (C#) (Hl7.Fhir.STU3) and i'm getting some errors. I have no problems opening the many example
documents found on the internet. I am a little bit lost, am I doing something wrong or is my third party
not using the standards.

The error messages:

System.FormatException: Type checking the data: Since type Identifier is not a primitive, it cannot have a value (at Patient.generalPractitioner[0].identifier[0])
at Hl7.Fhir.Serialization.ComplexTypeReader.Deserialize(ClassMapping mapping, Base existing)
at Hl7.Fhir.Serialization.DispatchingReader.Deserialize(PropertyMapping prop, String memberName, Object existing)
at Hl7.Fhir.Serialization.RepeatingElementReader.Deserialize(PropertyMapping prop, String memberName, IList existing)
at Hl7.Fhir.Serialization.DispatchingReader.Deserialize(PropertyMapping prop, String memberName, Object existing)
at Hl7.Fhir.Serialization.ComplexTypeReader.read(ClassMapping mapping, IEnumerable`1 members, Base existing)
at Hl7.Fhir.Serialization.ComplexTypeReader.Deserialize(ClassMapping mapping, Base existing)
at Hl7.Fhir.Serialization.ResourceReader.Deserialize(Resource existing)
at Hl7.Fhir.Serialization.PocoBuilder.<>c__DisplayClass8_0.<BuildFrom>g__build|0()
at Hl7.Fhir.Serialization.PocoBuilder.BuildFrom(ITypedElement source)
at Hl7.Fhir.Serialization.PocoBuilder.BuildFrom(ISourceNode source, String dataType)
at Hl7.Fhir.Serialization.PocoBuilder.BuildFrom(ISourceNode source, Type dataType)
at Hl7.Fhir.Serialization.FhirJsonParser.Parse(String json, Type dataType)
at Hl7.Fhir.Serialization.FhirJsonParser.ParseT

and

System.FormatException: Type checking the data: Since type Identifier is not a primitive, it cannot have a value (at Patient.extension[0].valueReference[0].identifier[0])
at Hl7.Fhir.Serialization.ComplexTypeReader.Deserialize(ClassMapping mapping, Base existing)
at Hl7.Fhir.Serialization.DispatchingReader.Deserialize(PropertyMapping prop, String memberName, Object existing)
at Hl7.Fhir.Serialization.ComplexTypeReader.read(ClassMapping mapping, IEnumerable1 members, Base existing) at Hl7.Fhir.Serialization.ComplexTypeReader.Deserialize(ClassMapping mapping, Base existing) at Hl7.Fhir.Serialization.DispatchingReader.Deserialize(PropertyMapping prop, String memberName, Object existing) at Hl7.Fhir.Serialization.RepeatingElementReader.Deserialize(PropertyMapping prop, String memberName, IList existing) at Hl7.Fhir.Serialization.DispatchingReader.Deserialize(PropertyMapping prop, String memberName, Object existing) at Hl7.Fhir.Serialization.ComplexTypeReader.read(ClassMapping mapping, IEnumerable1 members, Base existing)
at Hl7.Fhir.Serialization.ComplexTypeReader.Deserialize(ClassMapping mapping, Base existing)
at Hl7.Fhir.Serialization.ResourceReader.Deserialize(Resource existing)
at Hl7.Fhir.Serialization.PocoBuilder.<>c__DisplayClass8_0.<BuildFrom>g__build|0()
at Hl7.Fhir.Serialization.PocoBuilder.BuildFrom(ITypedElement source)
at Hl7.Fhir.Serialization.PocoBuilder.BuildFrom(ISourceNode source, String dataType)
at Hl7.Fhir.Serialization.PocoBuilder.BuildFrom(ISourceNode source, Type dataType)
at Hl7.Fhir.Serialization.FhirJsonParser.Parse(String json, Type dataType)
at Hl7.Fhir.Serialization.FhirJsonParser.ParseT

The problem nodes are the following (this is exactly as I recieve the data):

"generalPractitioner": [
{
"display": "HJ JANSEN",
"identifier": "01000298",
"reference": "/fhir/Practitioner?identifier=01000298"
}
]

and

"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/nl-core-preferred-pharmacy",
"valueReference": {
"display": "Zandvoortse Apotheek",
"identifier": "02079755",
"reference": "/fhir/Organization?identifier=02079755"
},
"valueString": ""
}
]

If I remove "identifier" from both these nodes then my errors go away.

Thank you,
Phillip

view this post on Zulip Michele Mottini (Dec 13 2019 at 14:48):

Yes, those two identifiers are wrong, they should be "identifier": { "value": "....." }

view this post on Zulip Phillip Partridge (Dec 13 2019 at 14:56):

Have those identifiers ever been correct? I get the feeling the organization I am connecting to aren't really using the FHIR standards. Generating look-a-like documents.

view this post on Zulip Michele Mottini (Dec 13 2019 at 15:03):

No. always wrong. Previous version of FHIR did not have "identifier" at all - so still wrong


Last updated: Apr 12 2022 at 19:14 UTC