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

How to specify base profiles? #201

Open
seanmcilvenna opened this issue Oct 27, 2022 · 1 comment
Open

How to specify base profiles? #201

seanmcilvenna opened this issue Oct 27, 2022 · 1 comment

Comments

@seanmcilvenna
Copy link

seanmcilvenna commented Oct 27, 2022

I'm using fhirToFsh(fhir[, options]) to convert a JSON resource to an FSH string...
It's returning an error: Cannot reliably export top-level caret rules for XXX because GoFSH cannot find a definition for its parent: https://YYYY.
I looked through the options for a way to provide the base/parent profile definition, but there doesn't seem to be a way. The only way I can see is to specify a dependency to an IG... But, in this case, the profile I'm converting to FSH is part of the same IG as the base/parent profile, and the IG isn't published.
Is it possible to provide fhirToFsh() the definition of the parent profile to avoid this error? If not, can I request that a change be made to support this?

Perhaps, for example:

const options = {
  dependencies: ['uscore@1.0.1'],
  relatedProfiles: [ profile2, profile ],
};
const fsh = fhirToFsh(profile1, options);
@cmoesel
Copy link
Member

cmoesel commented Oct 27, 2022

The fhirToFsh function takes an array of FHIR resources. So you could just include the related profiles in the main array you pass in. If you don't want their FSH, then use the map style so you can easily select the FSH for just the things you want (or remove the FSH you don't want from the resulting maps). The only caveat is that if any of the related profiles have errors converting to FSH, then those will get reported too (even though they might not be the main profiles of interest for you).

I think your suggestion is worth considering, but in the mean time, would the approach described above meet your needs?

E.g.

const options = {
  dependencies: ['uscore@1.0.1'],
  style: 'map',
};
const fshMaps = fhirToFsh([profile1, profile2, profile], options);

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

No branches or pull requests

2 participants