{"action":"created","issue":{"url":"https://api.github.com/repos/jamesagnew/hapi-fhir/issues/335","repository_url":"https://api.github.com/repos/jamesagnew/hapi-fhir","labels_url":"https://api.github.com/repos/jamesagnew/hapi-fhir/issues/335/labels{/name}","comments_url":"https://api.github.com/repos/jamesagnew/hapi-fhir/issues/335/comments","events_url":"https://api.github.com/repos/jamesagnew/hapi-fhir/issues/335/events","html_url":"https://github.com/jamesagnew/hapi-fhir/issues/335","id":148813666,"number":335,"title":"'id' property gets lost in translation from JSON to XML","user":{"login":"vadi2","id":110988,"avatar_url":"https://avatars.githubusercontent.com/u/110988?v=3","gravatar_id":"","url":"https://api.github.com/users/vadi2","html_url":"https://github.com/vadi2","followers_url":"https://api.github.com/users/vadi2/followers","following_url":"https://api.github.com/users/vadi2/following{/other_user}","gists_url":"https://api.github.com/users/vadi2/gists{/gist_id}","starred_url":"https://api.github.com/users/vadi2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vadi2/subscriptions","organizations_url":"https://api.github.com/users/vadi2/orgs","repos_url":"https://api.github.com/users/vadi2/repos","events_url":"https://api.github.com/users/vadi2/events{/privacy}","received_events_url":"https://api.github.com/users/vadi2/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-04-16T03:58:16Z","updated_at":"2016-04-17T20:13:42Z","closed_at":"2016-04-17T16:58:47Z","body":"fhir3 seems to lose the 'id' property on datatypes, tested with a modified json-edge-cases.json from the FHIR spec. Search case-sensitive for ``q4`` in data below and you'll see it, POST resource to HAPI and you won't find it.\r\n\r\n```json\r\n{\r\n    \"resourceType\": \"Patient\",\r\n    \"identifier\": [{\r\n        \"period\": {\"start\": \"2001-05-06\"},\r\n        \"assigner\": {\"display\": \"Acme\\u202fHealthcare\"},\r\n        \"use\": \"usual\",\r\n        \"system\": \"urn:oid:1.2.36.146.595.217.0.1\",\r\n        \"value\": \"12345\"\r\n    }],\r\n\r\n    \"_active\": {\"extension\": [{\r\n        \"url\": \"http://example.org/fhir/StructureDefinition/recordStatus\",\r\n        \"valueCode\": \"archived\"\r\n    }]},\r\n    \"name\": [\r\n        {\r\n            \"given\": [\r\n                \"Peter\",\r\n                \"James\"\r\n            ],\r\n            \"use\": \"official\",\r\n            \"family\": [\"Chalmers\"]\r\n        },\r\n        {\r\n            \"given\": [\"Jim\"],\r\n            \"use\": \"usual\"\r\n        }\r\n    ],\r\n    \"extension\": [\r\n        {\r\n            \"url\": \"http://example.org/fhir/StructureDefinition/patientAvatar\",\r\n            \"valueReference\": {\r\n                \"reference\": \"#pic1\",\r\n                \"display\": \"Duck image\"\r\n            }\r\n        },\r\n        {\r\n            \"url\": \"http://example.org/fhir/StructureDefinition/complexExtensionExample\",\r\n            \"extension\": [\r\n                {\r\n                    \"url\": \"nestedA\",\r\n                    \"valueCoding\": {\r\n                        \"system\": \"http://demo.org/id/4\",\r\n                        \"code\": \"AB45\",\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"http://example.org/fhir/StructureDefinition/extraforcodingWithExt\",\r\n                                \"extension\": [{\r\n                                    \"url\": \"extra1\",\r\n                                    \"valueString\": \"extra info\"\r\n                                }]\r\n                            },\r\n                            {\r\n                                \"url\": \"http://example.org/fhir/StructureDefinition/extraforcodingWithValue\",\r\n                                \"valueInteger\": 45\r\n                            }\r\n\t\t\t]\r\n                    }\r\n                },\r\n                {\r\n                    \"url\": \"nestedB\",\r\n                    \"id\": \"q4\",\r\n                    \"extension\": [{\r\n                        \"url\": \"nestedB1\",\r\n                        \"valueString\": \"hello\"\r\n                    }]\r\n                }\r\n            ]\r\n        }\r\n    ],\r\n    \"modifierExtension\": [\r\n        {\r\n            \"url\": \"http://example.org/fhir/StructureDefinition/pi\",\r\n            \"valueDecimal\": 3.141592653589793\r\n        },\r\n        {\r\n            \"url\": \"http://example.org/fhir/StructureDefinition/avogadro\",\r\n            \"valueDecimal\": 6.0221416246424E23\r\n        }\r\n    ],\r\n    \"gender\": \"male\",\r\n    \"birthDate\": \"1974-12\",\r\n    \"deceasedBoolean\": true,\r\n    \"address\": [{\r\n        \"use\": \"home\",\r\n        \"line\": [\"534 Erewhon St\"],\r\n        \"city\": \"PleasantVille\",\r\n        \"state\": \"Vic\",\r\n        \"postalCode\": \"3999\"\r\n    }],\r\n    \"maritalStatus\": {\r\n      \"coding\": [{\r\n        \"system\": \"http://hl7.org/fhir/v3/NullFlavor\",\r\n        \"code\": \"UNK\",\r\n        \"display\": \"unknown\"\r\n      }]\r\n    },\r\n    \"multipleBirthInteger\": 3,\r\n    \"text\": {\r\n        \"status\": \"generated\",\r\n        \"div\": \"<div xmlns=\\\"http://www.w3.org/1999/xhtml\\\">\\n      <table>\\n        <tbody>\\n          <tr>\\n            <td>Name<\\/td>\\n            <td>Peter James <b>Chalmers<\\/b> (&quot;Jim&quot;)<\\/td>\\n          <\\/tr>\\n          <tr>\\n            <td>Address<\\/td>\\n            <td>534 Erewhon, Pleasantville, Vic, 3999<\\/td>\\n          <\\/tr>\\n          <tr>\\n            <td>Contacts<\\/td>\\n            <td>Home: unknown. Work: (03) 5555 6473<\\/td>\\n          <\\/tr>\\n          <tr>\\n            <td>Id<\\/td>\\n            <td>MRN: 12345 (Acme Healthcare)<\\/td>\\n          <\\/tr>\\n        <\\/tbody>\\n      <\\/table>\\n    <\\/div>\"\r\n    },\r\n    \"contained\": [\r\n        {\r\n            \"resourceType\": \"Binary\",\r\n            \"id\": \"pic1\",\r\n            \"contentType\": \"image/gif\",\r\n            \"content\": \"R0lGODlhEwARAPcAAAAAAAAA/+9aAO+1AP/WAP/eAP/eCP/eEP/eGP/nAP/nCP/nEP/nIf/nKf/nUv/nWv/vAP/vCP/vEP/vGP/vIf/vKf/vMf/vOf/vWv/vY//va//vjP/3c//3lP/3nP//tf//vf///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH5BAEAAAEALAAAAAATABEAAAi+AAMIDDCgYMGBCBMSvMCQ4QCFCQcwDBGCA4cLDyEGECDxAoAQHjxwyKhQAMeGIUOSJJjRpIAGDS5wCDly4AALFlYOgHlBwwOSNydM0AmzwYGjBi8IHWoTgQYORg8QIGDAwAKhESI8HIDgwQaRDI1WXXAhK9MBBzZ8/XDxQoUFZC9IiCBh6wEHGz6IbNuwQoSpWxEgyLCXL8O/gAnylNlW6AUEBRIL7Og3KwQIiCXb9HsZQoIEUzUjNEiaNMKAAAA7\"\r\n        },\r\n        {\r\n            \"resourceType\": \"Organization\",\r\n            \"id\": \"org3141\",\r\n            \"text\": {\r\n                \"status\": \"generated\",\r\n                \"div\": \"<div xmlns=\\\"http://www.w3.org/1999/xhtml\\\">\\n      <p>Good Health Clinic<\\/p>\\n    <\\/div>\"\r\n            },\r\n            \"identifier\": [{\r\n                \"system\": \"urn:ietf:rfc:3986\",\r\n                \"value\": \"2.16.840.1.113883.19.5\"\r\n            }],\r\n            \"name\": \"Good Health Clinic\"\r\n        }\r\n    ],\r\n    \"contact\": [{\r\n        \"name\": {\r\n            \"family\": [\r\n                null,\r\n                \"du\",\r\n                null,\r\n                \"Marché\",\r\n                null\r\n            ],\r\n            \"_family\": [\r\n                {\"extension\": [{\r\n                    \"url\": \"http://example.org/fhir/StructureDefinition/nullFlavor\",\r\n                    \"valueCode\": \"ASKU\"\r\n                }]},\r\n                {\r\n                    \"id\": \"a2\",\r\n                    \"extension\": [{\r\n                        \"url\": \"http://example.org/fhir/StructureDefinition/qualifier\",\r\n                        \"valueCode\": \"VV\"\r\n                    }]\r\n                },\r\n                {\"extension\": [{\r\n                    \"url\": \"http://hl7.org/fhir/StructureDefinitioniso-21090#nullFlavor\",\r\n                    \"valueCode\": \"ASKU\"\r\n                }]},\r\n                null,\r\n                {\"extension\": [{\r\n                    \"url\": \"http://hl7.org/fhir/StructureDefinition/nullFlavor\",\r\n                    \"valueCode\": \"ASKU\"\r\n                }]}\r\n            ],\r\n            \"_given\": [\r\n                null,\r\n                {\r\n                    \"id\": \"a3\",\r\n                    \"extension\": [{\r\n                        \"url\": \"http://hl7.org/fhir/StructureDefinition/qualifier\",\r\n                        \"valueCode\": \"MID\"\r\n                    }]\r\n                },\r\n                null\r\n            ],\r\n            \"given\": [\r\n                \"Bénédicte\",\r\n                \"Denise\",\r\n                \"Marie\"\r\n            ]\r\n        },\r\n        \"relationship\": [{\"coding\": [{\r\n            \"system\": \"http://hl7.org/fhir/patient-contact-relationship\",\r\n            \"code\": \"partner\"\r\n        }]}],\r\n        \"telecom\": [{\r\n            \"system\": \"phone\",\r\n            \"value\": \"+33 (237) 998327\"\r\n        }]\r\n    }],\r\n    \"careProvider\": [{\"reference\": \"#org3141\"}],\r\n    \"telecom\": [\r\n        {\"use\": \"home\"},\r\n        {\r\n            \"system\": \"phone\",\r\n            \"value\": \"(03) 5555 6473\",\r\n            \"use\": \"work\"\r\n        }\r\n    ]\r\n}\r\n```\r\n\r\nAn upload of this resource is available on [fhir3](http://fhirtest.uhn.ca/baseDstu3/Patient/6572)."},"comment":{"url":"https://api.github.com/repos/jamesagnew/hapi-fhir/issues/comments/211106762","html_url":"https://github.com/jamesagnew/hapi-fhir/issues/335#issuecomment-211106762","issue_url":"https://api.github.com/repos/jamesagnew/hapi-fhir/issues/335","id":211106762,"user":{"login":"jamesagnew","id":3465117,"avatar_url":"https://avatars.githubusercontent.com/u/3465117?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesagnew","html_url":"https://github.com/jamesagnew","followers_url":"https://api.github.com/users/jamesagnew/followers","following_url":"https://api.github.com/users/jamesagnew/following{/other_user}","gists_url":"https://api.github.com/users/jamesagnew/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesagnew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesagnew/subscriptions","organizations_url":"https://api.github.com/users/jamesagnew/orgs","repos_url":"https://api.github.com/users/jamesagnew/repos","events_url":"https://api.github.com/users/jamesagnew/events{/privacy}","received_events_url":"https://api.github.com/users/jamesagnew/received_events","type":"User","site_admin":false},"created_at":"2016-04-17T20:13:42Z","updated_at":"2016-04-17T20:13:42Z","body":"Yup, just pushed a new snapshot build with these fixes, as it happens :)\n\nsent from my phone.\nOn Apr 17, 2016 4:04 PM, \"Vadim Peretokin\" <notifications@github.com> wrote:\n\n> Thanks James. Is the latest master deployed anywhere - I've got a third\n> case I found as well, but didn't report yet as I didn't want to spam the\n> bugtracker. I'd like to test it still affects HAPI before reporting :)\n>\n> —\n> You are receiving this because you modified the open/close state.\n> Reply to this email directly or view it on GitHub\n> <https://github.com/jamesagnew/hapi-fhir/issues/335#issuecomment-211103258>\n>\n"}}