FHIR Chat · IG with no resources · IG creation

Stream: IG creation

Topic: IG with no resources


view this post on Zulip Carl Anderson (Jul 10 2020 at 17:42):

I'm trying to create an IG for SMART Web Messaging using the existing markdown, but this project doesn't define any new resources. I'm having a hard time figuring out how to make the publisher work without resources using fhir.base.template. Should this be possible? Is there a different template that will allow zero resources?

I'm stuck, any help is appreciated!

view this post on Zulip Lloyd McKenzie (Jul 10 2020 at 18:02):

Right now, ImplementationGuide requires a minimum of one resource. We've agreed to relax that, but I don't think it's been applied yet. In theory, the publisher should run even if there aren't any, but it's possible there's some logic that blows up.

view this post on Zulip Jose Costa Teixeira (Jul 10 2020 at 18:07):

I have an ig with no resources and it still builds

view this post on Zulip Carl Anderson (Jul 10 2020 at 18:22):

Should the IG xml contain an empty <resource> section? Or should it be omitted completely?

view this post on Zulip Carl Anderson (Jul 10 2020 at 18:23):

And does it matter which template is used?

view this post on Zulip Carl Anderson (Jul 10 2020 at 18:24):

When I run the publisher with an empty <resource> list, I get this stack track:

Error : Missing source reference on a reesource in the IG with the name 'null' (index = 0)
   org.hl7.fhir.igtools.publisher.Publisher.load(Publisher.java:2967)
   org.hl7.fhir.igtools.publisher.Publisher.createIg(Publisher.java:842)
   org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:708)
   org.hl7.fhir.igtools.ui.IGPublisherFrame$BackgroundPublisherTask.doInBackground(IGPublisherFrame.java:265)
   org.hl7.fhir.igtools.ui.IGPublisherFrame$BackgroundPublisherTask.doInBackground(IGPublisherFrame.java:254)
   java.desktop/javax.swing.SwingWorker$1.call(SwingWorker.java:304)
   java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
   java.desktop/javax.swing.SwingWorker.run(SwingWorker.java:343)
   java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
   java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
   java.base/java.lang.Thread.run(Thread.java:835)

view this post on Zulip Carl Anderson (Jul 10 2020 at 18:28):

When I omit the <resource> element entirely, I get an error in the qa.html output (which I think means it fails in validation)

Path: ImplementationGuide/hl7.fhir.smart-web-messaging: ImplementationGuide.definition
Severity: error
Message: Profile http://hl7.org/fhir/StructureDefinition/ImplementationGuide, Element 'ImplementationGuide.definition.resource': minimum required = 1, but only found 0

view this post on Zulip Carl Anderson (Jul 10 2020 at 18:31):

When I leave the resource in place I get a build error in the qa.html page:

Implementation Guide    error   The link 'Patient-example.html' for "fake generated link" cannot be resolved

view this post on Zulip Carl Anderson (Jul 10 2020 at 18:33):

In my case, I have a trivial 'example patient' just to give the publisher a resource to iterate over.

{
  "resourceType": "Patient",
  "id": "example"
}

view this post on Zulip Lloyd McKenzie (Jul 10 2020 at 18:35):

Error in QA is unavoidable right now

view this post on Zulip Lloyd McKenzie (Jul 10 2020 at 18:36):

We won't stop you from publishing on that basis

view this post on Zulip Carl Anderson (Jul 10 2020 at 18:37):

Aha, great. Is there a way to satisfy the auto publisher, then? Because I find that no index.html is generated when validation fails.

view this post on Zulip Lloyd McKenzie (Jul 10 2020 at 18:38):

That shouldn't happen - presence of qa.html errors shouldn't impact publication

view this post on Zulip Lloyd McKenzie (Jul 10 2020 at 18:38):

Are there other errors in your log?

view this post on Zulip Carl Anderson (Jul 10 2020 at 18:41):

The other thing I notice at the top of the qa.html page is:

