FHIR Chat · Inherit a profile in Forge · implementers

Stream: implementers

Topic: Inherit a profile in Forge


view this post on Zulip Brian Reinhold (Nov 24 2017 at 21:03):

Sometime I hate Zulip. I lost my message.
Try again.
In Forge I have created a profile called PhdBaseObservation which contains constrained elements common to all profiles. I want to 'inherit' this profile in, for example, PhdNumericObservation. How do I do that?

Thanks

view this post on Zulip Grahame Grieve (Nov 24 2017 at 21:36):

@Michel Rutten

view this post on Zulip Michel Rutten (Nov 27 2017 at 10:46):

Hi @Brian Reinhold, You can create a derived profile in Forge using the "New Derived Profile" command, which you can find in the File menu and in the Explorer toolbar. Forge will then open a file dialog for you to select an existing base profile (on disk).

view this post on Zulip Brian Reinhold (Nov 27 2017 at 11:18):

@Michel Rutten Thanks for that. While I am at it, how do I import a 'complete' profile into Simplifier and not just the difference. I think it has something to do with exporting in Forge which now gives me an XML with difference and not 'total' fields.

view this post on Zulip Lilian Minne (Nov 27 2017 at 14:40):

Hi @Brian Reinhold , in the Options menu in Forge you can select or deselect the option "Save snapshot component". By default this is not selected and your StructureDefinition is saved as a differential. By selecting this option, Forge will save the complete profile.

view this post on Zulip Brian Reinhold (Nov 27 2017 at 14:41):

Hi @Brian Reinhold , in the Options menu in Forge you can select or deselect the option "Save snapshot component". By default this is not selected and your StructureDefinition is saved as a differential. By selecting this option, Forge will save the complete profile.

Thank you Lilian

view this post on Zulip Michel Rutten (Nov 28 2017 at 11:55):

When you upload to Simplifier from Forge, the application now always emits a snapshot (regardless of the configuratio setting). As of three weeks ago, Simplifier is now capable of expanding the snapshot itself (only for DSTU3 profiles). So you should now always see a snapshot rendering on Simplifier.

view this post on Zulip Brian Reinhold (Dec 07 2017 at 17:07):

Hi @Brian Reinhold, You can create a derived profile in Forge using the "New Derived Profile" command, which you can find in the File menu and in the Explorer toolbar. Forge will then open a file dialog for you to select an existing base profile (on disk).

Okay, that is great but I currently have a set of profiles which I would like to simplify and 'base' upon a single base profile. Is there a way to modify an existing profile such that it is based upon another profile or do I have to do the non-common stuff all over again?

view this post on Zulip Michel Rutten (Dec 07 2017 at 17:16):

Hi @Brian Reinhold, Forge won't let you update the base profile, but you can do it manually by editing the JSON/XML. If you re-open the updated profile in Forge, the application will re-expand the snapshot according to the new base profile. Then Forge will re-calculate the differential and remove any redundant differential constraints (now inherited from the base). You may have to correct some constraints that have become invalid w.r.t. new base. Finally, you can save the new rebased profile.

view this post on Zulip Brian Reinhold (Dec 07 2017 at 17:19):

Okay, lets see if I understand
I have the base profile and I have a profile that I want to inherit that base profile. So I make a new project as stated and open up the base profile. I save it. Then I hand-edit the result and add the material from the profile I want to simplify. Is that correct?

view this post on Zulip Michel Rutten (Dec 07 2017 at 17:20):

I assume you've already created your new "base" profile, and that you now want to re-base all your existing profiles on top of the new base, right?

view this post on Zulip Brian Reinhold (Dec 07 2017 at 17:20):

YES!!!

view this post on Zulip Michel Rutten (Dec 07 2017 at 17:22):

Let me try to explain again...

view this post on Zulip Michel Rutten (Dec 07 2017 at 17:24):

1) Prepare your new custom "base" profile
2) Open an existing profile in a text editor
3) Edit the StructureDefinition.base property, update value to the url of your new "base" profile
4) Save to disk
5) Open the modified profile in Forge
Forge will re-expand the snapshot w.r.t. the new custom base profile
Forge will then re-calculate the differential and remove all redundant constraints (already present in new base profile)
6) Correct errors (if any)
7) Save to disk

You have now re-based your existing profile.

view this post on Zulip Brian Reinhold (Dec 07 2017 at 17:26):

Okay,

I give it a whirl!

So I try this
<baseDefinition value="PhdBaseObservation" />
instead of the old one

view this post on Zulip Michel Rutten (Dec 07 2017 at 17:30):

Just experiment with a single test profile. Once you understand the process, you can update the others.

view this post on Zulip Michel Rutten (Dec 07 2017 at 17:32):

Correct, point the value of StructureDefinition.baseDefinition to the canonical url (!) of your new base profile.

view this post on Zulip Brian Reinhold (Dec 07 2017 at 17:33):

I get this error no matter what I try to open ( I deleted a file). But I am only trying to open a single file, not an IG or anything like that.

2017-12-07T12:32:00
Forge Forge 16.5 for HL7 FHIR STU3
Version: Version 16.5.0.0
FHIR Version: FHIR .NET API library for 3.0.1


FileNotFoundException in mscorlib:
Could not find file 'E:\projects\FHIR_Profile\PhdNumericObservation.structuredefinition - Copy.xml'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Hl7.Fhir.Specification.Source.XmlFileConformanceScanner.List()
at Hl7.Fhir.Specification.Source.DirectorySource.<prepareResources>g__scanPaths37_5(List1 paths) at Hl7.Fhir.Specification.Source.DirectorySource.prepareResources() at Hl7.Fhir.Specification.Source.DirectorySource.ResolveByCanonicalUri(String uri) at Hl7.Fhir.Specification.Source.CachedResolver.InternalResolveByCanonicalUri(String url) at Hl7.Fhir.Specification.Source.CachedResolver.<.ctor>b__3_1(String id) at Hl7.Fhir.Specification.Source.CachedResolver.Cache1.Get(String identifier, CachedResolverLoadingStrategy strategy)
at Hl7.Fhir.Specification.Source.CachedResolver.ResolveByCanonicalUri(String url)
at Hl7.Fhir.Specification.Source.MultiResolver.ResolveByCanonicalUri(String uri)
at Hl7.Fhir.Specification.Snapshot.SnapshotGenerator.generate(StructureDefinition structure)
at Hl7.Fhir.Specification.Snapshot.SnapshotGenerator.Generate(StructureDefinition structure)
at Forge.ViewModels.FhirSnapshots.expandAll(StructureDefinition structureDef, IResourceResolver resolver, Boolean useSnapshot)
at Forge.ViewModels.StorageHandlerUtils.CreateStorageHandlers(IProfileVM target, String typeName)
at Forge.ViewModels.ProfileVM.set_ModelElement(Base value)
at Forge.ViewModels.ProfileVM.Initialize(Base modelElement, Base baseElement)
at Forge.ViewModels.ProfileVM..ctor(ISessionItem owner, StructureDefinition model, StructureDefinition baseModel, String contentDirectory)
at Forge.ViewModels.SessionItemVM.CreateResourceVM(SessionItemVM owner, Resource model, String contentDirectory)
at Forge.ViewModels.SessionItemVM..ctor(ISessionItem owner, IDocument document, Resource model)
at Forge.ViewModels.SessionItemVM.Open(IDocument document, Boolean dontLoad, Boolean asCopy)
at Forge.ViewModels.SessionItemVM.Open(Uri url, Boolean dontLoad, Boolean asCopy)
at Forge.ViewModels.SessionItemVM.Open(Boolean asCopy)
at Forge.ViewModels.SessionItemVM.Open()
at Forge.ViewModels.SessionVM.<>c.<onOpen>b__178_0(ISessionItem item)
at Forge.ViewModels.SessionVM.<>c__DisplayClass162_0.<executeItemCollectionCommand>b__0()
at Forge.Common.UIServices.ExecuteOnUIThread(Action action)
at Forge.ViewModels.SessionVM.executeCommand(Action action)

view this post on Zulip Michel Rutten (Dec 07 2017 at 17:33):

Maybe caching issue. Try to close and re-open the application.

view this post on Zulip Brian Reinhold (Dec 07 2017 at 17:36):

Maybe caching issue. Try to close and re-open the application.

Okay, that solved that problem. Good to know.

NOw I have a URL problem trying to point to my base profile. It says it cannot find my base profile
All I have is

<baseDefinition value="PhdBaseObservation" />

since the base profile is in the same directory as the profile I am playing with


Last updated: Apr 12 2022 at 19:14 UTC