def openmrs_test_fire(request, domain, repeater_id, record_id): repeater = OpenmrsRepeater.get(repeater_id) record = RepeatRecord.get(record_id) assert repeater.domain == domain assert record.domain == domain assert record.repeater_id == repeater.get_id attempt = repeater.fire_for_record(record) return JsonResponse(attempt.to_json())
def openmrs_test_fire(request, domain, repeater_id, record_id): repeater = OpenmrsRepeater.get(repeater_id) record = RepeatRecord.get(record_id) assert repeater.domain == domain assert record.domain == domain assert record.repeater_id == repeater.get_id attempt = repeater.fire_for_record(record) return JsonResponse(attempt.to_json())
def openmrs_raw_api(request, domain, repeater_id, rest_uri): get_params = dict(request.GET) no_links = get_params.pop('links', None) is None repeater = OpenmrsRepeater.get(repeater_id) assert repeater.domain == domain raw_json = repeater.requests.get('/ws/rest/v1' + rest_uri, get_params).json() if no_links: return JsonResponse(_filter_out_links(raw_json)) return JsonResponse(raw_json)
def repeater(self): repeater = OpenmrsRepeater.get(self.repeater_id) assert repeater.domain == self.domain return repeater
def repeater(self): repeater = OpenmrsRepeater.get(self.repeater_id) assert repeater.domain == self.domain return repeater