HL7 Publication check:

History Page 'null' is wrong (ig.json#paths/history) - must be 'https://hl7.org/fhir/smart-web-messaging/history.html'
package-list.json: file not found in /Users/can/code/work

view this post on Zulip Carl Anderson (Jul 10 2020 at 18:41):

Would that prevent publication?

view this post on Zulip Carl Anderson (Jul 10 2020 at 18:42):

I also see this: IG Publisher Version: v1.1.2, which is out of date. The current version is v1.0.101-SNAPSHOT Download Latest

view this post on Zulip Lloyd McKenzie (Jul 10 2020 at 18:45):

Nothing in the qa.html should make any difference. What does the build log say?

view this post on Zulip Carl Anderson (Jul 10 2020 at 18:47):

I'm running the publisher in GUI mode for now. I'm committing to the repo to trigger the autobuilder when I think I've made progress.

The local publisher output looks like this:

Package Cache: /Users/can/.fhir/packages
Load Configuration from /Users/can/code/work/ig.json
Root directory: /Users/can/code/smart-web-messaging
Terminology Cache is at /Users/can/fhircache. 1 files in cache
Load Terminology Cache from /Users/can/fhircache
Connect to Terminology Server at http://tx.fhir.org
Load Content
Processing Conformance Resources
Generating Narratives
Validating Resources
Processing Provenance Records
Generating Outputs in /Users/can/code/smart-web-messaging/output
Generating Summary Outputs
Sending Usage Stats to Server
Jekyll: Source: /Users/can/code/smart-web-messaging/temp
Jekyll: Generating...
Jekyll: done in 0.198 seconds.
Checking Output HTML
  ... 437 html files, 0 pages invalid xhtml (0%)
  ... 0 links, 0 broken links (0%)
Build final .zip
Final .zip built
Finished. 00:03.0503. Validation output in /Users/can/code/smart-web-messaging/output/qa.html
Errors: 1, Warnings: 1, Info: 0, Broken Links = 0
Done

view this post on Zulip Carl Anderson (Jul 10 2020 at 18:48):

And then in qa.html I only see this error: Element 'ImplementationGuide.definition.resource': minimum required = 1, but only found 0

view this post on Zulip Carl Anderson (Jul 10 2020 at 18:49):

I just pushed to my repo and triggered an autobuild. Same thing.
https://build.fhir.org/ig/HL7/smart-web-messaging/qa.html

view this post on Zulip Lloyd McKenzie (Jul 10 2020 at 18:52):

Weird. I guess try fixing those first two errors. Perhaps @Grahame Grieve has gotten more militant... :)

view this post on Zulip Carl Anderson (Jul 10 2020 at 18:52):

This is the build.log from the autobuilder (with redundant lines elided):

