-
Notifications
You must be signed in to change notification settings - Fork 11
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 4 typescript #964
base: main
Are you sure you want to change the base?
Fhir 4 typescript #964
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
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 way to sketch out the value of the builder APIs. Not sure we're coming out ahead yet
Accidentally used an overly restrictive mapping
this includes referneces to @types/fhir with _ props removed works in unit tests now, hurrah!
…le imported fhir types
plus some tool tidyups
now we get instant type tracking in the builders
Warning! this will break the generated codegit status
…aptors into fhir-4-typescript
I've just been doing my final flight checks, getting ready for release and running some extra tests. And I've hit the weirdest issue. It's taken a while to whittle it down to barebones. If I make type Identifier = {
foo: 'string';
bar: 'string';
};
declare const identifier: (id: Identifier) => string;
export { identifier }; Everything is fine, I get code assist in monaco for the identifier. if I change the signature to this:
I get no type assist at all. It's like adding the string union blows it up. A union like Works just fine in the monaco playground for 0.43 (the version we're running) I've disabled the magic code completion stuff. Still breaks. Edit: it works if I disable Edit #2: same in Monaco playground. With nolib it's totally bailing on this type support. |
I think I'm gonna have to cut out these |
Ok, incredibly, what we have to do is add this in the es5 language definition in Monaco:
I don't understand it at all - but the type tracking totally breaks down when typings for Raising a PR against Lightning now. |
FHIR r4 adaptor with auto-generated typescript.
Replaces #909
This is a fully typescript implementation, so we get really good type definitions out of it, which gives us great code-assist support.
I am not using the npm
fhir
package for typings. It just doesn't work very well for us, and introduces a problem bundling for Monaco. Also it exposes_
variants of each property, for extensions. Which really pollutes the code assist.Code assist is now provided in test files (which makes writing unit tests easier AND more lightning-like) as well as in Lightning. I've tested it locally, works great.
Major changes:
b.patient('Patient', { ...})
orb.patient({ ... })
. Profile names aren't actually needed or useful here, but I want to keep API consistency with the IG adaptors. It works well.Still do to before release:
datatypes
stuff into builders, so you can dob.concept
,b.identifier
.Properly extract meta and text properties from the generator, and let uses provide extension hooks for this in the mappings fileDONEdeceased[x]
.Also note that this totally breaks the implementation guide generator. I'm tracking that in #955
Spin out issues to do later:
AI Disclaimer
I used a little Claude wisdom to help work out how to handle some of the typings.