FHIR Chat · can we use liquid or other syntax in ig.ini? · IG creation

Stream: IG creation

Topic: can we use liquid or other syntax in ig.ini?


view this post on Zulip Jose Costa Teixeira (Jan 02 2020 at 19:42):

Minor request/ suggestion:
Can we use some syntax in ig.ini?
template = .\hl7.be.fhir.template is not ideal, because it requires the ig publisher to started from that location
template = C:\ImplementationGuides\be-core\hl7.be.fhir.template is not transportable...
Can i put something in my IG that solves this somehow?

view this post on Zulip Grahame Grieve (Jan 02 2020 at 19:56):

I don’t understand that. Why ./? Just specify a relative path

view this post on Zulip Jose Costa Teixeira (Jan 02 2020 at 20:04):

I'm trying to make ig publisher in the context menu (as you have, I think) and I want to use derived templates

view this post on Zulip Jose Costa Teixeira (Jan 02 2020 at 20:05):

when i use the _genonce in the IG folder, relative path (with or without .\) works.

view this post on Zulip Jose Costa Teixeira (Jan 02 2020 at 20:06):

but when i use the IG publisher, it launches
java -jar C:\ImplementationGuides\org.hl7.fhir.publisher.jar -ig C:\ImplementationGuides\be-core

view this post on Zulip Jose Costa Teixeira (Jan 02 2020 at 20:06):

and it cannot find the template
Unable to load template from mytemplate

view this post on Zulip Jose Costa Teixeira (Jan 02 2020 at 20:07):

because it is starting from a different path.

view this post on Zulip Jose Costa Teixeira (Jan 02 2020 at 20:07):

(which gives me an idea... let me try something)

view this post on Zulip Jose Costa Teixeira (Jan 02 2020 at 20:29):

nope. I was trying to add a "-Duser.dir" to my java command line, but that does not seem to work

view this post on Zulip Grahame Grieve (Jan 04 2020 at 19:34):

I don't understand this. where is your template (full path)? and what do lines 3 and 4 of the output log say?

view this post on Zulip Jose Costa Teixeira (Jan 04 2020 at 19:41):

hmmm...
My IG builds fine, but when I am trying to use the (Delphi) IG Publisher, it does not work because it cannot find the template

view this post on Zulip Grahame Grieve (Jan 04 2020 at 19:43):

what's the paths?

view this post on Zulip Jose Costa Teixeira (Jan 04 2020 at 19:43):

and it cannot find the template because it runs that command line (java -jar...) from wherever the EXE is.

view this post on Zulip Jose Costa Teixeira (Jan 04 2020 at 19:44):

my template is in
C:\ImplementationGuides\be-core\hl7.be.fhir.template

view this post on Zulip Jose Costa Teixeira (Jan 04 2020 at 19:45):

(as I understood it should for derived templates)

view this post on Zulip Jose Costa Teixeira (Jan 04 2020 at 19:49):

so, what I see is that the publish fails if the following happens

  • we use a derived template that is not in the cache
  • AND the derived template has a relative path (relative to the ini file)
  • AND the derived template does not exist in the same line as the IGPublisher.EXE is in

view this post on Zulip Jose Costa Teixeira (Jan 04 2020 at 19:52):

(perhaps the condition I should change is the last one...)

view this post on Zulip Grahame Grieve (Jan 04 2020 at 19:57):

when I look at the code, I see that everything is relative to the directory you nominate -ig

view this post on Zulip Grahame Grieve (Jan 04 2020 at 19:58):

so I still don't understand the problem, and you still haven't pasted the lines I asked for

view this post on Zulip Jose Costa Teixeira (Jan 04 2020 at 19:58):

the java code?

view this post on Zulip Grahame Grieve (Jan 04 2020 at 19:58):

what do lines 3 and 4 of the output log say?

view this post on Zulip Jose Costa Teixeira (Jan 04 2020 at 19:59):

(I'm re-running this to get the log,it's coming.. my Delphi is busy with snomed stuff, trying to get a previously built exe)

view this post on Zulip Jose Costa Teixeira (Jan 04 2020 at 20:18):

This log?