INFO:root:about to clone!
DEBUG:root:running: git clone --recursive https://github.com/HL7/smart-web-messaging --branch master repo
DEBUG:root:Time to deadline 3479.997153 seconds
Cloning into 'repo'...
DEBUG:root:running: wget -q https://github.com/HL7/fhir-ig-publisher/releases/latest/download/publisher.jar -O publisher.jar
DEBUG:root:Time to deadline 3479.43063 seconds
DEBUG:root:running: npm -g install fsh-sushi
DEBUG:root:Time to deadline 3477.961726 seconds
/usr/local/bin/sushi -> /usr/local/lib/node_modules/fsh-sushi/dist/app.js
+ fsh-sushi@0.14.0
updated 2 packages in 4.66s
DEBUG:root:running: java -Xms14000m -Xmx14000m -jar ../publisher.jar -ig ig.json -auto-ig-build -target https://build.fhir.org/ig/HL7/smart-web-messaging/ -out /scratch/ig-build-temp-4BDMC2/repo
DEBUG:root:Time to deadline 3472.882052 seconds
FHIR IG Publisher Version 1.1.2 (Git# cfc87d2acaf7). Built 2020-07-07T12:30:26.385Z (3 days old)
File log: /tmp/fhir-ig-publisher-tmp.log
Detected Java version: 15-ea from /usr/java/openjdk-15 on amd64 (64bit). 13533MB available
Parameters: -ig ig.json -auto-ig-build -target https://build.fhir.org/ig/HL7/smart-web-messaging/ -out /scratch/ig-build-temp-4BDMC2/repo

dir = /scratch/ig-build-temp-4BDMC2/repo, path = /usr/local/rvm/bin:/usr/local/rvm/rubies/ruby-2.5.1/bin:/usr/java/openjdk-15/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Run time = Friday, July 10, 2020 at 6:45:49 PM Coordinated Universal Time (2020-07-10T18:45:49Z)
Package Cache: var/lib/.fhir/packages                                            (00:00.0018)
Load Configuration from /scratch/ig-build-temp-4BDMC2/repo/ig.json               (00:00.0019)
Root directory: /scratch/ig-build-temp-4BDMC2/repo                               (00:00.0027)
Check folders                                                                    (00:00.0027)
Source: /scratch/ig-build-temp-4BDMC2/repo/docs                                  (00:00.0027)
Temp: /scratch/ig-build-temp-4BDMC2/repo/temp                                    (00:00.0028)
Output: /scratch/ig-build-temp-4BDMC2/repo/output                                (00:00.0028)
Temp: /scratch/ig-build-temp-4BDMC2/repo/qa                                      (00:00.0033)
Terminology Cache is at /tmp/fhircache. Trimming now                             (00:00.0033)
Core Package hl7.fhir.r5.core#current
Installing hl7.fhir.r5.core#current to the package cache
  Fetching:............................................................................................................
  .....................
  Installing: ........................................................................................................................
  ......... done.
Checking hl7.fhir.core-current currency                                          (00:09.0642)
   ...  ok: is 3, must be 3                                                      (00:09.0642)
Load hl7.fhir.core-current package from var/lib/.fhir/packages/hl7.fhir.r5.core#current (00:09.0642)
Load Terminology Cache from /tmp/fhircache                                       (00:18.0112)
Connect to Terminology Server at http://tx.fhir.org                              (00:18.0113)
Connect to http://tx.fhir.org/r4                                                 (00:18.0278)
2020-07-10 18:46:08.036 [main] INFO  o.h.f.u.c.BasePackageCacheManager [BasePackageCacheManager.java:75] Failed to resolve package hl7.fhir.pubpack#0.0.6 from server: http://packages.fhir.org
Installing hl7.fhir.pubpack#0.0.6 to the package cache
  Fetching:.........
  Installing: ......... done.
Load Package hl7.fhir.pubpack#0.0.6
2020-07-10 18:46:08.772 [main] INFO  o.h.f.u.c.BasePackageCacheManager [BasePackageCacheManager.java:75] Failed to resolve package hl7.fhir.xver-extensions#0.0.4 from server: http://packages.fhir.org
Installing hl7.fhir.xver-extensions#0.0.4 to the package cache
  Fetching:
  Installing:  done.
Load Package hl7.fhir.xver-extensions#0.0.4
Initialization complete                                                          (00:19.0763)
Load Content                                                                     (00:19.0763)
Loaded Files: 1                                                                  (00:19.0833)
  /scratch/ig-build-temp-4BDMC2/repo/docs/ImplementationGuide-hl7.fhir.smart-web-messaging - 1 Resources (00:19.0833)
    ImplementationGuide/hl7.fhir.smart-web-messaging                             (00:19.0833)
Processing Conformance Resources                                                 (00:19.0833)
process type: NamingSystem                                                       (00:19.0833)
...
process type: TestScript                                                         (00:19.0835)
process res: ImplementationGuide/hl7.fhir.smart-web-messaging                    (00:19.0835)
Generate Snapshots                                                               (00:19.0838)
validate res: ImplementationGuide/hl7.fhir.smart-web-messaging                   (00:19.0840)
gen narratives                                                                   (00:19.0894)
narrative for /scratch/ig-build-temp-4BDMC2/repo/docs/ImplementationGuide-hl7.fhir.smart-web-messaging : hl7.fhir.smart-web-messaging (00:19.0894)
check profiles                                                                   (00:19.0894)
validate Expressions                                                             (00:19.0899)
scanForUsageStats                                                                (00:19.0899)
Generating Narratives                                                            (00:19.0899)
gen narratives                                                                   (00:19.0899)
narrative for /scratch/ig-build-temp-4BDMC2/repo/docs/ImplementationGuide-hl7.fhir.smart-web-messaging : hl7.fhir.smart-web-messaging (00:19.0899)
Validating Resources                                                             (00:19.0900)
 .. validate /scratch/ig-build-temp-4BDMC2/repo/docs/ImplementationGuide-hl7.fhir.smart-web-messaging (00:19.0900)
 .. /scratch/ig-build-temp-4BDMC2/repo/docs/ImplementationGuide-hl7.fhir.smart-web-messaging (00:19.0900)
 .. check Profile Examples                                                       (00:19.0900)
gen narratives                                                                   (00:19.0900)
Processing Provenance Records                                                    (00:19.0900)
Generating Outputs in /scratch/ig-build-temp-4BDMC2/repo/output                  (00:19.0900)
Produce resources for ImplementationGuide/hl7.fhir.smart-web-messaging           (00:19.0908)
Produce outputs for ImplementationGuide/hl7.fhir.smart-web-messaging             (00:19.0939)
Generating Summary Outputs                                                       (00:19.0953)
Sending Usage Stats to Server                                                    (00:20.0168)
Jekyll: Source: /scratch/ig-build-temp-4BDMC2/repo/temp                          (00:20.0561)
Jekyll: Generating...                                                            (00:20.0561)
Jekyll: done in 0.064 seconds.                                                   (00:20.0622)
Checking Output HTML                                                             (00:20.0647)
CheckHTML: List files                                                            (00:20.0648)
found 437 files                                                                  (00:20.0650)
Loading Files                                                                    (00:20.0650)
Load /scratch/ig-build-temp-4BDMC2/repo/output/icon-fhir-32.png                  (00:20.0650)
...
Load /scratch/ig-build-temp-4BDMC2/repo/output/tbl_bck0000111100.png             (00:20.0665)
Load /scratch/ig-build-temp-4BDMC2/repo/output/ImplementationGuide-hl7.fhir.smart-web-messaging.xml (00:20.0665)
Load /scratch/ig-build-temp-4BDMC2/repo/output/tbl_bck10000.png                  (00:20.0669)
...
Load /scratch/ig-build-temp-4BDMC2/repo/output/tbl_bck11100.png                  (00:20.0716)
Checking Files                                                                   (00:20.0716)
Check /scratch/ig-build-temp-4BDMC2/repo/output/ImplementationGuide-hl7.fhir.smart-web-messaging.json (00:20.0717)
Check /scratch/ig-build-temp-4BDMC2/repo/output/ImplementationGuide-hl7.fhir.smart-web-messaging.ttl (00:20.0717)
Check /scratch/ig-build-temp-4BDMC2/repo/output/ImplementationGuide-hl7.fhir.smart-web-messaging.xml (00:20.0717)
...
Check /scratch/ig-build-temp-4BDMC2/repo/output/validator.pack                   (00:20.0720)
Checking Other Links                                                             (00:20.0720)
Done checking                                                                    (00:20.0720)
  ... 437 html files, 0 pages invalid xhtml (0%)                                 (00:20.0722)
  ... 0 links, 0 broken links (0%)                                               (00:20.0722)
Build final .zip                                                                 (00:20.0722)
Final .zip built                                                                 (00:20.0766)
Finished. 00:00.0932. Validation output in /scratch/ig-build-temp-4BDMC2/repo/output/qa.html
Errors: 1, Warnings: 1, Info: 0, Broken Links = 0 (00:20.0931)
Done                                                                             (00:20.0931)

view this post on Zulip Carl Anderson (Jul 10 2020 at 18:53):

Anyway, thanks for taking a look at this Lloyd.

view this post on Zulip Carl Anderson (Jul 10 2020 at 18:58):

@Jose Costa Teixeira - can I look at your IG without resources so I can compare it to mine?

view this post on Zulip Jose Costa Teixeira (Jul 10 2020 at 19:03):

I started today to strip down the template to a really empty one - I still have lots of errors. (I thought you meant errors that prevented the build, but if you mean QA errors, i currently have 36 of them..)

view this post on Zulip Jose Costa Teixeira (Jul 10 2020 at 19:06):

down to 3 now...

view this post on Zulip Jose Costa Teixeira (Jul 10 2020 at 19:13):

yep, the error there is the constraint - one resource needed

view this post on Zulip Jose Costa Teixeira (Jul 10 2020 at 19:29):

I can't find where this constraint is defined

view this post on Zulip Carl Anderson (Jul 10 2020 at 19:42):

I filed this a few days ago: https://github.com/HL7/fhir-ig-publisher/issues/125

But I don't understand where the phrase minimum required = X, but only found Y is being defined in code. I found no matches in the HL7 github organization searching for but only found (except for one mention in a suppressedWarnings file).

view this post on Zulip Lloyd McKenzie (Jul 10 2020 at 19:44):

You're violating a cardinality restriction in the resource. ImplementationGuide says there must be at least one resource. The "minimum required = X" message is firing because you're violating that requirement. FHIR-I has approved a change request to loosen the cardinality. However, for an R4 IG, it's always going to be there and always going to yell.

view this post on Zulip Carl Anderson (Jul 10 2020 at 19:46):

Got it. So, is there a workaround? Also, does that explain why I am not getting an index.html generated for the IG? I still don't understand why that's not happening.

view this post on Zulip Lloyd McKenzie (Jul 10 2020 at 19:53):

I suspect that's due to one of the messages at the top of your IG, not because of the missing resource declaration. Make sure you've got your package-list.json defined. If that doesn't fix it, we can try to figure out why your history URL is wrong...

view this post on Zulip Jose Costa Teixeira (Jul 10 2020 at 20:07):

(I was looking at constraints, forgot the obvious cardinality.)

view this post on Zulip Jose Costa Teixeira (Jul 10 2020 at 20:07):

@Carl Anderson if you want, I will be working on the empty ig here:
https://github.com/hl7-be/empty-ig

view this post on Zulip Grahame Grieve (Jul 10 2020 at 20:21):

I guess try fixing those first two errors

Which 2 errors? I don't understand?

view this post on Zulip Carl Anderson (Jul 10 2020 at 20:23):

I didn't have a package-list.json, and History Page 'null' is wrong (ig.json#paths/history) - must be 'https://hl7.org/fhir/smart-web-messaging/history.html'

view this post on Zulip Grahame Grieve (Jul 10 2020 at 20:30):

well, you'll need to fix both those before submitting for publication but they have nothing to do with generation. (@Lloyd McKenzie they're not new either)

