query ClinicPatientDetailModal_GetData(
  $clinicSlug: String!,
  $patientId: String!,
  $patientUuid: UUID!,
  $challengesStatus: ECRFChallengeStatus!,
  $locale: Locale!
) {
  clinic: getClinic(clinicSlug: $clinicSlug) {
    id
    features
    sslSUKLCertificateId
    type
    ais
    slug
    ...ClinicWithTypeAndFeatures_Clinic
    ...PatientInfo_Clinic
    __typename
  }
  patient: getPatientForClinic(clinicSlug: $clinicSlug, patientId: $patientId) {
    ...ClinicPatientDetailModal_Patient
    __typename
  }
  challenges: listPatientChallenges2(
    clinicSlug: $clinicSlug
    patientId: $patientId
    status: $challengesStatus
  ) {
    ...ChallengeTableList_EcrfChallenge
    __typename
  }
  patientRequestsResponse: filterPatientRequestsForClinic(
    clinicSlug: $clinicSlug
    filter: {patientId: $patientUuid}
    pageInfo: {first: 1, offset: 0}
  ) {
    count
    items { id __typename }
    __typename
  }
  treatmentPlanPatients: listTreatmentPlanPatients(
    clinicSlug: $clinicSlug
    patientId: $patientUuid
  ) {
    ...ClinicPlanPatientList_PlanPatient
    __typename
  }
  premiumPlans: listClinicPremiumPlans(clinicSlug: $clinicSlug) {
    id
    __typename
  }
  mergeSuggestions: findMergeSuggestions(
    clinicSlug: $clinicSlug
    input: {existingPatientId: $patientUuid}
  ) {
    ...MergeSuggestionAlert_MergeSuggestionResult
    __typename
  }
  insuranceCards: getPatientDocuments(
    patientId: $patientUuid
    type: InsuranceCard
  ) {
    ...PatientInfo_InsuranceCard
    __typename
  }
}

# — fragmenty (přesně tak, jak jsi měl) —
fragment ClinicWithTypeAndFeatures_Clinic on Clinic {
  id
  type
  features
  __typename
}

fragment PatientInfo_Clinic on Clinic {
  country
  id
  slug
  ais
  ...ClinicWithTypeAndFeatures_Clinic
  __typename
}

fragment ClinicPatientDetailModal_Patient on ExtendedPatient {
  id
  isInClinic
  kind
  name
  isUnknownPatient
  sex
  surname
  identificationNumber
  editableByDoctor
  type
  key
  user { id name surname __typename }
  ...ClinicPatientDetail_Patient
  ...PatientInfo_AccountPatient
  ...ClinicPatientInfo_Patient
  __typename
}

fragment ClinicPatientDetail_Patient on ExtendedPatient {
  name
  surname
  email
  id
  identificationNumber
  isInClinic
  key
  phone
  sex
  type
  dob
  user { id __typename }
  isUnknownPatient
  hasMobileApp
  __typename
}

fragment PatientInfo_AccountPatient on ExtendedPatient {
  id
  createdAt
  key
  user {
    registrationCompletedTime
    deactivatedTime
    __typename
  }
  __typename
}

fragment ClinicPatientInfo_Patient on ExtendedPatient {
  anamnesisShared
  anamnesisStatusForClinic { updatedAt __typename }
  clinics { id name slug __typename }
  id
  isInClinic
  dob
  city
  familyMembers: family { __typename }
  houseNumber
  identificationNumber
  insuranceCompanyObject { id code name shortName __typename }
  kind
  name
  note
  owner { name surname __typename }
  key
  status
  street
  surname
  user { id email name phone surname __typename }
  userRelationship
  premiumPlanPatient { id __typename }
  sex
  tags(onlyImportant: false) { id name color icon __typename }
  type
  isUnknownPatient
  hasMobileApp
  __typename
}

fragment ChallengeTableList_EcrfChallenge on ECRFChallenge {
  id
  createdAt
  sentAt
  issuedToPatient {
    id
    identificationNumber
    name
    surname
    __typename
  }
  userECRF(locale: $locale) { id name __typename }
  patientRequestId
  status
  __typename
}

fragment MergeSuggestionAlert_MergeSuggestionResult on MergeSuggestionResult {
  extendedPatient { id __typename }
  matchResult
  __typename
}

fragment ClinicPlanPatientList_PlanPatient on TreatmentPlanPatient {
  id
  createdAt
  listPatient { id identificationNumber name key status surname __typename }
  treatmentPlan { id slug name __typename }
  __typename
}

fragment PatientInfo_InsuranceCard on PatientDocument {
  id
  contentType
  url
  downloadUrl
  __typename
}
