feat: depreacte userId and preferredUserId in HealthcareParty and Patient#289
feat: depreacte userId and preferredUserId in HealthcareParty and Patient#289
Conversation
There was a problem hiding this comment.
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
@Deprecatedannotations onpreferredUserIdinPatientandPatientDto(v1 & v2). - Added/updated
@Deprecatedannotations onuserIdinHealthcarePartyandHealthcarePartyDto(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, |
There was a problem hiding this comment.
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).
| @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, |
| @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, |
There was a problem hiding this comment.
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.
| @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, |
| @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") |
There was a problem hiding this comment.
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).
| @Deprecated("Discouraged, use custom property if you really want them") | |
| @Deprecated("Deprecated, use the properties field to store this information instead") |
| @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, |
There was a problem hiding this comment.
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").
| @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, |
| @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, |
There was a problem hiding this comment.
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.
| @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, |
| @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, |
There was a problem hiding this comment.
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).
| @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, |
| @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, |
There was a problem hiding this comment.
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.
| @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, |
| 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, |
There was a problem hiding this comment.
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.
| @Deprecated("Discouraged, use custom property if you really want them") val preferredUserId: String? = null, | |
| @Deprecated("Discouraged, use properties instead") val preferredUserId: String? = null, |
| 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, |
There was a problem hiding this comment.
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.
| @Deprecated("Discouraged, use custom property if you really want them") val userId: String? = null, | |
| @Deprecated("Discouraged; use properties instead") val userId: String? = null, |
No description provided.