Skip to content

Conversation

@YalingPeiS
Copy link
Collaborator

@YalingPeiS YalingPeiS commented Nov 25, 2025

Issue

The smileutil upload-terminology command does not support loading more than one CodeSystem.concept.property value to the TRM_CONCEPT_PROPERTY database table with the same CodeSystem.concept.property.code for a given CodeSystem.concept.

{
  "resourceType" : "CodeSystem",
  "id" : "mycodesystem",
  "url" : "http://example.com/mycodesystem",
  "content" : "complete",
  "concept" : [{
    "code" : "code-a",
    "display" : "Code A",
    "property" : [{
      "code" : "alt_description",
      "valueString" : "code a"
    },{
      "code" : "alt_description",
      "valueString" : "CODE A"
    }]
  }]
}

If the above is loaded through a FHIR endpoint via a POST or PUT request, Smile CDR creates two rows in the TRM_CONCEPT_PROPERTY table. However, only one row is created if loaded using smileutil upload-terminology.

This is problematic as some ValueSet definitions use concept.property values to define their contents.

Cause

During concept property processing, the existing TermConceptProperty was updated when the code exists in the property list which caused its value being overwritten, resulting in loss of the all the previous property entries with the same code.

Fix

Create a TermConceptProperty object for each property.

Closes #7401

@robogary
Copy link
Contributor

Formatting check succeeded!

Copy link
Collaborator

@IanMMarshall IanMMarshall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I do have a concern about the possibility of duplicated records in the TRM_CONCEPT_PROPERTY table.

Copy link
Collaborator

@IanMMarshall IanMMarshall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Approved.

@tadgh tadgh merged commit f684cea into master Dec 3, 2025
67 of 68 checks passed
@tadgh tadgh deleted the 7401-smileutil-upload-terminology-command-does-not-load-all-concept-properties-from-csv-file branch December 3, 2025 19:16
tadgh pushed a commit that referenced this pull request Dec 4, 2025
… properties from CSV file (#7407)

* [7401] fix smileutil upload-terminology not loading all properties

* [7401] add test

* [7401] add duplicate concept property check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Smileutil upload-terminology command does not load all concept properties from CSV file

5 participants