FHIR IG Publisher Version 1.0.37-SNAPSHOT (Git# fc345f9d0076). Built 2020-01-01T06:19:56.158+11:00 (4 days old)
Detected Java version: 1.8.0_231 from C:\Program Files\Java\jre1.8.0_231 on amd64 (64bit). 3616MB available
Parameters: -ig C:\ImplementationGuides\tempbe
dir = C:\ImplementationGuides, path = C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Java\j

view this post on Zulip Jose Costa Teixeira (Jan 04 2020 at 20:23):

the full output (using template = .\hl7.be.fhir.template in my ig.ini) is

FHIR IG Publisher Version 1.0.37-SNAPSHOT (Git# fc345f9d0076). Built 2020-01-01T06:19:56.158+11:00 (4 days old)
Detected Java version: 1.8.0_231 from C:\Program Files\Java\jre1.8.0_231 on amd64 (64bit). 3616MB available
Parameters: -ig C:\ImplementationGuides\tempbe
dir = C:\ImplementationGuides, path = C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Java\jdk-......
Run time = Sábado, 4 de Janeiro de 2020 21H22m CET (2020-01-04T21:22:41+01:00)
Package Cache: C:\Users\Jose\.fhir\packages                                      (00:00.0033)
Contacting Build Server...                                                       (00:00.0058)
 ... done                                                                        (00:03.0548)
Load Template from .\hl7.be.fhir.template                                        (00:05.0158)
Publishing Content Failed: Unable to load template from .\hl7.be.fhir.template   (00:05.0159)
                                                                                 (00:05.0159)
Use -? to get command line help                                                  (00:05.0160)
                                                                                 (00:05.0160)
Stack Dump (for debugging):                                                      (00:05.0160)
org.hl7.fhir.exceptions.FHIRException: Unable to load template from .\hl7.be.fhir.template
    at org.hl7.fhir.igtools.templates.TemplateManager.loadPackage(TemplateManager.java:189)

view this post on Zulip Jose Costa Teixeira (Jan 04 2020 at 20:27):

the command line is
java -jar C:\ImplementationGuides\org.hl7.fhir.publisher.jar -ig C:\ImplementationGuides\tempbe

view this post on Zulip Grahame Grieve (Jan 05 2020 at 00:12):

what does the ig.ini say?

view this post on Zulip Jose Costa Teixeira (Jan 05 2020 at 00:22):

ig = input/be.base.ig.xml
template = .\hl7.be.fhir.template

view this post on Zulip Jose Costa Teixeira (Jan 05 2020 at 00:24):

"hl7.be.fhir.template" is not a local package, it is the name of the folder that is in my ig.

view this post on Zulip Grahame Grieve (Jan 05 2020 at 01:59):

so a path like .\ is not supported for templates because it won't work for other people

view this post on Zulip Lloyd McKenzie (Jan 05 2020 at 02:26):

It could work for other people - but it presumes consistent organization of folder structure, which we'd generally prefer to avoid. On the other hand, the alternative is forcing projects to put their stuff in Git, which they might rather not do.

view this post on Zulip Grahame Grieve (Jan 05 2020 at 06:38):

not at all.

view this post on Zulip Grahame Grieve (Jan 05 2020 at 06:39):

you can put it anywhere you like, and do a local build, and then it will be in your cache, and you can refer to it by package id

view this post on Zulip Jose Costa Teixeira (Jan 05 2020 at 07:29):

I believe that means that a local build of the template.

view this post on Zulip Jose Costa Teixeira (Jan 05 2020 at 07:30):

The idea behind this including the derived templates) is to point someone to a github repo and say "just download this and run this command".

view this post on Zulip Jose Costa Teixeira (Jan 05 2020 at 07:31):

Requiring them to first build the template is less than ideal.

view this post on Zulip Grahame Grieve (Jan 05 2020 at 12:34):

but if you say that the template has to go in a particular relative place, then that's very much less than ideal

view this post on Zulip Jose Costa Teixeira (Jan 05 2020 at 12:45):

it goes with the IG.

view this post on Zulip Jose Costa Teixeira (Jan 05 2020 at 13:01):

the BE IG is in this situation now - it works if I run the _genOnce.bat, but not the IGPUblisher.exe.
It's not pressing at all, I just wanted to setup the tools in a way that others can use it while having their own file locations.

view this post on Zulip Jose Costa Teixeira (Jan 05 2020 at 13:02):

What is way more interesting for me now is the ability to use Lists of resources instead of Grouping in the IG - I think the Lists could even help define some of the menus. This is what I'm working on now. The IGPublisher is a nice to have.


Last updated: Apr 12 2022 at 19:14 UTC