view this post on Zulip Lloyd McKenzie (Jul 10 2020 at 21:17):

@Josh Mandel The log says the build was successful, but there's no index.html file on the CI-build - even though there is in the local build. Any idea what's going on?

view this post on Zulip Carl Anderson (Jul 10 2020 at 21:56):

I get the same behavior when I run the latest publisher locally. I get a qa.html after a reported successful build, but no index.html.

view this post on Zulip Carl Anderson (Jul 10 2020 at 21:57):

And the only remaining error in the log is in the n/a section:

n/a
Implementation Guide    error   The link 'Patient-example.html' for "fake generated link" cannot be resolved

view this post on Zulip Carl Anderson (Jul 10 2020 at 21:58):

https://build.fhir.org/ig/HL7/smart-web-messaging/qa.html

view this post on Zulip Josh Mandel (Jul 13 2020 at 16:49):

@Lloyd McKenzie this isn't an auto-ig-builder issue because Carl's having the same problem locally.

view this post on Zulip Carl Anderson (Jul 13 2020 at 19:07):

@Lloyd McKenzie - sorry I didn't catch what you said on Friday - there's no local index.html (or history.html, for that matter). So, this is appears to be a publisher issue.

view this post on Zulip Carl Anderson (Jul 13 2020 at 19:08):

There's also no clue as to why in the terminal where I launch the publisher, or in the qa.html output. It seems like (maybe) something is swallowing an exception somewhere, but this is just my hunch.

view this post on Zulip Grahame Grieve (Jul 13 2020 at 19:16):

why do you think it should produce an index.html?

view this post on Zulip Carl Anderson (Jul 13 2020 at 19:22):

Full disclosure, this is the first time I've tried to use the publisher (and the autobuilder) - so I am far from an expert. However, that's what I thought the publisher is supposed to do. When I tested the sample-ig, that's what it did - so I expected the same behavior.

view this post on Zulip Lloyd McKenzie (Jul 13 2020 at 19:24):

Do you have a page called index.md or index.xml that's referenced in your IG?

view this post on Zulip Carl Anderson (Jul 13 2020 at 19:25):

This is what I feed sushi:

can@msft-mbp ~/code/work/ig/fsh (master) $ tree
.
├── config.yaml
└── ig-data
    ├── ig.ini
    └── input
        ├── examples
        │   └── patient-example.json
        ├── ignoreWarnings.txt
        └── pagecontent
            └── index.md

view this post on Zulip Carl Anderson (Jul 13 2020 at 19:27):

This is what sushi produces:

can@msft-mbp ~/code/work/ig/build/input (master) $ tree
.
├── ImplementationGuide-hl7.fhir.smart-web-messaging.json
├── examples
│   └── Patient-example.json
├── ignoreWarnings.txt
├── includes
│   └── menu.xml
└── pagecontent
    └── index.md

