FHIR Chat · integer64 · fhir/infrastructure-wg

Stream: fhir/infrastructure-wg

Topic: integer64


view this post on Zulip Grahame Grieve (Dec 06 2019 at 02:00):

I'm going through adding the integer64 type. I'm going to use it for Attachment.size....

view this post on Zulip Bryn Rhodes (Dec 06 2019 at 03:04):

Well that's future proof :)

view this post on Zulip Josh Mandel (Dec 06 2019 at 03:23):

Yeah, didn't realize we effectively had a 2Gb limit

view this post on Zulip Lloyd McKenzie (Dec 06 2019 at 04:04):

Is that something that can be done without breaking our backward compatibility rules?

view this post on Zulip Paul Church (Dec 06 2019 at 04:15):

Bundle.total for use in searchset? I guess that one is already normative though.

view this post on Zulip Grahame Grieve (Dec 06 2019 at 04:18):

Bundle.total > 2billion? really?

view this post on Zulip Grahame Grieve (Dec 06 2019 at 04:19):

Is that something that can be done without breaking our backward compatibility rules?

how would it break them?

view this post on Zulip Lloyd McKenzie (Dec 06 2019 at 05:13):

New systems could send values that would blow up old systems

view this post on Zulip Grahame Grieve (Dec 06 2019 at 05:21):

yep. If we're going to make a rule that that's not an allowed change, we can shut up shop once we go normative

view this post on Zulip Josh Mandel (Dec 06 2019 at 06:04):

In fact every value from the new system would be a string in JSON, which would break every old system... This seems like something pretty highly undesirable for a normative resource.

view this post on Zulip Paul Church (Dec 06 2019 at 06:04):

There wouldn't be a bundle with 2^31 entries (I hope), but you could have a search matching over 2^31 resources. Large numbers have come up in cases where a client wanted to do a search with _summary=count to get some broad statistics.

view this post on Zulip Grahame Grieve (Dec 06 2019 at 06:41):

carumba. that's still a very big number.

view this post on Zulip Paul Church (Dec 06 2019 at 16:35):

The normative spec needs to be stable for a long time though - 10 years from now it might not sound so large.

view this post on Zulip Jason Walonoski (Dec 09 2019 at 22:43):

Just add a BigInteger. Which in java is equivalent to -2^Integer.MAX_VALUE to 2^Integer.MAX_VALUE.... which is very very big.

view this post on Zulip Marco Visser (Jan 16 2020 at 14:37):

I see in the json examples (examples-json.zip) that the integer64 values are serialized as strings. For example the size attribute of contentAttachment in the file communication-example-fm-attachment.json:

  "payload": [
    {
      "contentAttachment": {
        "contentType": "application/pdf",
        "data": "SGVsbG8\u003d",
        "title": "accident notes 20100201.pdf",
        "creation": "2010-02-01T11:50:23-05:00"
      }
    },
    {
      "contentAttachment": {
        "contentType": "application/pdf",
        "url": "http://example.org/docs/AB12345",
        "size": "104274",
        "hash": "SGVsbG8gdGhlcmU\u003d",
        "creation": "2010-02-01T10:57:34+01:00"
      }
    }
  ]

Should that not be like this:

        "size": 104274,

?

view this post on Zulip Lloyd McKenzie (Jan 16 2020 at 15:07):

@Grahame Grieve

view this post on Zulip Gino Canessa (Jan 16 2020 at 16:35):

If you don't serialize as strings in JSON, the JavaScript parser stores as number and you lose precision. The 64-bit libs for JavaScript serialize to/from string to get around it.
We had a discussion when we were proposing adding the type.

view this post on Zulip Brian Postlethwaite (Jan 16 2020 at 22:12):

And it is documented on the json page in the spec too that in json it is serializer as a string.

view this post on Zulip Brian Postlethwaite (Jan 16 2020 at 22:12):

(I had to go look when I saw it)

view this post on Zulip Grahame Grieve (Jan 17 2020 at 00:20):

yep. we hate JSON numbers ;-)

view this post on Zulip Marco Visser (Jan 20 2020 at 09:22):

Haha ok. then I hate them too. I will serialize them as strings then. Thanks for the feedback!


Last updated: Apr 12 2022 at 19:14 UTC