FHIR Chat · Error: StringType cannot be cast to MarkdownType · IG creation

Stream: IG creation

Topic: Error: StringType cannot be cast to MarkdownType


view this post on Zulip Richard Townley-O'Neill (Feb 13 2020 at 03:42):

IGPublisher 1.0.63 gives me

Publishing Content Failed: org.hl7.fhir.r5.model.StringType cannot be cast to org.hl7.fhir.r5.model.MarkdownType

But 1.0.62 is fine.
Where do I look for the problem?

view this post on Zulip Grahame Grieve (Feb 13 2020 at 05:43):

you tell me where to look

view this post on Zulip Grahame Grieve (Feb 13 2020 at 05:43):

where is this is in the log?

view this post on Zulip Richard Townley-O'Neill (Feb 13 2020 at 06:30):

$ pubN ig-dphr.json
FHIR IG Publisher Version 1.0.63-SNAPSHOT (Git# 9498468512c7). Built 2020-02-13T12:58:23.27+11:00 (78 mins old)
Detected Java version: 1.8.0_181 from C:\Program Files\Java\jre1.8.0_181 on amd64 (64bit). 3625MB available
Parameters: -ig ig-dphr.json
dir = C:\work\git\au-fhir-childhealth, path = C:\Users\richardtownleyoneill\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\richardtownleyoneill\bin;C:\Python27;C:\Python27\Scripts;C:\Ruby25-x64\bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\Calibre2;C:\Program Files\Git\cmd;C:\Program Files\TortoiseGit\bin;C:\Users\richardtownleyoneill\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
Run time = Thursday, 13 February 2020 1:17:21 PM AEST (2020-02-13T13:17:21+10:00)
Package Cache: C:\Users\richardtownleyoneill\.fhir\packages (00:00.0237)
Load Configuration from C:\work\git\au-fhir-childhealth\ig-dphr.json (00:00.0250)
Contacting Build Server... (00:00.0271)
... done (00:16.0987)
Root directory: C:\work\git\au-fhir-childhealth (00:16.0988)
Terminology Cache is at C:\work\git\au-fhir-childhealth\txCache. 4 files in cache (00:26.0311)
Core Package hl7.fhir.r3.core#3.0.2
Installing hl7.fhir.r3.core#3.0.2 to the package cache
Fetching:.......................................................................................
Installing: ....................................................................................... done.
Publishing Content Failed: org.hl7.fhir.r5.model.StringType cannot be cast to org.hl7.fhir.r5.model.MarkdownType (00:47.0851)
(00:47.0851)
Use -? to get command line help (00:47.0851)
(00:47.0851)
Stack Dump (for debugging): (00:47.0851)
java.lang.ClassCastException: org.hl7.fhir.r5.model.StringType cannot be cast to org.hl7.fhir.r5.model.MarkdownType
at org.hl7.fhir.convertors.conv30_50.OperationDefinition30_50.convertOperationDefinition(OperationDefinition30_50.java:52)
at org.hl7.fhir.convertors.VersionConvertor_30_50.convertResource(VersionConvertor_30_50.java:4653)
at org.hl7.fhir.convertors.R3ToR5Loader.loadBundle(R3ToR5Loader.java:65)
at org.hl7.fhir.r5.context.SimpleWorkerContext.loadFromFileJson(SimpleWorkerContext.java:295)
at org.hl7.fhir.r5.context.SimpleWorkerContext.loadDefinitionItem(SimpleWorkerContext.java:233)
at org.hl7.fhir.r5.context.SimpleWorkerContext.loadFromPackage(SimpleWorkerContext.java:326)
at org.hl7.fhir.r5.context.SimpleWorkerContext.fromPackage(SimpleWorkerContext.java:178)
at org.hl7.fhir.igtools.publisher.SpecificationPackage.fromPackage(SpecificationPackage.java:70)
at org.hl7.fhir.igtools.publisher.Publisher.loadPack(Publisher.java:2245)
at org.hl7.fhir.igtools.publisher.Publisher.loadCorePackage(Publisher.java:2208)
at org.hl7.fhir.igtools.publisher.Publisher.initializeFromJson(Publisher.java:1784)
at org.hl7.fhir.igtools.publisher.Publisher.initialize(Publisher.java:1208)
at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:659)
at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:6943)

view this post on Zulip Grahame Grieve (Feb 13 2020 at 06:34):

ok thanks

view this post on Zulip Richard Townley-O'Neill (Feb 13 2020 at 06:48):

I'm building a local copy of https://github.com/hl7au/au-fhir-childhealth

view this post on Zulip Richard Townley-O'Neill (Feb 13 2020 at 06:50):

ig-dhpr.json builds a subset of what ig.json does and builds rather faster.

view this post on Zulip Alexander Henket (Feb 13 2020 at 08:27):

This is the same one that I had. I've patched the code locally in OperationDefinition30_50.java line 52 from:

tgt.setCommentElement((org.hl7.fhir.r5.model.MarkdownType) VersionConvertor_30_50.convertType(src.getCommentElement()));

to

tgt.setCommentElement(new org.hl7.fhir.r5.model.MarkdownType(src.getCommentElement().asStringValue()));

This happened to be the only instance that needed fixing for me because my input just touched OperationDefinition.comment, but I think all String > MarkDown conversions need some attention.

view this post on Zulip Grahame Grieve (Feb 13 2020 at 10:17):

Mark is working on them. I thought I had found all the ones that mattered for IG production. I'll do another release for that one

view this post on Zulip Richard Townley-O'Neill (Feb 14 2020 at 00:33):

IGPublisher 1.0.64 works fine. :+1:


Last updated: Apr 12 2022 at 19:14 UTC