FHIR Chat · Max length of fields · implementers

Stream: implementers

Topic: Max length of fields


view this post on Zulip Jan-Marc Verlinden (May 20 2019 at 16:57):

Hi all, is there a min and max for field length predefined in HAPI already? Or how would we do this?

view this post on Zulip Lloyd McKenzie (May 20 2019 at 17:12):

MaxLength is defined as a standard element in StructureDefinition. minLength is an extension. @James Agnew ?

view this post on Zulip Jan-Marc Verlinden (May 20 2019 at 17:32):

We use STU3 and we cannot find any StructureDefinition with the field MaxLength inside. Right now we can insert max 1MB, so that means about 100.000 characters or so. Maybe you could help us out here?
Question 2: Where would we find a list of field validation for clinical or demographic data, would you have any idea? I was thinking of Snomed or Loinc, but don't know anymore.. :-). I found the OWASP cheatsheet that helps a lot already, but of course not for any clinical data. https://github.com/OWASP/CheatSheetSeries

view this post on Zulip Lloyd McKenzie (May 20 2019 at 18:54):

FHIR doesn't define max lengths for anything other than String - which I don't think we surface using that extension. maxLength would only appear in profiles.

view this post on Zulip Lloyd McKenzie (May 20 2019 at 18:54):

Can you explain what you mean by "field validation"?

view this post on Zulip James Agnew (May 21 2019 at 14:55):

HAPI doesn't enforce any maximum field lengths by default.

One thing that often trips people up though is that many containers (e.g. Tomcat/Jetty) and HTTP proxies (e.g. Nginx/Apache) enforce a maximum body size on HTTP post. If you want to deal with large resources you may need to increase this via configuration on the server itself.

view this post on Zulip Jan-Marc Verlinden (May 21 2019 at 17:36):

Yes is (or would be..) defined in the (Dutch) profiles. For some of the clinical profiles this is the case, but not for any demographic data (as far as I can tell..). So this means that HAPI doesn't matter that PatientName has a max of 1MB of characters (maybe 100.000)? Or you just leave it up to the implementer. Or how did other implementers solve this?


Last updated: Apr 12 2022 at 19:14 UTC