-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fhir v4 #909
base: main
Are you sure you want to change the base?
fhir v4 #909
Conversation
Core fhir definitions seem use a different bundle structure to the regular IG definitions. Basically the folder structure is a bit different and the resources are all captured in a single bundle. This commit adds a solution which seems to work in fhir 4 at least
Bit of a false start this afternoon as it turns out that the core fhir definitions seem to use a different structure to the definitions downloaded from IG guides. But I figured that out and I've now managed to download the fhir 4 spec and generate a basic adaptor for it. I'll tune that up an get the basics submitted, then start working on improvements. |
Put each profile in its own file, and just the entrypoints in builders.js
We need these for the docsite anyway - but they're not a good solution for driving ts
A good dev day today with improvements, plus some good news and mixed. In brief I have:
There does seem to be an issue where once we've built to I seriously flirted with adopting a typescript-first implementation today. There are many benefits to this. The biggest reason NOT to is that I have to re-write most of the code generator to use the TypeScript AST (which has a horrible interface) Also worth noting is one failing test which requires investigation. Next steps, I think, are:
I also think the basic datatype builders probably need work (and definitely testing). |
I am not sure how to handle examples :( In fhir 4, there is an 18mb zip file of examples. There are like 22 different patient examples. They do not have metadata attached. Also, they're a different bundle, so it feels like a different command to generate these examples. And it's a lot harder to write into an existing test file. All I really want is one or two test examples to include as stubs, and invite users to jump in and fill them out to exercise the API. But looking at it like this, there's no way. It'll just have to be a manual process. Shame. |
A good way to sketch out the value of the builder APIs. Not sure we're coming out ahead yet
Spend some time manually building out a Patient example today: see
The data structure is large, admittedly. But the builder so far only provides small gains. We can simplify things like codeable concepts. And we can take that further if we can cleverly integrate value sets (so we can map a code like M to a particular valueset and "expand it" into a full concept). These small gains are lightly supported by docs, which roughly describe the properties of a patient (they're a bit coarse and they contain errors), and some code-complete, although this is disappointing (until/unless we swap out to typescript). So at the moment, it feels a bit like the builders are generating thousands and thousands of lines of extra code for very minor benefits in user experience. I am starting to doubt the benefit of his work. The builders are supposed to provide excellent, clean docs; great code-assist help to make creating data structures a breeze; and significant simpification of mappings (ie, remove the need to create verbose structures and manually import long system codes). We're not really there yet. |
How much better would I feel if the generated adaptor was just SMALLER?
A smart prune would make me feel a bit better. The problem of "generating a lot of data for not much reward" goes away if we don't generate much data. |
Accidentally used an overly restrictive mapping
Ok, so I've removed INACTIVE profiles an FOUNDATIONAL profiles. That brings me from 329 files down to 268. That's about 20% less stuff. Not bad. |
TODO: when using options like Also, |
Spend a few hours today experimenting with generating TypeScript 🙀 Basically the problem is: when I'm generating js code, I have to bend over backwards to support code assist. And even then, it's not working very well and I can't take advantage of existing fhir typings. So I'm trying to figure out of a minimal typescript implementation will produce a more robust type system. It should. I'm about half-way through regenerating in typescript and it's looking promising. Should be able to report back tomorrow. A lot of time is going into this. But it's worth remembering the goal here is first-class documentation and code assist while authoring fhir types. If we can't deliver that, then the utility of these auto-generated fhir adaptors is significantly decreased. |
WIP PR for fhir 4 adaptor support
Generate tests with examples?AI Usage
Please disclose how you've used AI in this work (it's cool, we just want to know!):
You can read more details in our Responsible AI Policy