Stream: implementers
Topic: Parsing Question
Gregg Ripley (Jul 01 2021 at 19:10):
Greetings. I am an experienced software engineer with beginners knowledge of FHIR and message structures. I recently been tasked with converting a set of file extracts so I can load them into a relational DB (i.e. SQL). I am struggling to understand how to parse these files as I am getting parsing errors. For example, I am attempting to parse the "Condition" entity and I get this error: "Exception thrown: 'Hl7.Fhir.ElementModel.StructuralTypeException' in Hl7.Fhir.Support.dll
Additional information: Type checking the data: Encountered unknown element 'resourceId' at location 'Condition.resourceId[0]' while parsing
"
My environment is .NET and leveraging the R5 Core SDK library. The data set's documentation indicated as "These resources are FHIR R5 preview 2 (version 4.4) compliant. This version may change in future releases. ". The data is in json representation with a single extract in each folder. Each folder represents a data entity (condition, patient, encounter, etc). A sample of a single line is demonstrated at the end of my message.
I apologize if this is the wrong group or message board for this type of posting. If that is the case, please direct me to the appropriate location. Any help on this would be greatly appreciated. If I could be directed to a good resource would be equally appreciated.
Thanks
Gregg
Release Format
FHIR and FHIR+ resources are delivered in new line delimited json files (ndjson). Schema files are delivered as a text file that contains a json object.
FHIR Resources
FHIR resources have the following top-level keys/values:
resourceId – logical id, an extraction of resource.id
resource – FHIR resource content
Further information regarding the structure of each resource can be found by referencing the corresponding hl7.org FHIR schema.
{
"resourceId": "{GUID}",
"resource": {
"abatementDateTime": "{DateTime}",
"clinicalStatus": {
"coding": [
{
"code": "{integer}",
"display": "{condition display}",
"system": "{systemId}"
}
],
"text": "Resolved"
},
"code": {
"coding": [
{
"code": "{integer}",
"display": "{condition display}",
"system": "{systemId}"
}
],
"text": "{Symptom Description}"
},
"id": "{GUID}",
"identifier": [
{
"system": "{SystemURL},
"type": {
"coding": [
{
"code": "{Code Name}",
"display": "{Code Name}",
"system": "{SystemURL}"
}
],
"text": "{Code Name}"
},
"use": "{use}",
"value": "{Integer}"
},
{
"system": "{System Id},
"type": {
"coding": [
{
"code": "{Code}",
"display": "{Display}",
"system": "http://hl7.org/v2/diagnosis-id"
}
],
"text": "DXID"
},
"use": "{use}",
"value": "{Integer}"
}
],
"meta": {
"lastUpdated": "{DateTime}"
},
"onsetDateTime": "{DateTime}",
"resourceType": "Condition",
"subject": {
"reference": "{Guid}",
"type": "Patient"
}
}
Grahame Grieve (Jul 01 2021 at 19:18):
ask in #dotnet but I don't think it supports v4.4
Michele Mottini (Jul 01 2021 at 20:01):
The Condition resource is just the "resource" object, not the entire JSON, so you should extract and parse only that piece
Last updated: Apr 12 2022 at 19:14 UTC