Stream: implementers
Topic: xhtml type definition
Gino Canessa (Jul 09 2019 at 21:08):
Hello all, I ran across an issue with the xhtml type and was hoping to get some information.
The xhtml type (in datatypes.html) is listed under the "Special Purpose Data types" diagram as deriving from Element. However, following the link points to a usage in Narrative instead of a definition. Searching through the FHIR xml files (source/datatypes), I cannot find a definition for it.
I assume it is safe to define as a string for type checking, but didn't know if there are any properties that should be defined, etc. Is there a definition of the type?
Thanks!
Grahame Grieve (Jul 10 2019 at 22:47):
yes there is a formal definition
Gino Canessa (Jul 11 2019 at 21:14):
Hate to be a bother, but where could I find it?
I am building TypeScript definitions from the current R4 branch (writing a tool so that language bindings can be exported from local branches to help in prototyping/testing changes). In parsing all the xml files in source/datatypes, as well as source/[resource]/[resource]-spreadsheet.xml (excluding templates-spreadsheet), there are five referenced types I cannot resolve: xhtml, SimpleQuantity, MoneyQuantity, Logical, and Structure.
I found where the documentation references some (e.g., SimpleQuantity is on the Restrictions sheet of source/datatypes/quantity.xml), but I could not find that sheet defined in the Spreadsheet Authoring Guide and attempting to define types from it does not work universally (chokes on other files which use Restrictions differently).
Adding those five types manually allows everything to work, but I would prefer to pull the definitions from the proper locations.
Thanks!
Grahame Grieve (Jul 11 2019 at 21:26):
you shouldn't parse the spreadsheets, really. Use the structure definitions.
Grahame Grieve (Jul 11 2019 at 21:27):
e.g. http://hl7.org/fhir/xhtml.profile.json. A similar files exists for all the other types you mentioned
Grahame Grieve (Jul 11 2019 at 21:27):
in fact, for all types
Grahame Grieve (Jul 11 2019 at 21:27):
so build from the output, not the input
Grahame Grieve (Jul 11 2019 at 21:28):
because the java code does stuff that you'll just have to reproduce... so don't....
Gino Canessa (Jul 11 2019 at 21:35):
Ok. Was trying to make a smaller loop for "I want to work with this change". This is for testing updates as we work on defining them (not intended for production use).
My goal was to be able to develop the changes in the spreadsheets directly instead of trying to keep multiple language bindings in sync during development and then updating the spreadsheet at the end.
Grahame Grieve (Jul 11 2019 at 21:50):
I'm not understanding that at all. what changes? what multiple languages?
Gino Canessa (Jul 11 2019 at 21:57):
I'm working on subscriptions (Argonaut) right now, and there are items like additional fields that are being proposed. Many of them don't have consensus, and so I am doing client/server prototyping to figure out what works and be able to present feedback.
In this case, I am using C# on the server, and TypeScript on the client.
I thought the most sensible workflow would be to define the change in the spreadsheet, then test out the changes in the software. The problem is that the Java build of the branch takes quite a while to run, so isn't feasible for prototyping.
The other way I have been working is to make the same changes to each set of software and check them that way, it's just that it introduces another class of possible errors and takes additional time.
Grahame Grieve (Jul 11 2019 at 21:58):
i typically hack the structure definitions in that kind of workflow.
Gino Canessa (Jul 11 2019 at 21:59):
I'll try that route next then :grinning:
Gino Canessa (Jul 11 2019 at 22:00):
Thanks!
Brian Postlethwaite (Jul 11 2019 at 23:04):
If you're familiar with c#, you might take a look at the code that generates the dotnet models using t4 templates.
https://github.com/FirelyTeam/fhir-net-api/blob/develop-r4/src/Hl7.Fhir.Core/Model/Template-Model.tt
And do a variation that creates your typescript files.
If you had samples, I'd probably be able to assist too.
Gino Canessa (Jul 12 2019 at 12:50):
Thanks Brian! I'll pull that up when I get back to this later today.
Michele Mottini (Jul 13 2019 at 11:29):
Last updated: Apr 12 2022 at 19:14 UTC