New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML encoding problem of some resources #29

Closed
akley opened this Issue Sep 25, 2014 · 5 comments

Comments

Projects
None yet
2 participants
@akley
Contributor

akley commented Sep 25, 2014

After encoding a resource, resource' properties are modified. It seems that BaseParser.java works not correctly. If the same resource is encoded again, the created xml is not the same for some resources, like Composition.

Here could be the beginning of the problem:
public void containResourcesForEncoding(IResource theResource) {
containResourcesForEncoding(theResource, theResource);
}

@jamesagnew

This comment has been minimized.

Owner

jamesagnew commented Sep 26, 2014

Ok, I've got your test case running locally, and I see the issue. What... strange... behaviour. :)

@akley

This comment has been minimized.

Contributor

akley commented Sep 26, 2014

Yeah, thats really strange. For me, I have been created a workaround.
Streaming of serialized resources (IElement.java extents Serializable): creating real copy of composition with ByteArrayOutput/InputStream and encoding of the copied composition. But thats only a workaround, sideeffect not considered.
So I hope to fix it asap ;)

Thanks in advance

@jamesagnew

This comment has been minimized.

Owner

jamesagnew commented Sep 26, 2014

At some point I'd like to get a deep copy utility done, which uses the FHIR terser/visitor to just copy everything from one to another.. As you mentioned in a previous email you can't just do a bean copy since HAPI isn't bean spec compliant (by design, limiting ourselves to bean spec would have prevented us from adding a lot of the nice method chaining we implemented) but it wouldn't be hard. (Plus, the .NET API has this and it makes me jealous!)

This is such an interesting example you provided. Even the first encode is wrong actually, the patient appears twice.

@akley

This comment has been minimized.

Contributor

akley commented Sep 26, 2014

Great work James! I am full of anticipation for the coming release :)
Btw: this was may first run on github to apply some code in another project - thanks to you!

Can you roughly estimate when you release 0.7?

@jamesagnew

This comment has been minimized.

Owner

jamesagnew commented Sep 26, 2014

I've been using GutHub for a while now, but HAPI-FHIR is my first attempt
at using it to its full potential too.. It really is neat how it works.

We've been averaging a release every 6 weeks lately (hopefully this pace
will slow down at some point!) so I'd expect we'll put out 0.7 at some
point in October.

Note though that I'm publishing regular snapshot builds to Maven, so if
you're comfortable with using a snapshot you should see this change within
the next day or two.

Cheers,
James

On Fri, Sep 26, 2014 at 11:31 AM, akley notifications@github.com wrote:

Great work James! I am full of anticipation for the coming release :)
Btw: this was may first run on github to apply some code in another
project - thanks to you!

Can you roughly estimate when you release 0.7?


Reply to this email directly or view it on GitHub
#29 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment