Skip to content

feat: depreacte userId and preferredUserId in HealthcareParty and Patient#289

Merged
trema96 merged 2 commits intomainfrom
feat/depreacated-userId-fields
Apr 1, 2026
Merged

feat: depreacte userId and preferredUserId in HealthcareParty and Patient#289
trema96 merged 2 commits intomainfrom
feat/depreacated-userId-fields

Conversation

@LotuxPunk
Copy link
Copy Markdown
Contributor

No description provided.

@LotuxPunk LotuxPunk requested review from Copilot and trema96 April 1, 2026 11:55
@LotuxPunk LotuxPunk self-assigned this Apr 1, 2026
@LotuxPunk LotuxPunk added the enhancement New feature or request label Apr 1, 2026
@trema96 trema96 merged commit aec0622 into main Apr 1, 2026
2 checks passed
@trema96 trema96 deleted the feat/depreacated-userId-fields branch April 1, 2026 11:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR deprecates the userId field on HealthcareParty and the preferredUserId field on Patient across both domain entities and REST v1/v2 DTOs, to discourage their usage and steer consumers toward using custom properties instead.

Changes:

  • Added/updated @Deprecated annotations on preferredUserId in Patient and PatientDto (v1 & v2).
  • Added/updated @Deprecated annotations on userId in HealthcareParty and HealthcarePartyDto (v1 & v2).
  • Adjusted annotation placement for some fields as part of introducing deprecations.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
dto/src/main/kotlin/org/taktik/icure/services/external/rest/v2/dto/PatientDto.kt Deprecates preferredUserId in REST v2 patient DTO.
dto/src/main/kotlin/org/taktik/icure/services/external/rest/v2/dto/HealthcarePartyDto.kt Updates deprecation on userId in REST v2 healthcare party DTO.
dto/src/main/kotlin/org/taktik/icure/services/external/rest/v1/dto/PatientDto.kt Deprecates preferredUserId in REST v1 patient DTO.
dto/src/main/kotlin/org/taktik/icure/services/external/rest/v1/dto/HealthcarePartyDto.kt Deprecates userId in REST v1 healthcare party DTO.
domain/src/main/kotlin/org/taktik/icure/entities/Patient.kt Deprecates preferredUserId in domain Patient.
domain/src/main/kotlin/org/taktik/icure/entities/HealthcareParty.kt Deprecates userId in domain HealthcareParty.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@param:Schema(description = "The ethnicity of the patient.") val ethnicity: String? = null,
/** The id of the user that usually handles this patient. */
@param:Schema(description = "The id of the user that usually handles this patient.") val preferredUserId: String? = null,
@Deprecated("Discouraged, use custom property if you really want them") @param:Schema(description = "The id of the user that usually handles this patient.") val preferredUserId: String? = null,
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The @Deprecated message is grammatically unclear ("custom property" vs the existing properties/parameters fields, and "want them" refers to a plural). Consider rewording to something precise and consistent with other deprecations in this file (e.g., pointing users to properties).

Suggested change
@Deprecated("Discouraged, use custom property if you really want them") @param:Schema(description = "The id of the user that usually handles this patient.") val preferredUserId: String? = null,
@Deprecated("Deprecated: use properties to store the preferred user identifier") @param:Schema(description = "The id of the user that usually handles this patient.") val preferredUserId: String? = null,

Copilot uses AI. Check for mistakes.
@param:Schema(description = "The ethnicity of the patient.") val ethnicity: String? = null,
/** The id of the user that usually handles this patient. */
@param:Schema(description = "The id of the user that usually handles this patient.") val preferredUserId: String? = null,
@Deprecated("Discouraged, use custom property if you really want them") @param:Schema(description = "The id of the user that usually handles this patient.") val preferredUserId: String? = null,
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

Style/convention: this line combines @Deprecated and @param:Schema on the same line. In this file, other deprecated schema fields put annotations on separate lines (e.g., picture just below), which is easier to read and diff.

Suggested change
@Deprecated("Discouraged, use custom property if you really want them") @param:Schema(description = "The id of the user that usually handles this patient.") val preferredUserId: String? = null,
@Deprecated("Discouraged, use custom property if you really want them")
@param:Schema(description = "The id of the user that usually handles this patient.") val preferredUserId: String? = null,

Copilot uses AI. Check for mistakes.
@param:Schema(description = "Identifier number for the institution if the healthcare party is an organization") val ehp: String? = null,
/** The id of the user that usually handles this healthcare party. */
@Deprecated("This field is deprecated for the use with Cardinal SDK")
@Deprecated("Discouraged, use custom property if you really want them")
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The @Deprecated message is grammatically unclear ("custom property" vs the existing properties field, and "want them" refers to a plural). Consider rewording to something precise and consistent with other deprecations (e.g., pointing users to properties).

Suggested change
@Deprecated("Discouraged, use custom property if you really want them")
@Deprecated("Deprecated, use the properties field to store this information instead")

