FHIR Profiles: Versioning and Migration
# support
j
Hi ya'll — I have two quick questions about Medplum profiles. 1. How do profiles apply validations, and when? Let's say I have a profile
test-encounter
and I'm applying it to an Encounter, if I modify the
StructureDefinition
for the profile within Medplum, will it apply any additional validations to all resources that have that profile? If they don't, what happens to the resources when you try to save them again (do they validate against the original version that was applied to them, or against the latest version)? Generally super interested in how the Profile migration process works and what are best practices for that. 2. Related to the above, I see that there is a version for each StructureDefinition, do you have any recommended ways to reference different versions of profiles for different resources? Generally interested in best practices as we think about applying profiles and migrating resources, if you have recommendations for how to make sure we don't run into extraneous validation errors as we migrate, or otherwise apply data migrations to Medplum resources.
r
Hi @jasonwa.ng , sorry for the delayed response: 1. Profiles are validated at the time the resources is created / updated. If a structure definition is updated, no validations will be run on resources until the next time they are validated 2. In terms of versioning, the "FHIR correct" way of migrating would be to use the
version
field, and then use a version-specific reference in your meta.profile e.g.
Copy code
meta.profile = http://my-structure-definition.com|0.1
this uses a "canonical reference" https://hl7.org/fhir/R4/references.html#canonical
However, we don't yet support the full
|<version number>
reference syntax for profiles yet. In the meantime, I would suggest manually versioning your structure-definitions as:
Copy code
meta.profile = http://my-structure-definition.com/version/1
`
j
Is there a linked issue or ticket that we can track to see when versions will be supported fully? e.g. for the future moving forward
157 Views