Wrong Serialization of contained resources #276

Closed
hugosoares opened this Issue Dec 30, 2015 · 9 comments

Comments

Projects
None yet
3 participants
@hugosoares
Contributor

hugosoares commented Dec 30, 2015

Calling encodeResourceToString on a resource causes duplication of contained resources.
I know this sounds strange but se attached generated JSON.
The Resource object only contains a single Patient resource but the output json contains TWO DUPLICATE PATIENTS?!

MessageBundle.txt

@stefan-evinance

This comment has been minimized.

Show comment
Hide comment
@stefan-evinance

stefan-evinance Nov 24, 2016

Problem is still present with latest HAPI-FHIR .

Problem is still present with latest HAPI-FHIR .

@jamesagnew

This comment has been minimized.

Show comment
Hide comment
@jamesagnew

jamesagnew Nov 24, 2016

Owner

Hi Hugo, would you be able to provide a code sample showing how to generate these duplicates?

Owner

jamesagnew commented Nov 24, 2016

Hi Hugo, would you be able to provide a code sample showing how to generate these duplicates?

@hugosoares

This comment has been minimized.

Show comment
Hide comment
@hugosoares

hugosoares Nov 24, 2016

Contributor

Hi James,
We have stopped using contained resources and started using DSTU2 Bundles with resource entries which is a better future proof way of dealing with this.
Anyway I have tried to reproduce the problem on the latest version and I it seems that it is not happening anymore,

Maybe Stefan can help can provide an example?

Let me take this opportunity to ask for an easier way of setting entries on a bundle. It should be as easy as bundle.addEntry().setResource() and the fullUrl would be automatically set by inspecting the base (hapi needs to know the base somehow ), reource type and id.

Contributor

hugosoares commented Nov 24, 2016

Hi James,
We have stopped using contained resources and started using DSTU2 Bundles with resource entries which is a better future proof way of dealing with this.
Anyway I have tried to reproduce the problem on the latest version and I it seems that it is not happening anymore,

Maybe Stefan can help can provide an example?

Let me take this opportunity to ask for an easier way of setting entries on a bundle. It should be as easy as bundle.addEntry().setResource() and the fullUrl would be automatically set by inspecting the base (hapi needs to know the base somehow ), reource type and id.

@stefan-evinance

This comment has been minimized.

Show comment
Hide comment
@stefan-evinance

stefan-evinance Nov 24, 2016

IBaseResource resource = null;
try {
byte[] decoded = Base64.getDecoder().decode(base64blob.getBytes());
ByteArrayInputStream bis = new ByteArrayInputStream(decoded);
ObjectInputStream objectInputStream = new ObjectInputStream(bis);
resource = (IBaseResource) objectInputStream.readObject();
} catch (Exception e) {}
return FhirContext.forDstu3().newJsonParser().encodeResourceToString(resource);

rO0ABXNyAB5vcmcuaGw3LmZoaXIuZHN0dTMubW9kZWwuQ2xhaW3/////3P7OKwIAKUwACGFjY2lkZW50dAAyTG9yZy9obDcvZmhpci9kc3R1My9tb2RlbC9DbGFpbSRBY2NpZGVudENvbXBvbmVudDtMAA5iaWxsYWJsZVBlcmlvZHQAIUxvcmcvaGw3L2ZoaXIvZHN0dTMvbW9kZWwvUGVyaW9kO0wACGNvdmVyYWdldAAQTGphdmEvdXRpbC9MaXN0O0wAB2NyZWF0ZWR0ACdMb3JnL2hsNy9maGlyL2RzdHUzL21vZGVsL0RhdGVUaW1lVHlwZTtMAAlkaWFnbm9zaXNxAH4AA0wAEmVtcGxveW1lbnRJbXBhY3RlZHEAfgACTAAHZW50ZXJlcnQAJExvcmcvaGw3L2ZoaXIvZHN0dTMvbW9kZWwvUmVmZXJlbmNlO0wADWVudGVyZXJUYXJnZXR0ACdMb3JnL2hsNy9maGlyL2RzdHUzL21vZGVsL1ByYWN0aXRpb25lcjtMAAhmYWNpbGl0eXEAfgAFTAAOZmFjaWxpdHlUYXJnZXR0ACNMb3JnL2hsNy9maGlyL2RzdHUzL21vZGVsL0xvY2F0aW9uO0wADGZ1bmRzUmVzZXJ2ZXQAIUxvcmcvaGw3L2ZoaXIvZHN0dTMvbW9kZWwvQ29kaW5nO0wAD2hvc3BpdGFsaXphdGlvbnEAfgACTAAKaWRlbnRpZmllcnEAfgADTAALaW5mb3JtYXRpb25xAH4AA0wAB2luc3VyZXJxAH4ABUwADWluc3VyZXJUYXJnZXR0ACdMb3JnL2hsNy9maGlyL2RzdHUzL21vZGVsL09yZ2FuaXphdGlvbjtMAARpdGVtcQB+AANMAAxtaXNzaW5nVGVldGhxAH4AA0wADG9yZ2FuaXphdGlvbnEAfgAFTAASb3JnYW5pemF0aW9uVG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jb3JnLW9yZ3hwcHBwc3EAfgB8cHBwcHBwcHNxAH4ANHQACiNwYXRpZW50LTF4cHNyAC1vcmcuaGw3LmZoaXIuZHN0dTMubW9kZWwuQ2xhaW0kUGF5ZWVDb21wb25lbnQAAAAACGFeQgIABEwABXBhcnR5cQB+AAVMAAtwYXJ0eVRhcmdldHEAfgANTAAMcmVzb3VyY2VUeXBlcQB+AAhMAAR0eXBlcQB+AAh4cQB+AMFwcHBwcHBwcHBzcQB+AJJwcHBwcHNxAH4AlHQACHByb3ZpZGVyeHBwcHBwcHNxAH4AknBwcHBwc3EAfgCUdAAGbm9ybWFseHBwcHBwcHBwcHBwc3EAfgBdc3IANW9yZy5obDcuZmhpci5kc3R1My5tb2RlbC5DbGFpbSRDbGFpbVN0YXR1c0VudW1GYWN0b3J58bMM0NIY8L8CAAB4cHQABmFjdGl2ZXhwcHNxAH4AknBwcHBwc3EAfgCUdAAEb3JhbHhwc3EAfgAddAAgaHR0cDovL2hsNy5vcmcvZmhpci9leC1jbGFpbXR5cGV4cHBzcQB+AF1zcgAtb3JnLmhsNy5maGlyLmRzdHUzLm1vZGVsLkNsYWltJFVzZUVudW1GYWN0b3J5oalAGvtRPC0CAAB4cHQACGNvbXBsZXRleA==

IBaseResource resource = null;
try {
byte[] decoded = Base64.getDecoder().decode(base64blob.getBytes());
ByteArrayInputStream bis = new ByteArrayInputStream(decoded);
ObjectInputStream objectInputStream = new ObjectInputStream(bis);
resource = (IBaseResource) objectInputStream.readObject();
} catch (Exception e) {}
return FhirContext.forDstu3().newJsonParser().encodeResourceToString(resource);

rO0ABXNyAB5vcmcuaGw3LmZoaXIuZHN0dTMubW9kZWwuQ2xhaW3/////3P7OKwIAKUwACGFjY2lkZW50dAAyTG9yZy9obDcvZmhpci9kc3R1My9tb2RlbC9DbGFpbSRBY2NpZGVudENvbXBvbmVudDtMAA5iaWxsYWJsZVBlcmlvZHQAIUxvcmcvaGw3L2ZoaXIvZHN0dTMvbW9kZWwvUGVyaW9kO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AGbm9ybWFseHBwcHBwcHBwcHBwc3EAfgBdc3IANW9yZy5obDcuZmhpci5kc3R1My5tb2RlbC5DbGFpbSRDbGFpbVN0YXR1c0VudW1GYWN0b3J58bMM0NIY8L8CAAB4cHQABmFjdGl2ZXhwcHNxAH4AknBwcHBwc3EAfgCUdAAEb3JhbHhwc3EAfgAddAAgaHR0cDovL2hsNy5vcmcvZmhpci9leC1jbGFpbXR5cGV4cHBzcQB+AF1zcgAtb3JnLmhsNy5maGlyLmRzdHUzLm1vZGVsLkNsYWltJFVzZUVudW1GYWN0b3J5oalAGvtRPC0CAAB4cHQACGNvbXBsZXRleA==

@jamesagnew

This comment has been minimized.

Show comment
Hide comment
@jamesagnew

jamesagnew Nov 24, 2016

Owner

Is this the right example? I'm a bit confused, I don't see any contained resources in there..

Owner

jamesagnew commented Nov 24, 2016

Is this the right example? I'm a bit confused, I don't see any contained resources in there..

@stefan-evinance

This comment has been minimized.

Show comment
Hide comment
@stefan-evinance

stefan-evinance Nov 24, 2016

It is a Claim with 5 contained resources (Patient, 2x Organization, Coverage and Practitioner) but when it goes through the serializer we get JSON with 6 contained resources (2x Patient, 2x Organization, Coverage and Practitioner).

It is a Claim with 5 contained resources (Patient, 2x Organization, Coverage and Practitioner) but when it goes through the serializer we get JSON with 6 contained resources (2x Patient, 2x Organization, Coverage and Practitioner).

@jamesagnew

This comment has been minimized.

Show comment
Hide comment
@jamesagnew

jamesagnew Nov 24, 2016

Owner

I just see a bunch of base 64 text... is the idea that the base 64 text needs to be fed into an objectinputstream? Is that a requirement in order to replicate this?

Owner

jamesagnew commented Nov 24, 2016

I just see a bunch of base 64 text... is the idea that the base 64 text needs to be fed into an objectinputstream? Is that a requirement in order to replicate this?

@stefan-evinance

This comment has been minimized.

Show comment
Hide comment
@stefan-evinance

stefan-evinance Nov 24, 2016

Sorry, I wasn't clear. Instead of putting all the code needed to create a Claim resource I just serialized it and encoded as Base64. You can use the code above the Base64 blob to deserialize (assign the blob to String base64blob). This will give you a FHIR Claim resource with 5 contained resources. If you then pass it through the JSON serializer you will get 6 contained resources. The code to actually create the FHIR object was too complicated to put here.

Sorry, I wasn't clear. Instead of putting all the code needed to create a Claim resource I just serialized it and encoded as Base64. You can use the code above the Base64 blob to deserialize (assign the blob to String base64blob). This will give you a FHIR Claim resource with 5 contained resources. If you then pass it through the JSON serializer you will get 6 contained resources. The code to actually create the FHIR object was too complicated to put here.

@jamesagnew

This comment has been minimized.

Show comment
Hide comment
@jamesagnew

jamesagnew Nov 25, 2016

Owner

Right, got it. I think I figured this out, checking in a fix shortly assuming the tests pass.

Owner

jamesagnew commented Nov 25, 2016

Right, got it. I think I figured this out, checking in a fix shortly assuming the tests pass.

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