getGenderProfiles

abstract suspend fun getGenderProfiles(): GenderProfileList

Retrieves the gender options a member of the caller's organization may pick.

The list is resolved server-side from the organization the credential belongs to; an organization that has not customised its options gets the platform defaults. Send the chosen com.advantahealth.api.settings.model.GenderProfile.code back as the member's gender when saving the profile.

A member may hold a gender that is no longer in this list (the organization retired it after the member chose it), so a picker should keep showing the member's saved value rather than snapping to the first option.

Return

The GenderProfileList, sorted for display.

Throws

if retrieval fails - including a 503 when the server cannot resolve the list. A failed fetch never masquerades as an empty list.

Android (Kotlin)

lifecycleScope.launch {
try {
val genders = AFCore.applicationSettings().getGenderProfiles()
showPicker(genders.profiles.map { it.code to it.displayName })
} catch (t: Throwable) {
showPicker(defaultGenderOptions)
}
}

iOS (Swift)

Task {
do {
let genders = try await AFCore.shared.applicationSettings().getGenderProfiles()
self.showPicker(genders.profiles.map { ($0.code, $0.displayName) })
} catch {
self.showPicker(self.defaultGenderOptions)
}
}