deleteServicesWithPatientInfo method
Future<DecryptedContactDto?>
deleteServicesWithPatientInfo(
- UserDto user,
- String patientId,
- Map<
String, Set< patientDelegations,DelegationDto> > - List<
DecryptedServiceDto> services, - CryptoConfig<
DecryptedContactDto, ContactDto> config,
Implementation
Future<DecryptedContactDto?> deleteServicesWithPatientInfo(
UserDto user,
String patientId,
Map<String, Set<DelegationDto>> patientDelegations,
List<DecryptedServiceDto> services,
CryptoConfig<DecryptedContactDto, ContactDto> config
) {
final Uuid uuid = Uuid();
final currentTime = DateTime
.now()
.millisecondsSinceEpoch;
return this.createContactWithPatientInfo(
user,
patientId,
patientDelegations,
DecryptedContactDto(
id: uuid.v4(options: {'rng': UuidUtil.cryptoRNG}),
services:
services.map((it) => DecryptedServiceDto(id: it.id, created: it.created, modified: currentTime, endOfLife: currentTime)).toSet()),
config);
}