Skip to content
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

Add string-union FhirResourceType #71

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Add string-union FhirResourceType #71

wants to merge 5 commits into from

Conversation

GinoCanessa
Copy link
Contributor

Added a string-union of known resources named FhirResourceType. Per discussion on Zulip.

@jdjkelly
Copy link
Contributor

:shipit:

@ir4y
Copy link

ir4y commented Aug 31, 2021

@GinoCanessa
I think there is a simpler way to define FhirResourceType rather than codegen.

interface Patient {
  readonly resourceType: 'Patient'
}

interface Practitioner {
  readonly resourceType: 'Practitioner'
} 

type FhirResource = Patient | Practitioner

type FhirResourceType = FhirResource['resourceType']

https://www.typescriptlang.org/play?ssl=12&ssc=1&pln=1&pc=1#code/JYOwLgpgTgZghgYwgAgApzMC5kG8CwAUMslBHACYD2IANgJ6kQDOVArlEgCr0AOEALmQBydJmxhhRAL5EioSLEQpUURJkw1oeIiTKUaDJqw7c+gkavXBNIaFMLTkcwmHPIAYgAtgUAEos7JwoALxoGFg4AD5oaggawFpQLm78nj7+gaYQPGlh3r4BJsEA2sJkxWb8wgC6LkRAA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants