When I try to update an observation resource with an encounter reference to link the observation to a specific encounter using CRUD, it fails with the following error:
"Object with id: null was not of the specified subclass: edu.gatech.i3l.fhir.dstu2.entities.Person (class of the given object did not match class of persistent copy)"
I can't tell which object it is claiming is null, because every attribute in the JSON for the request has a corresponding value.
I'm using the following JSON syntax for the update:
{
"resourceType":"Observation",
"code":{
"coding":[
{
"system":"http://loinc.org",
"code":"8302-2"
}
]
},
"valueQuantity":{
"value":175.3,
"units":"cm",
"system":"http://unitsofmeasure.org",
"code":"cm"
},
"appliesDateTime":"2015-10-26T23:59:00-04:00",
"status":"final",
"reliability":"ok",
"subject":{
"reference":"Patient/468"
},
"encounter":{ "reference":"336" }
}
I'm doing this on a test instance of FHIR. I created a new patient, a new encounter, and a new observation, and I now want to link the observation to the encounter. How is this done? Why wouldn't that JSON syntax work when that is the format returned when I search for the observation? I only added one attribute, the encounter reference.