FHIR Chat · Resource name length problem · hapi

Stream: hapi

Topic: Resource name length problem


view this post on Zulip Rik Smithies (Sep 24 2019 at 17:19):

I can't POST data for the MedicinalProductContraindication resource, because HAPI doesn't like names over 30 chars.

I know there is name limit but this resource name is ok in the R4 build.

On console I get "A truncation error was encountered trying to shrink VARCHAR 'MedicinalProductContraindication' to length 30.

view this post on Zulip James Agnew (Sep 24 2019 at 19:31):

Yeah, this bug just got fixed in 4.1.0-SNAPSHOT.. Never expected a resource name > 30 chars, but that was a bad assumption. The limit has been bumped up to 100 chars

Feel free to manually increase the length of that column on an existing DB, even without upgrading your HAPI library. It won't cause any issues.

view this post on Zulip Grahame Grieve (Sep 24 2019 at 21:58):

I wonder if we should discuss this and find some limit - there's a couple of places where the length can be a problem

view this post on Zulip Gino Canessa (Sep 24 2019 at 22:12):

Presuming it should be representable by a string, there is a handy limit of 1024*1024 characters already built in. Seems reasonable to me :grinning:

view this post on Zulip Grahame Grieve (Sep 24 2019 at 22:47):

tgz package file format starts to have issues when the length gets over 23.

view this post on Zulip Rik Smithies (Sep 25 2019 at 08:53):

There is a limit in the build already. I have hit it in the past and had to shorten the name. Can't recall the number but it's more than 30.

view this post on Zulip Rik Smithies (Sep 25 2019 at 09:22):

on the new version of HAPI I get a different error "Value too long for column "RES_TYPE" VARCHAR(30)"" - which makes sense. But how can I access my jetty db to increase that? The jetty database is created on the fly I think, so is it possible for me to change the column width?

view this post on Zulip James Agnew (Sep 25 2019 at 09:51):

Ah that's harder... How are you running the server? With the HAPI FHIR CLI? Or the jpaserver starter?

view this post on Zulip Rik Smithies (Sep 25 2019 at 17:24):

it's jpaserver starter

view this post on Zulip James Agnew (Sep 25 2019 at 18:44):

in that case- easiest thing is to build from the rel_4_1_0 branch of that project. That will have the fix already included.

view this post on Zulip Rik Smithies (Sep 25 2019 at 19:40):

thanks James. When I look here https://github.com/hapifhir/hapi-fhir-jpaserver-starter/branches I see 4 branches but no rel_4_1_0. Where should I be looking please?

view this post on Zulip James Agnew (Sep 26 2019 at 20:30):

Whoops... that branch was not yet pushed. Can you try again?

view this post on Zulip Rik Smithies (Sep 27 2019 at 08:23):

thanks. Have tried that build but it seems the same ("Value too long"). When I look here https://github.com/hapifhir/hapi-fhir-jpaserver-starter/commits/rel_4_1_0, I see no commits since August 14. Am I in the right place?

view this post on Zulip James Agnew (Sep 30 2019 at 19:33):

Can you do a pull on that branch and try again? (Note that you'll need to start fresh with no database directory in place too.. such are the joys of using an embedded database)

view this post on Zulip Rik Smithies (Oct 02 2019 at 09:56):

thanks James. I've pulled that branch into a clean folder and done mvn jetty:run. I still get the same error inserting that resource. I assumed that within this folder it is using a brand new jetty database, but is it finding the old one outside of the local folder? That would explain it but I don't know how to refresh my database. I have not altered hapi.properties.

view this post on Zulip James Agnew (Oct 02 2019 at 10:12):

Hmm, very weird.. I'm assuming you had done a mvn clean first?

view this post on Zulip Rik Smithies (Oct 02 2019 at 10:27):

no. It was a brand new folder so I didnt think to clean it...

view this post on Zulip Rik Smithies (Oct 02 2019 at 10:30):

now tried mvn clean and then mvn jetty:run again, same issue, hasn't expanded the column

view this post on Zulip James Agnew (Oct 02 2019 at 10:36):

ok- one last ditch effort, can you try running it with:

mvn -U clean jetty:run

If that doesn't fix it, clearly this is a different issue than I thought it was... in that case can you share the resource you're trying to upload and I'll see if I can replicate?

view this post on Zulip Rik Smithies (Oct 02 2019 at 10:54):

same issue after that. This is enough to trigger it:
<?xml version="1.0" encoding="UTF-8"?>
<MedicinalProductContraindication xmlns="http://hl7.org/fhir">
</MedicinalProductContraindication>

view this post on Zulip James Agnew (Oct 02 2019 at 14:01):

Ok, I see it too. Pushing a fix now...

view this post on Zulip James Agnew (Oct 02 2019 at 14:28):

That's pushed. If you could try again with mvn -U clean jetty:run I sure hope this will be fixed now. :)

view this post on Zulip Rik Smithies (Oct 02 2019 at 15:43):

is it pushed yet? last commit shows as 2 days ago

view this post on Zulip James Agnew (Oct 02 2019 at 15:57):

It's a fix to the main hapi library, so the -U should pull in the latest snapshot


Last updated: Apr 12 2022 at 19:14 UTC