Copilot uses AI. Check for mistakes.
@param:Schema(description = "The race of the patient.") val race: String? = null,
@param:Schema(description = "The ethnicity of the patient.") val ethnicity: String? = null,
@param:Schema(description = "The id of the user that usually handles this patient.") val preferredUserId: String? = null,
@Deprecated("Discouraged, use custom property if you really want them") @param:Schema(description = "The id of the user that usually handles this patient.") val preferredUserId: String? = null,
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The @Deprecated message is grammatically unclear ("custom property" vs the existing properties field, and "want them" refers to a plural). Consider rewording to something precise and consistent with other deprecations in this DTO (many use "Use properties instead").

Suggested change
@Deprecated("Discouraged, use custom property if you really want them") @param:Schema(description = "The id of the user that usually handles this patient.") val preferredUserId: String? = null,
@Deprecated("Use properties instead") @param:Schema(description = "The id of the user that usually handles this patient.") val preferredUserId: String? = null,

Copilot uses AI. Check for mistakes.
@param:Schema(description = "The race of the patient.") val race: String? = null,
@param:Schema(description = "The ethnicity of the patient.") val ethnicity: String? = null,
@param:Schema(description = "The id of the user that usually handles this patient.") val preferredUserId: String? = null,
@Deprecated("Discouraged, use custom property if you really want them") @param:Schema(description = "The id of the user that usually handles this patient.") val preferredUserId: String? = null,
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

Style/convention: this line combines @Deprecated and @param:Schema on the same line. Elsewhere in DTOs in this repo, these annotations are typically split across lines to keep each annotation readable.

Suggested change
@Deprecated("Discouraged, use custom property if you really want them") @param:Schema(description = "The id of the user that usually handles this patient.") val preferredUserId: String? = null,
@Deprecated("Discouraged, use custom property if you really want them")
@param:Schema(description = "The id of the user that usually handles this patient.") val preferredUserId: String? = null,

Copilot uses AI. Check for mistakes.
@param:Schema(description = "Identifier number for institution type if the healthcare party is an enterprise") val cbe: String? = null,
@param:Schema(description = "Identifier number for the institution if the healthcare party is an organization") val ehp: String? = null,
@param:Schema(description = "The id of the user that usually handles this healthcare party.") val userId: String? = null,
@Deprecated("Discouraged, use custom property if you really want them") @param:Schema(description = "The id of the user that usually handles this healthcare party.") val userId: String? = null,
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The @Deprecated message is grammatically unclear ("custom property" vs the existing properties field, and "want them" refers to a plural). Consider rewording to something precise and consistent with other deprecations (e.g., pointing users to properties).

Suggested change
@Deprecated("Discouraged, use custom property if you really want them") @param:Schema(description = "The id of the user that usually handles this healthcare party.") val userId: String? = null,
@Deprecated("Deprecated, use the properties field instead") @param:Schema(description = "The id of the user that usually handles this healthcare party.") val userId: String? = null,

Copilot uses AI. Check for mistakes.
@param:Schema(description = "Identifier number for institution type if the healthcare party is an enterprise") val cbe: String? = null,
@param:Schema(description = "Identifier number for the institution if the healthcare party is an organization") val ehp: String? = null,
@param:Schema(description = "The id of the user that usually handles this healthcare party.") val userId: String? = null,
@Deprecated("Discouraged, use custom property if you really want them") @param:Schema(description = "The id of the user that usually handles this healthcare party.") val userId: String? = null,
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

Style/convention: this line combines @Deprecated and @param:Schema on the same line. In this file there are also multi-line annotations (e.g., the options deprecation below); splitting improves readability and keeps diffs cleaner.

Suggested change
@Deprecated("Discouraged, use custom property if you really want them") @param:Schema(description = "The id of the user that usually handles this healthcare party.") val userId: String? = null,
@Deprecated("Discouraged, use custom property if you really want them")
@param:Schema(description = "The id of the user that usually handles this healthcare party.") val userId: String? = null,

Copilot uses AI. Check for mistakes.
val preferredUserId: String? = null,
@param:JsonDeserialize(using = JacksonBase64LenientDeserializer::class)
val picture: ByteArray? = null,
@Deprecated("Discouraged, use custom property if you really want them") val preferredUserId: String? = null,
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The @Deprecated message is grammatically unclear ("custom property" vs the properties field present on Patient, and "want them" refers to a plural). Consider rewording to something precise (e.g., "Use properties instead"), since this message will show up in compile-time warnings for SDK users.

Suggested change
@Deprecated("Discouraged, use custom property if you really want them") val preferredUserId: String? = null,
@Deprecated("Discouraged, use properties instead") val preferredUserId: String? = null,

Copilot uses AI. Check for mistakes.
val cbe: String? = null,
val ehp: String? = null,
val userId: String? = null,
@Deprecated("Discouraged, use custom property if you really want them") val userId: String? = null,
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The @Deprecated message is grammatically unclear ("custom property" vs the properties field present on HealthcareParty, and "want them" refers to a plural). Consider rewording to something precise (e.g., "Use properties instead"), since this message will show up in compile-time warnings for SDK users.

Suggested change
@Deprecated("Discouraged, use custom property if you really want them") val userId: String? = null,
@Deprecated("Discouraged; use properties instead") val userId: String? = null,

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants