updateContactPointRank method
Implementation
PatientContact updateContactPointRank(FhirDecimal rank, [int index = 0]) {
if (telecom == null || telecom!.isEmpty) {
return copyWith(telecom: <ContactPoint>[ContactPoint(rank: rank)]);
} else if (index >= telecom!.length) {
return copyWith(
telecom: <ContactPoint>[...telecom!, ContactPoint(rank: rank)]);
} else {
return copyWith(telecom: <ContactPoint>[
...telecom!.sublist(0, index),
telecom![index].copyWith(rank: rank),
...telecom!.sublist(index + 1)
]);
}
}