Get the supported services of the reference sample
5539
def get_supported_services_uids(self, referencesample):
        
        uids = referencesample.getSupportedServices(only_uids=True)
        return list(set(uids))
1162923
def get_sampletypes(self):
        
        query = {
            "portal_type": "SampleType",
            "sort_on": "sortable_title",
            "sort_order": "ascending",
            "is_active": True,
        }
        results = api.search(query, "bika_setup_catalog")
        return map(api.get_object, results)
843446
def services(self):
        """"""
        ids = [ref['id'] for ref in self['services']]
        return [Service.fetch(id) for id in ids]
935814
public function retrieveCustomerByExternalReference($reference)
  {
    $ep = $this->_getEndpoint();
    $payload = new PaginatedDataNodePayload();
    $payload->filter = [
      AdvancedFilterPayload::create(
        'externalReference',
        AdvancedFilterComparator::EQUAL,
        $reference
      ),
    ];
    $customers = $this->_processRequest($ep->all($payload));
    if(count($customers->items) >= 1)
    {
      return Arrays::first($customers->items);
    }
    else
    {
      throw new NotFoundException(
        "No customer could be located with the reference $reference"
      );
    }
  }
928841
def get_services(cls, request=None):
        
        return {service['name']: reverse(service['list_view'], request=request)
                for service in cls._registry.values()}
852854
def get_reference_results(self):
        
        referenceresults = self.context.getReferenceResults()
        return dict(map(lambda rr: (rr.get("uid"), rr), referenceresults))
417454
def referencesGenerator(self, request):
        
        referenceSet = self.getDataRepository().getReferenceSet(
            request.reference_set_id)
        results = []
        for obj in referenceSet.getReferences():
            include = True
            if request.md5checksum:
                if request.md5checksum != obj.getMd5Checksum():
                    include = False
            if request.accession:
                if request.accession not in obj.getSourceAccessions():
                    include = False
            if include:
                results.append(obj)
        return self._objectListGenerator(request, results)
1172139
def referenced_by(self):
        
        href = fetch_entry_point('references_by_element')
        return [Element.from_meta(**ref)
                for ref in self.make_request(
                    method='create',
                    href=href,
                    json={'value': self.href})]
663391
def services(cls):
        """"""
        return cls.json_get('%s/services' % cls.api_url, empty_key=True,
                            send_key=False)
824334
def addReferences(self, reference, service_uids):
        
        # TODO Workflow - Analyses. Assignment of refanalysis to Instrument
        addedanalyses = []
        wf = getToolByName(self, 'portal_workflow')
        bsc = getToolByName(self, 'bika_setup_catalog')
        bac = getToolByName(self, 'bika_analysis_catalog')
        ref_type = reference.getBlank() and 'b' or 'c'
        ref_uid = reference.UID()
        postfix = 1
        for refa in reference.getReferenceAnalyses():
            grid = refa.getReferenceAnalysesGroupID()
            try:
                cand = int(grid.split('-')[2])
                if cand >= postfix:
                    postfix = cand + 1
            except:
                pass
        postfix = str(postfix).zfill(int(3))
        refgid = 'I%s-%s' % (reference.id, postfix)
        for service_uid in service_uids:
            # services with dependents don't belong in references
            service = bsc(portal_type='AnalysisService', UID=service_uid)[0].getObject()
            calc = service.getCalculation()
            if calc and calc.getDependentServices():
                continue
            ref_analysis = reference.addReferenceAnalysis(service)

            # Set ReferenceAnalysesGroupID (same id for the analyses from
            # the same Reference Sample and same Worksheet)
            # https://github.com/bikalabs/Bika-LIMS/issues/931
            ref_analysis.setReferenceAnalysesGroupID(refgid)
            ref_analysis.setInstrument(self)
            ref_analysis.reindexObject()
            addedanalyses.append(ref_analysis)

        # Set DisposeUntilNextCalibrationTest to False
        if (len(addedanalyses) > 0):
            self.getField('DisposeUntilNextCalibrationTest').set(self, False)

        return addedanalyses
1062734
def getSampleTypes(self, active_only=True):
        
        catalog = api.get_tool("bika_setup_catalog")
        query = {
            "portal_type": "SampleType",
            # N.B. The `sortable_title` index sorts case sensitive. Since there
            #      is no sort key for sample types, it makes more sense to sort
            #      them alphabetically in the selection
            "sort_on": "title",
            "sort_order": "ascending"
        }
        results = catalog(query)
        if active_only:
            results = filter(api.is_active, results)
        sampletypes = map(
            lambda brain: (brain.UID, brain.Title), results)
        return DisplayList(sampletypes)
1316895
public List<ServiceReference> getReferences(String resourceType) {
		List<ServiceReference> references = new ArrayList<ServiceReference>();
		if (containsKey(resourceType)) {
			references.addAll(get(resourceType));
			Collections.sort(references, new Comparator<ServiceReference>() {
				@Override
				public int compare(ServiceReference r0, ServiceReference r1) {
					Integer p0 = OsgiUtil.toInteger(
							r0.getProperty(ComponentBindingsProvider.PRIORITY),
							0);
					Integer p1 = OsgiUtil.toInteger(
							r1.getProperty(ComponentBindingsProvider.PRIORITY),
							0);
					return -1 * p0.compareTo(p1);
				}

			});
		}
		return references;
	}
1362892
def _get_service_bindings(self, service_name):
        
        instance = self.get_instance(service_name)
        return self.api.get(instance['service_bindings_url'])
1030750
def get(self, sid):
        
        return SampleContext(
            self._version,
            assistant_sid=self._solution['assistant_sid'],
            task_sid=self._solution['task_sid'],
            sid=sid,
        )
919663
def get_referenced_object(self):
        

        if self._BillingInvoice is not None:
            return self._BillingInvoice

        if self._DraftPayment is not None:
            return self._DraftPayment

        if self._MasterCardAction is not None:
            return self._MasterCardAction

        if self._Payment is not None:
            return self._Payment

        if self._PaymentBatch is not None:
            return self._PaymentBatch

        if self._RequestResponse is not None:
            return self._RequestResponse

        if self._ScheduleInstance is not None:
            return self._ScheduleInstance

        if self._TabResultResponse is not None:
            return self._TabResultResponse

        if self._WhitelistResult is not None:
            return self._WhitelistResult

        raise exception.BunqException(self._ERROR_NULL_FIELDS)
212509
def _loadServices(self):
        
        servicesPath = os.path.join(self.path, "service")
        if not os.path.isdir(servicesPath):
            return

        self._scanDirectoryForServices(servicesPath)
1150420
def get_specs(self, service):
        
        uid = api.get_uid(service)
        keyword = service.getKeyword()
        specs = ResultsRangeDict(keyword=keyword, uid=uid).copy()
        for key in specs.keys():
            specs_value = self.request.form.get(key, [{}])[0].get(uid, None)
            specs[key] = specs_value or specs.get(key)
        return specs