FHIR Chat · UHN Test Server · hapi

Stream: hapi

Topic: UHN Test Server


view this post on Zulip Tara Oskam (Jul 07 2016 at 18:13):

Hello, I am currently creating a communication resource which contains a immunization, relatedperson, patient and organization resource.

view this post on Zulip Tara Oskam (Jul 07 2016 at 18:14):

Upon submit, the contained immunization resource vanishes, as does the contentReference from the communication resource

view this post on Zulip Tara Oskam (Jul 07 2016 at 18:15):

fhir.jpg

view this post on Zulip Tara Oskam (Jul 07 2016 at 18:16):

Note the posted resource has 4 contained resources and 3 in payload, while the returned resource has 3 contained and 2 in payload

view this post on Zulip Tara Oskam (Jul 07 2016 at 18:16):

I have posted the immunization resource separately on it's own successfully.

view this post on Zulip James Agnew (Jul 07 2016 at 18:57):

One possible cause of this is that one of your contained resources isn't actually referred to by the containing resource (or by another contained resource). If a contained resource isn't actually addressable via the outer resource it isn't valid, so HAPI removes it.

view this post on Zulip Tara Oskam (Jul 07 2016 at 19:36):

var fhirObject = { resource: { resourceType: "Communication", contained: [ { resourceType: "Patient", id: "Patient1", identifier: [ { use: "official", system: "[id-system-global-base]/ca-on-patient-hcn", value: "unknown" } ], name: [ { use: "official", family: [ clientInfo.lastName ], given: [ clientInfo.firstName ] } ], gender: clientInfo.gender, birthDate: clientInfo.dateOfBirth, address: [ { extension: [ { url: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-houseNumber", valueString: clientInfo.addressStreetNumber }, { url: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetName", valueString: clientInfo.addressStreetName }, { url: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetNameType", valueString: "unknown" }, { url: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-direction", valueString: "unknown" }, { url: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-unitID", valueString: "unknown" } ], use: "home", line: [ "unknown" ], city: clientInfo.addressCity, state:clientInfo.addressProvince, postalCode: "unknown" } ], contact: [ { organization: { reference: "#OrgSchool1" } } ] }, { resourceType: "RelatedPerson", id: "RelatedPerson1", patient: { reference: "#Patient1" }, relationship: { coding: [ { system: "http://hl7.org/fhir/patient-contact-relationship", code: relationshipToClient } ] }, name: { family: [ lastName ], given: [ firstName ] }, telecom: [ { system: "phone", value: phone1Number, use: phone1Type } ] }, { resourceType: "Organization", id: "OrgSchool1", identifier: [ { system: "[id-system-local-base]/school-id", value: "unknown" } ], name: "unknown" }, { resourceType: "Immunization", id: "Immunization1", status: "completed", date: "2016-02-14T10:22:00-05:00", vaccineCode: { coding: [ { system: "http://snomed.info/sct", code: "61153008", display: "MMR measles + mumps + rubella unspecified" } ], text: "MMR Priorix GSK" }, patient: { reference: "#Patient1" }, wasNotGiven: false, reported: true, note: { text: "Was given MMR vaccine in a walk-in clinic" } } ], identifier: [ { system: "[id-system-local-base]/submission-id", value: "1000212" } ], sender: { reference: "#RelatedPerson1" }, payload: [ { contentAttachment: { contentType: "image/gif", data: "…" } }, { contentString: "Scanned copy of MRM immunization receipt and Flu shot chart page" }, { contentReference: { reference: "#Immunization1" } } ], status: "completed", sent: "", received: "", subject: { reference: "#Patient1" } } };

view this post on Zulip James Agnew (Jul 07 2016 at 19:37):

That will look way better if you make it a markdown snippet... put ``` at the very start and again at the very end

view this post on Zulip James Agnew (Jul 07 2016 at 19:38):

Sweet, way better. So which one is missing after you post and fetch it?

view this post on Zulip Tara Oskam (Jul 07 2016 at 19:39):

Thank you, I reviewed the object, it appears as though all of the contained resources are referenced. Immunization is missing. Also, when I post, the contentReference: with "#Immunization1" also disappears.

view this post on Zulip Tara Oskam (Jul 07 2016 at 19:39):

http://fhirtest.uhn.ca/baseDstu3/Communication/111211/_history/1

view this post on Zulip James Agnew (Jul 07 2016 at 19:50):

Oh fascinating.

I had a look, that's actually a bug in the RI Java STU3 structures... the @Child annotation is missing "reference" from the list of types it supports. Weird!

        @Child(name = "content", type = {StringType.class, Attachment.class}, order=1, min=1, max=1, modifier=false, summary=true)
        @Description(shortDefinition="Message part content", formalDefinition="A communicated content (or for multi-part communications, one portion of the communication)." )
        protected Type content;

view this post on Zulip James Agnew (Jul 07 2016 at 19:51):

Will investigate a bit later, but presumably your code is correct and will work once I've fixed this bug.

view this post on Zulip James Agnew (Jul 07 2016 at 19:59):

Issue 399 here: https://github.com/jamesagnew/hapi-fhir/issues/399

view this post on Zulip Tara Oskam (Jul 08 2016 at 13:48):

Thank you so much James! I appreciate it!

view this post on Zulip Tara Oskam (Jul 12 2016 at 18:24):

@Grahame Grieve I am having the same issue listed in this discussion with http://fhir3.healthintersections.com.au/open

view this post on Zulip Tara Oskam (Jul 12 2016 at 18:25):

I can post the immunization resource:

view this post on Zulip Tara Oskam (Jul 12 2016 at 18:25):

var new_immunization = { resource: { "resourceType": "Immunization", // "id": "Immunization1", "status":"completed", "date": "2015-06-22", "vaccineCode": {"coding": [{ "system":"http://snomed.info/sct", "code": "7931000087106", "display": "DTaP-IPV-Hib"}], "text":"DTaP-IPV-Hib"}, "patient": {"reference": "http://fhirtest.uhn.ca/baseDstu3/Patient/21561/_history/1"}, "wasNotGiven": false, "reported": true } }

view this post on Zulip Tara Oskam (Jul 12 2016 at 18:26):

But when I try to post the same immunization contained in a communication resource, referenced by payload contentReference, the POST is unsuccessful

view this post on Zulip Tara Oskam (Jul 12 2016 at 18:26):

Full object in earlier conversation.

view this post on Zulip Tara Oskam (Jul 12 2016 at 18:45):

example immunization successful: http://fhir3.healthintersections.com.au/open/Immunization/_search?_id=1

view this post on Zulip Tara Oskam (Jul 12 2016 at 18:46):

example communication: http://fhir3.healthintersections.com.au/open/Communication/_search?_id=11

view this post on Zulip James Agnew (Jul 12 2016 at 21:55):

FYI @Tara Oskam this issue should be fixed now if you want to try again..

view this post on Zulip Grahame Grieve (Jul 12 2016 at 22:03):

and then try again on my server, because I really think that was a client issue not s erver issue (even though I'm usually wrong when I say that)

view this post on Zulip James Agnew (Jul 12 2016 at 22:14):

That would be a heck of a coincidence if the same issue was also happening on your server, considering this was a very HAPI-specific bug :)

view this post on Zulip Tara Oskam (Jul 13 2016 at 12:53):

(deleted)

view this post on Zulip Tara Oskam (Jul 13 2016 at 12:53):

(deleted)

view this post on Zulip Tara Oskam (Jul 13 2016 at 12:54):

(deleted)

view this post on Zulip Tara Oskam (Jul 13 2016 at 12:54):

(deleted)

view this post on Zulip Tara Oskam (Jul 13 2016 at 12:57):

(deleted)

view this post on Zulip Tara Oskam (Jul 13 2016 at 13:05):

(deleted)

view this post on Zulip Tara Oskam (Jul 13 2016 at 13:09):

pasted image

view this post on Zulip Tara Oskam (Jul 13 2016 at 13:10):

(deleted)

view this post on Zulip Tara Oskam (Jul 13 2016 at 13:18):

@Grahame Grieve @James Agnew Ah, the issue was mine. I had contentReference: "#Immunization1", modifying this to contentReference: { reference: "#Immunization1"} resolved the issue

view this post on Zulip Tara Oskam (Jul 13 2016 at 13:18):

thank you for looking into this issue for me

view this post on Zulip James Agnew (Jul 13 2016 at 13:27):

Hehe np! You uncovered a pretty nasty bug actually, so... thanks for that :)


Last updated: Apr 12 2022 at 19:14 UTC