def METHOD_NAME(self):
    serializer_class = self.serializer_class
    if self.action == "retrieve":
        serializer_class = PatientSampleDetailSerializer
    elif self.action == "partial_update":
        serializer_class = PatientSamplePatchSerializer
    return serializer_class