code: def getQCAnalyses(self, qctype=None, review_state=None):
          
          qcanalyses = []
          suids = []
          ans = self.getAnalyses()
          wf = getToolByName(self, 'portal_workflow')
          for an in ans:
              an = an.getObject()
              if an.getServiceUID() not in suids:
                  suids.append(an.getServiceUID())
  
          def valid_dup(wan):
              if wan.portal_type == 'ReferenceAnalysis':
                  return False
              an_state = wf.getInfoFor(wan, 'review_state')
              return \
                  wan.portal_type == 'DuplicateAnalysis' \
                  and wan.getRequestID() == self.id \
                  and (review_state is None or an_state in review_state)
  
          def valid_ref(wan):
              if wan.portal_type != 'ReferenceAnalysis':
                  return False
              an_state = wf.getInfoFor(wan, 'review_state')
              an_reftype = wan.getReferenceType()
              return wan.getServiceUID() in suids \
                  and wan not in qcanalyses \
                  and (qctype is None or an_reftype == qctype) \
                  and (review_state is None or an_state in review_state)
  
          for an in ans:
              an = an.getObject()
              ws = an.getWorksheet()
              if not ws:
                  continue
              was = ws.getAnalyses()
              for wa in was:
                  if valid_dup(wa):
                      qcanalyses.append(wa)
                  elif valid_ref(wa):
                      qcanalyses.append(wa)
  
          return qcanalyses
docs: return the QC analyses performed in the worksheet in which, at
          least, one sample of this AR is present.
  
          Depending on qctype value, returns the analyses of:
  
              - 'b': all Blank Reference Samples used in related worksheet/s
              - 'c': all Control Reference Samples used in related worksheet/s
              - 'd': duplicates only for samples contained in this AR
  
          If qctype==None, returns all type of qc analyses mentioned above