view this post on Zulip Carl Anderson (Jul 13 2020 at 19:30):

When I run _genonce.sh on the sushi output, that produces an index.html in an output folder.

However, when I try to run the publisher in GUI mode and I provide it my ig.json, it behaves differently and fails to generate an index.html.

view this post on Zulip Carl Anderson (Jul 13 2020 at 19:32):

So, knowing all that. Am I just missing something from my ig.json?

{
  "canonicalBase": "https://hl7.org/fhir/smart-web-messaging",
  "source": "ImplementationGuide-hl7.fhir.smart-web-messaging.xml",
  "fixed-business-version": "1.0.0",
  "license" : "Apache-2.0",
  "logging" : ["init", "progress", "context", "html", "tx"],
  "paths" : {
    "resources" : [
      "docs"
     ],
    "pages" : [
    ],
    "qa": "qa",
    "history": "https://hl7.org/fhir/smart-web-messaging/history.html"
  },
  "resources": {
    "Patient/example": {
    }
  },
  "npm-name" : "hl7.fhir.smart-web-messaging",
  "tool" : "jekyll"
}

view this post on Zulip Jose Costa Teixeira (Jul 13 2020 at 19:33):

you shouldn't need an ig.json

view this post on Zulip Carl Anderson (Jul 13 2020 at 19:34):

Should I use the ig.ini that sushi emits?

view this post on Zulip Grahame Grieve (Jul 13 2020 at 19:35):

yes.

view this post on Zulip Carl Anderson (Jul 13 2020 at 19:40):

Wow, that worked.

view this post on Zulip Carl Anderson (Jul 13 2020 at 19:41):

Thank you @Grahame Grieve , @Lloyd McKenzie , @Jose Costa Teixeira, @Josh Mandel & everyone else reading along.


Last updated: Apr 12 2022 at 19:14 UTC