FHIR Chat · launching fhirserver instance from FPC/Lazarus build · pascal

Stream: pascal

Topic: launching fhirserver instance from FPC/Lazarus build


view this post on Zulip Rob Hausam (Aug 02 2021 at 20:29):

I'm copying this to continue the thread from pm discussions on July 23-26:
@Grahame Grieve @Jose Costa Teixeira @Mark Iantorno

Rob Hausam: I think it’s pretty close on FPC, though, as I can compile and run the console there. Will need to get that working. Or use a Windows machine for the moment.

Grahame Grieve: It compiles on fpc for me but you must have the trunk version

Jose Costa Teixeira: Trunk of FPC, of Lazarus, or trunk of the server code?

Rob Hausam: We've been installing FPC and Lazarus via fpcupdeluxe, installing from trunk but also the specific revisions 47781 for FPC and 64209 for Lazarus. That was what worked previously, but maybe it's moved on since - maybe it's best now to update to the latest trunk revisions of both. I may try doing that, and see how it goes.

Grahame Grieve: Perhaps you should give me details of what the compile problems are

Rob Hausam: @Grahame Grieve I don't have any compile problems with it now. I'm able to compile fhirserver on Win 64 with the latest trunk versions of FPC/Lazarus. I just had to explicitly add the paths for the units for a number of the tests to get that working. And I've copied the same cfg and other files for the db, etc., including 'tzdata.tar.gz', but when I try to launch the server I'm getting: TTZException: Zone not found [] then it immediately dies.

Grahame Grieve: Have to debug that one - I’ve never seen it

Rob Hausam: @Grahame Grieve I've been able to partly work around that, but there seems to be some issues with fsl_utilities and/or PascalTZ on FPC. To get part the initial timezone issue I commented out the lines for 'initializeTZData' and setting 'tz := TimeZoneBias;' and hardcoded it to UTC with 'tz := 0;', which worked for that part:
Screen-Shot-2021-07-26-at-09.52.41.png
But when it's loading the r4 endpoint it runs into timezone issues again. When I step into line 147 I get this exception in upascaltz.pas:
Screen-Shot-2021-07-26-at-09.46.54.png

There are also some weird issues with ODBC, which mainly seem to be about FPC not being able for some reason to correctly parse the 'db-type' from fhirserver.cfg. It claims Terminology Server using Unknown database type mysql, even though it's set to mysql in the cfg file (and that works in Delphi).
Screen-Shot-2021-07-26-at-10.10.13.png
The current cfg file is: fhirserver.cfg

It would be good if we can get this fully working on FPC/Lazaurus (or inform us if you already have).

view this post on Zulip Jose Costa Teixeira (Aug 02 2021 at 20:43):

I think the unknown type mysql is due to a typo

view this post on Zulip Rob Hausam (Aug 02 2021 at 20:44):

I don't think so - but I'm double checking now, as I had an incorrect copy of the file shown before (that's why I removed it for the moment).

view this post on Zulip Jose Costa Teixeira (Aug 02 2021 at 20:46):

utilities.pas, lines 332 and 350,
there's a part that reads
sameText(details['type'].value, 'mysql') - that should be
sameText(details['db-type'].value, 'mysql')

view this post on Zulip Jose Costa Teixeira (Aug 02 2021 at 20:46):

without that, this works for mssql (a few lines above you can see that for msswl the typo is not there

view this post on Zulip Rob Hausam (Aug 02 2021 at 20:47):

I fixed that in my instance first, though - and I'll double check, too, that I actually did make that fix

view this post on Zulip Rob Hausam (Aug 02 2021 at 20:48):

the same cfg file and code worked for 'mysql' in Delphi, but not in FPC/Lazarus

view this post on Zulip Rob Hausam (Aug 02 2021 at 21:04):

I added the link to the cfg file in the post above. I had fixed the syntax errors that you mentioned (should be 'db-type') in my copy that I was building. That's also where I had to do an additional work-around to get as far with it as I did.

view this post on Zulip Jose Costa Teixeira (Aug 02 2021 at 22:33):

the cfg file seems fine

view this post on Zulip Rob Hausam (Aug 03 2021 at 01:14):

yes


Last updated: Apr 12 2022 at 19:14 UTC