-
Notifications
You must be signed in to change notification settings - Fork 9
FHIR References are altered/invalid #29
Comments
Somehow the FHIR server is rewriting our references. For Here is the offending {
"resource": {
"resourceType": "DiagnosticReport",
"id": "58b3663f3425def0f0f6af8b",
"status": "final",
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "69409-1",
"display": "U.S. standard certificate of death - 2003 revision"
}
]
},
"subject": {
"reference": "Patient/58b3663f3425def0f0f6af86"
},
"encounter": {
"reference": "Encounter/58b3663f3425def0f0f6af87"
},
"effectiveDateTime": "1999-09-18T06:51:52-04:00",
"issued": "1999-09-18T06:51:52-04:00",
"performer": [
{
"reference": "MedicationRequest/58b3663f3425def0f0f6af92"
}
],
"result": [
{
"reference": "Observation/58b3663f3425def0f0f6af8a"
}
]
},
"search": {
"mode": "include"
}
} According the Synthea source code: the 'performer' => [{ 'display' => 'Hospital Lab' }]) See https://github.com/synthetichealth/synthea/blob/master/lib/records/fhir.rb#L305 |
Interesting. It would be odd for the FHIR server to be doing that -- as the serialization parameters for DiagnosticReport are generated from the spec, and are pretty clearly pulling from the Does Synthea maintain a local cache of the FHIR records it posts to the server? Perhaps it is the FHIR server, but it would be good to confirm the actual data that is being posted first (if that's easy). |
Maybe the bulkloader then? I didn't check the raw file for that Patient (yet) but running Synthea doesn't show any results like that. In fact, there is no code within Synthea that sets any field named |
Re: the DiagnosticReport - Per the FHIR spec, I can update Synthea so that it correctly exports a Reference (or nothing, since the performer field is optional). If it's possible to modify the live data to clear out the existing performer field on all DiagnosticReports that might be ideal so that the entire data set doesn't have to be regenerated. Re: the "Resource Encounter not found, specified in path: Condition.context" issue, Synthea is correctly using a reference there, so that could still be an issue with the FHIR server. |
@dehall Let's not modify Synthea yet. First, let's check the raw input file for |
@dehall I think that what Synthea is doing is valid (although probably not ideal). If it turns out the data Synthea creates is fine (and it's starting to look that way), then the bulk loader might be a good place to start if that's how it's getting into the DB. I forgot you weren't just posting them to the FHIR API. |
You're right, Synthea is creating a Reference with no 'reference' field; Practitioner and Observation don't have the 'display' field. |
The bulk loader does modify references here: The |
Regarding the As a temporary fix, I'm going to remove the Regarding the The encounter resource being referenced (58b3663f3425def0f0f6aeb0) exists but contains only the {
"resourceType": "Encounter",
"id": "58b3663f3425def0f0f6aeb0"
} This encounter is critically missing it's |
Reported by HSPC
1. https://syntheticmass.mitre.org/fhir/Patient - to get 100 patients
2. https://syntheticmass.mitre.org/fhir/Patient//$everything - on every patient to get each patient's set of resources.
3. For those results, I build a FHIR transaction bundle to import the set of patient & patient resources as a transaction
Out of the 100 patients, only 9 import successfully in to my FHIR v1.8 server. However, if I pull patients from a server of mine where I previously pushed 2000+ patients generated with Synthea, I have full success. (When I previously imported the 2000+ patients, I saw no errors.)
I'm getting the following types of errors:
For
Patient/58b3663f3425def0f0f6af86
AND
For
Patient/58b3663f3425def0f0f6ae67
The text was updated successfully, but these errors were encountered: