MayJuun / fhir

A Dart/Flutter package for working with FHIR resources.
MIT License
41 stars 29 forks source link

Meta information lost on Resource.updateVersion #50

Closed vsaase closed 2 years ago

vsaase commented 2 years ago

https://github.com/MayJuun/fhir/blob/291559d2b9ee9e0f9607816b9aeeed82791fc2f8/fhir/lib/r4/resource/resource_new_version.dart#L11

Hi, first thanks for the library, helped me a lot already. In the above referenced line a new Meta instance is returned. This however ignores other fields that may be set in oldMeta, such as the profile. Could this be fixed with a conditional oldMeta.copyWith ? I would send a pull request, but I am not sure if you generate this code from somewhere else. I see all this duplications between dstu2, stu3, r4 and r5.

Dokotela commented 2 years ago

Fair, it's a lot of code to keep up with. Shouldn't be a problem with updating the meta using copyWith, I'll let you know when it's available.

Dokotela commented 2 years ago

Looks good, thanks!