Open bmamlin opened 1 year ago
Some of the synonyms have no name_type
attached to them, they are getting skipped in this uniqueness check. For more
In OpenMRS, we introduced alternative name types after we had synonyms, so all null
name types are assumed to be synonyms. OCL either needs to make the same assumption or we get rid of both null
and None
(having both is a recipe for disaster) and explicitly use Synonym
name type in OCL (updating our OpenMRS import scripts to convert null
to Synonym
).
In any case, what we need for the OpenMRS Custom Validation Schema is to enforce that all FSNs and preferred synonyms within the same locale are unique (ignoring case). To work with existing data this means looking across all names with name type == Fully Specified
OR (name type == null
AND preferred == True
).
Personally, I'd prefer to replace the None
name type with Synonym
and make this rule look across all names with name type == Fully Specified
OR ((name type == null
OR name type == Synonym
) AND preferred == True
). Then we can start phasing out null
as an option for name type, eventually eliminating the need to assume a name type (i.e., make Synonym
the default). #1666 created for the name type changes.
When we initially defined custom validation schema rules for OpenMRS, we said fully-specified names (FSNs) should be unique across all concept names (excluding short names and index terms). During the release of CIEL v2023-09-22 (#1662), we realized this is too strict. We also discovered OCL was not routinely enforcing this rule.
Upon further reflection, we decided a more pragmatic rule would be to enforce uniqueness amongst all FSNs and preferred synonyms within a locale. So, for example, Despite being the FSN for Lactic acid (78618), "Lactic acid" should be allowed as a synonym of Serum lactate (1012) in the same locale as long as it not marked as preferred.