ppazos / cabolabs-ehrserver

Open platform to manage and share standardized clinical data, designed by @ppazos at CaboLabs Health Informatics.
https://cabolabs.com
Apache License 2.0
179 stars 110 forks source link

[API] Add check for unique VersionedComposition UID #914

Closed ppazos closed 6 years ago

ppazos commented 6 years ago

We are not validating this and there are a couple of cases of duplicated UIDs.

  1. Test to reproduce, check having the same UID but different system ID in the VERSION UID.
  2. Add the unique constraint to the VC model
ppazos commented 6 years ago

The test is committing two versions with the same UUID in the VERSION UID and changing the system id, both are accepted because the unique id is verified but using the whole string, and if the change type is CREATION, it should verify also that the UUID does not exists:

677c98d8-5cd9-4a6c-9223-b1ed078d411e::APP1::1

677c98d8-5cd9-4a6c-9223-b1ed078d411e::APP2::1