_id stringlengths 2 6 | title stringlengths 9 130 | partition stringclasses 3
values | text stringlengths 66 10.5k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q11800 | SquareConnect.V1ItemsApi.remove_fee | train | def remove_fee(location_id, item_id, fee_id, opts = {})
data, _status_code, _headers = remove_fee_with_http_info(location_id, item_id, fee_id, opts)
return data
end | ruby | {
"resource": ""
} |
q11801 | SquareConnect.V1ItemsApi.remove_modifier_list | train | def remove_modifier_list(location_id, modifier_list_id, item_id, opts = {})
data, _status_code, _headers = remove_modifier_list_with_http_info(location_id, modifier_list_id, item_id, opts)
return data
end | ruby | {
"resource": ""
} |
q11802 | SquareConnect.V1ItemsApi.retrieve_item | train | def retrieve_item(location_id, item_id, opts = {})
data, _status_code, _headers = retrieve_item_with_http_info(location_id, item_id, opts)
return data
end | ruby | {
"resource": ""
} |
q11803 | SquareConnect.V1ItemsApi.retrieve_modifier_list | train | def retrieve_modifier_list(location_id, modifier_list_id, opts = {})
data, _status_code, _headers = retrieve_modifier_list_with_http_info(location_id, modifier_list_id, opts)
return data
end | ruby | {
"resource": ""
} |
q11804 | SquareConnect.V1ItemsApi.update_category | train | def update_category(location_id, category_id, body, opts = {})
data, _status_code, _headers = update_category_with_http_info(location_id, category_id, body, opts)
return data
end | ruby | {
"resource": ""
} |
q11805 | SquareConnect.V1ItemsApi.update_discount | train | def update_discount(location_id, discount_id, body, opts = {})
data, _status_code, _headers = update_discount_with_http_info(location_id, discount_id, body, opts)
return data
end | ruby | {
"resource": ""
} |
q11806 | SquareConnect.V1ItemsApi.update_item | train | def update_item(location_id, item_id, body, opts = {})
data, _status_code, _headers = update_item_with_http_info(location_id, item_id, body, opts)
return data
end | ruby | {
"resource": ""
} |
q11807 | SquareConnect.V1ItemsApi.update_modifier_list | train | def update_modifier_list(location_id, modifier_list_id, body, opts = {})
data, _status_code, _headers = update_modifier_list_with_http_info(location_id, modifier_list_id, body, opts)
return data
end | ruby | {
"resource": ""
} |
q11808 | SquareConnect.V1ItemsApi.update_modifier_option | train | def update_modifier_option(location_id, modifier_list_id, modifier_option_id, body, opts = {})
data, _status_code, _headers = update_modifier_option_with_http_info(location_id, modifier_list_id, modifier_option_id, body, opts)
return data
end | ruby | {
"resource": ""
} |
q11809 | SquareConnect.V1ItemsApi.update_page | train | def update_page(location_id, page_id, body, opts = {})
data, _status_code, _headers = update_page_with_http_info(location_id, page_id, body, opts)
return data
end | ruby | {
"resource": ""
} |
q11810 | SquareConnect.V1ItemsApi.update_page_cell | train | def update_page_cell(location_id, page_id, body, opts = {})
data, _status_code, _headers = update_page_cell_with_http_info(location_id, page_id, body, opts)
return data
end | ruby | {
"resource": ""
} |
q11811 | SquareConnect.V1ItemsApi.update_variation | train | def update_variation(location_id, item_id, variation_id, body, opts = {})
data, _status_code, _headers = update_variation_with_http_info(location_id, item_id, variation_id, body, opts)
return data
end | ruby | {
"resource": ""
} |
q11812 | SquareConnect.LaborApi.delete_break_type | train | def delete_break_type(id, opts = {})
data, _status_code, _headers = delete_break_type_with_http_info(id, opts)
return data
end | ruby | {
"resource": ""
} |
q11813 | SquareConnect.LaborApi.delete_shift | train | def delete_shift(id, opts = {})
data, _status_code, _headers = delete_shift_with_http_info(id, opts)
return data
end | ruby | {
"resource": ""
} |
q11814 | SquareConnect.LaborApi.get_break_type | train | def get_break_type(id, opts = {})
data, _status_code, _headers = get_break_type_with_http_info(id, opts)
return data
end | ruby | {
"resource": ""
} |
q11815 | SquareConnect.LaborApi.get_employee_wage | train | def get_employee_wage(id, opts = {})
data, _status_code, _headers = get_employee_wage_with_http_info(id, opts)
return data
end | ruby | {
"resource": ""
} |
q11816 | SquareConnect.LaborApi.get_shift | train | def get_shift(id, opts = {})
data, _status_code, _headers = get_shift_with_http_info(id, opts)
return data
end | ruby | {
"resource": ""
} |
q11817 | SquareConnect.LaborApi.update_break_type | train | def update_break_type(id, body, opts = {})
data, _status_code, _headers = update_break_type_with_http_info(id, body, opts)
return data
end | ruby | {
"resource": ""
} |
q11818 | SquareConnect.LaborApi.update_shift | train | def update_shift(id, body, opts = {})
data, _status_code, _headers = update_shift_with_http_info(id, body, opts)
return data
end | ruby | {
"resource": ""
} |
q11819 | SquareConnect.LaborApi.update_workweek_config | train | def update_workweek_config(id, body, opts = {})
data, _status_code, _headers = update_workweek_config_with_http_info(id, body, opts)
return data
end | ruby | {
"resource": ""
} |
q11820 | SquareConnect.TransactionsApi.retrieve_transaction | train | def retrieve_transaction(location_id, transaction_id, opts = {})
data, _status_code, _headers = retrieve_transaction_with_http_info(location_id, transaction_id, opts)
return data
end | ruby | {
"resource": ""
} |
q11821 | SquareConnect.V1TransactionsApi.list_bank_accounts | train | def list_bank_accounts(location_id, opts = {})
data, _status_code, _headers = list_bank_accounts_with_http_info(location_id, opts)
return data
end | ruby | {
"resource": ""
} |
q11822 | SquareConnect.V1TransactionsApi.list_orders | train | def list_orders(location_id, opts = {})
data, _status_code, _headers = list_orders_with_http_info(location_id, opts)
return data
end | ruby | {
"resource": ""
} |
q11823 | SquareConnect.V1TransactionsApi.retrieve_bank_account | train | def retrieve_bank_account(location_id, bank_account_id, opts = {})
data, _status_code, _headers = retrieve_bank_account_with_http_info(location_id, bank_account_id, opts)
return data
end | ruby | {
"resource": ""
} |
q11824 | SquareConnect.V1TransactionsApi.retrieve_order | train | def retrieve_order(location_id, order_id, opts = {})
data, _status_code, _headers = retrieve_order_with_http_info(location_id, order_id, opts)
return data
end | ruby | {
"resource": ""
} |
q11825 | SquareConnect.V1TransactionsApi.retrieve_payment | train | def retrieve_payment(location_id, payment_id, opts = {})
data, _status_code, _headers = retrieve_payment_with_http_info(location_id, payment_id, opts)
return data
end | ruby | {
"resource": ""
} |
q11826 | StreamRails.ViewHelpers.render_activities | train | def render_activities(activities, options = {})
activities.map { |activity| Renderable.render(activity, self, options.dup) }.join.html_safe
end | ruby | {
"resource": ""
} |
q11827 | Dry::Initializer.Config.param | train | def param(name, type = nil, **opts, &block)
add_definition(false, name, type, block, opts)
end | ruby | {
"resource": ""
} |
q11828 | Dry::Initializer.Config.inch | train | def inch
line = Builders::Signature[self]
line = line.gsub("__dry_initializer_options__", "options")
lines = ["@!method initialize(#{line})"]
lines += ["Initializes an instance of #{extended_class}"]
lines += definitions.values.map(&:inch)
lines += ["@return [#{extended_class}]"... | ruby | {
"resource": ""
} |
q11829 | Dry::Initializer.DSL.[] | train | def [](undefined: true, **)
null = (undefined == false) ? nil : UNDEFINED
Module.new.tap do |mod|
mod.extend DSL
mod.include self
mod.send(:instance_variable_set, :@null, null)
end
end | ruby | {
"resource": ""
} |
q11830 | Dry::Initializer.DSL.define | train | def define(procedure = nil, &block)
config = Config.new(null: null)
config.instance_exec(&(procedure || block))
config.mixin.include Mixin::Root
config.mixin
end | ruby | {
"resource": ""
} |
q11831 | Appium.Android.get_android_inspect | train | def get_android_inspect(class_name = false)
source = get_source
doctype_string = '<!doctyp'
source_header = source[0..doctype_string.length].downcase
source_is_html = source_header.start_with?(doctype_string, '<html')
parser = if source_is_html # parse html from webview
... | ruby | {
"resource": ""
} |
q11832 | Appium.Android.page | train | def page(opts = {})
class_name = opts.is_a?(Hash) ? opts.fetch(:class, nil) : opts
puts get_android_inspect class_name
nil
end | ruby | {
"resource": ""
} |
q11833 | Appium.Android.ele_index | train | def ele_index(class_name, index)
results = tags(class_name)
if index == 'last()'
index = results.length
index -= 1 if index >= 0
else
raise 'Index must be >= 1' unless index >= 1
index -= 1 if index >= 1
end
# uiautomator has issues with index/instance so ... | ruby | {
"resource": ""
} |
q11834 | Appium.Driver.driver_attributes | train | def driver_attributes
# rubocop:disable Layout/AlignHash
{
caps: @core.caps,
automation_name: @core.automation_name,
custom_url: @core.custom_url,
export_session: @core.export_session,
export_session_path: @core.export_session_path,
... | ruby | {
"resource": ""
} |
q11835 | Appium.Driver.appium_server_version | train | def appium_server_version
@core.appium_server_version
rescue Selenium::WebDriver::Error::WebDriverError => ex
raise ::Appium::Core::Error::ServerError unless ex.message.include?('content-type=""')
# server (TestObject for instance) does not respond to status call
{}
end | ruby | {
"resource": ""
} |
q11836 | Appium.Driver.start_driver | train | def start_driver(http_client_ops =
{ http_client: ::Appium::Http::Default.new, open_timeout: 999_999, read_timeout: 999_999 })
@core.quit_driver
# If automationName is set only in server side, then the following automation_name should be nil before
# starting driver.
au... | ruby | {
"resource": ""
} |
q11837 | Appium.Driver.set_implicit_wait | train | def set_implicit_wait(wait)
@driver.manage.timeouts.implicit_wait = wait
rescue Selenium::WebDriver::Error::UnknownError => e
unless e.message.include?('The operation requested is not yet implemented by Espresso driver')
raise ::Appium::Core::Error::ServerError
end
{}
end | ruby | {
"resource": ""
} |
q11838 | Appium.Driver.exists | train | def exists(pre_check = 0, post_check = @core.default_wait)
# do not uset set_wait here.
# it will cause problems with other methods reading the default_wait of 0
# which then gets converted to a 1 second wait.
@driver.manage.timeouts.implicit_wait = pre_check
# the element exists unless an... | ruby | {
"resource": ""
} |
q11839 | Appium.Ios.last_textfield | train | def last_textfield
result = eles_by_json(_textfield_visible).last
raise _no_such_element if result.nil?
result
end | ruby | {
"resource": ""
} |
q11840 | Appium.Common.px_to_window_rel | train | def px_to_window_rel(opts = {}, driver = $driver)
w = driver.window_size
x = opts.fetch :x, 0
y = opts.fetch :y, 0
OpenStruct.new(x: "#{x.to_f} / #{w.width.to_f}",
y: "#{y.to_f} / #{w.height.to_f}")
end | ruby | {
"resource": ""
} |
q11841 | Appium.Common.xml_keys | train | def xml_keys(target)
lazy_load_strings
@lazy_load_strings.select { |key, _value| key.downcase.include? target.downcase }
end | ruby | {
"resource": ""
} |
q11842 | Appium.Common.xml_values | train | def xml_values(target)
lazy_load_strings
@lazy_load_strings.select { |_key, value| value.downcase.include? target.downcase }
end | ruby | {
"resource": ""
} |
q11843 | Appium.Android.button | train | def button(value)
# Don't use ele_index because that only works on one element type.
# Android needs to combine button and image button to match iOS.
if value.is_a? Numeric
index = value
raise "#{index} is not a valid index. Must be >= 1" if index <= 0
# 1 indexed
retu... | ruby | {
"resource": ""
} |
q11844 | Appium.Android.last_button | train | def last_button
# uiautomator index doesn't support last
# and it's 0 indexed
button_index = tags(BUTTON).length
button_index -= 1 if button_index > 0
image_button_index = tags(IMAGE_BUTTON).length
image_button_index -= 1 if image_button_index > 0
find_element :uiautomator,
... | ruby | {
"resource": ""
} |
q11845 | Appium.Ios.text | train | def text(value)
return ele_index static_text_class, value if value.is_a? Numeric
ele_by_json_visible_contains static_text_class, value
end | ruby | {
"resource": ""
} |
q11846 | Appium.Android.scroll_to | train | def scroll_to(text, scrollable_index = 0)
text = %("#{text}")
rid = resource_id(text, "new UiSelector().resourceId(#{text})")
args = rid.empty? ? ["new UiSelector().textContains(#{text})", "new UiSelector().descriptionContains(#{text})"] : [rid]
args.each_with_index do |arg, index|
begi... | ruby | {
"resource": ""
} |
q11847 | Appium.Ios.page | train | def page(opts = {})
class_name = opts.is_a?(Hash) ? opts.fetch(:class, nil) : opts
source = get_source
# current_context may be nil which breaks start_with
if current_context && current_context.start_with?('WEBVIEW')
parser = @android_html_parser ||= Nokogiri::HTML::SAX::Parser.new(App... | ruby | {
"resource": ""
} |
q11848 | Appium.Ios.ele_index | train | def ele_index(class_name, index)
raise 'Index must be >= 1' unless index == 'last()' || (index.is_a?(Integer) && index >= 1)
elements = tags(class_name)
if index == 'last()'
result = elements.last
else
# elements array is 0 indexed
index -= 1
result = elements[i... | ruby | {
"resource": ""
} |
q11849 | Appium.Ios._all_pred | train | def _all_pred(opts)
predicate = opts[:predicate]
raise 'predicate must be provided' unless predicate
visible = opts.fetch :visible, true
%($.mainApp().getAllWithPredicate("#{predicate}", #{visible});)
end | ruby | {
"resource": ""
} |
q11850 | Appium.Common.wait_true | train | def wait_true(opts = {})
opts = opts.is_a?(Numeric) ? { timeout: opts } : opts
if opts.is_a? Hash
opts.empty? ? @core.wait_true { yield } : @core.wait_true(opts) { yield }
else
::Appium::Logger.warn('Arguments should be Hash like {timeout: 100}')
end
end | ruby | {
"resource": ""
} |
q11851 | Appium.Android.textfield | train | def textfield(value)
return ele_index EDIT_TEXT, value if value.is_a? Numeric
complex_find_contains EDIT_TEXT, value
end | ruby | {
"resource": ""
} |
q11852 | Appium.Android.text | train | def text(value)
return ele_index TEXT_VIEW, value if value.is_a? Numeric
complex_find_contains TEXT_VIEW, value
end | ruby | {
"resource": ""
} |
q11853 | Appium.Ios.button | train | def button(value)
# return button at index.
return ele_index button_class, value if value.is_a? Numeric
ele_by_json_visible_contains button_class, value
end | ruby | {
"resource": ""
} |
q11854 | HQMF2.PopulationCriteria.setup_derived_entry_elements | train | def setup_derived_entry_elements(id_generator)
@hqmf_id = attr_val('./*/cda:id/@root') || attr_val('./*/cda:typeId/@extension')
@title = attr_val('./*/cda:code/cda:displayName/@value').try(:titleize)
@type = attr_val('./*/cda:code/@code')
@comments = @entry.xpath('./*/cda:text/cda:xml/cda:qdmUse... | ruby | {
"resource": ""
} |
q11855 | HQMF2.PopulationCriteria.handle_preconditions | train | def handle_preconditions(id_generator)
# Nest multiple preconditions under a single root precondition
@preconditions = @entry.xpath('./*/cda:precondition[not(@nullFlavor)]', HQMF2::Document::NAMESPACES)
.collect do |pre|
precondition = Precondition.parse(pre, @doc, id_generato... | ruby | {
"resource": ""
} |
q11856 | HQMF2.PopulationCriteria.handle_observation_criteria | train | def handle_observation_criteria
exp = @entry.at_xpath('./cda:measureObservationDefinition/cda:value/cda:expression/@value',
HQMF2::Document::NAMESPACES)
# Measure Observations criteria rely on computed expressions. If it doesn't have one,
# then it is likely formatted impr... | ruby | {
"resource": ""
} |
q11857 | HQMF2.PopulationCriteria.parse_parts_to_dc | train | def parse_parts_to_dc(parts)
case parts.length
when 1
# If there is only one part, it is a reference to an existing data criteria's value
@doc.find_criteria_by_lvn(parts.first.strip.split('.')[0])
when 2
# If there are two parts, there is a computation performed, specifically t... | ruby | {
"resource": ""
} |
q11858 | HQMF2.PopulationCriteria.conjunction_code | train | def conjunction_code
case @type
when HQMF::PopulationCriteria::IPP, HQMF::PopulationCriteria::DENOM, HQMF::PopulationCriteria::NUMER,
HQMF::PopulationCriteria::MSRPOPL, HQMF::PopulationCriteria::STRAT
HQMF::Precondition::ALL_TRUE
when HQMF::PopulationCriteria::DENEXCEP, HQMF::Popula... | ruby | {
"resource": ""
} |
q11859 | HQMF2.Value.inclusive_temporal_ref? | train | def inclusive_temporal_ref?
# FIXME: NINF is used instead of 0 sometimes...? (not in the IG)
# FIXME: Given nullFlavor, but IG uses it and nullValue everywhere...
less_than_equal_tr = attr_val('../@highClosed') == 'true' &&
(attr_val('../cda:low/@value') == '0' || attr_val('... | ruby | {
"resource": ""
} |
q11860 | HQMF2.Value.inclusive_length_of_stay? | train | def inclusive_length_of_stay?
# lengthOfStay - EH111, EH108
less_than_equal_los = attr_val('../cda:low/@nullFlavor') == 'NINF' &&
attr_val('../@highClosed') != 'false'
greater_than_equal_los = attr_val('../cda:high/@nullFlavor') == 'PINF' &&
... | ruby | {
"resource": ""
} |
q11861 | HQMF2.Range.generate_any_value? | train | def generate_any_value?(lm, hm)
(lm.nil? || lm.is_a?(HQMF::AnyValue)) && (hm.nil? || hm.is_a?(HQMF::AnyValue))
end | ruby | {
"resource": ""
} |
q11862 | HQMF2.DocumentPopulationHelper.remove_population_preconditions | train | def remove_population_preconditions(doc)
# population sections
pop_ids = doc.xpath("//cda:populationCriteriaSection/cda:component[@typeCode='COMP']/*/cda:id",
HQMF2::Document::NAMESPACES)
# find the population entries and get their ids
pop_ids.each do |p_id|
doc... | ruby | {
"resource": ""
} |
q11863 | HQMF2.DocumentPopulationHelper.extract_observations | train | def extract_observations
has_observation = false
# look for observation data in separate section but create a population for it if it exists
observation_section = @doc.xpath('/cda:QualityMeasureDocument/cda:component/cda:measureObservationSection',
HQMF2::Documen... | ruby | {
"resource": ""
} |
q11864 | HQMF2.DocumentPopulationHelper.handle_base_populations | train | def handle_base_populations(population_def, population)
{
HQMF::PopulationCriteria::IPP => 'initialPopulationCriteria',
HQMF::PopulationCriteria::DENOM => 'denominatorCriteria',
HQMF::PopulationCriteria::NUMER => 'numeratorCriteria',
HQMF::PopulationCriteria::NUMEX => 'numeratorExc... | ruby | {
"resource": ""
} |
q11865 | HQMF2.DocumentPopulationHelper.handle_stratifications | train | def handle_stratifications(population_def, number_of_populations, population, id_def, population_index)
# handle stratifications (EP137, EP155)
stratifier_criteria_xpath = "cda:component/cda:stratifierCriteria[not(cda:component/cda:measureAttribute/cda:code[@code = 'SDE'])]/.."
population_def.xpath(s... | ruby | {
"resource": ""
} |
q11866 | HQMF2.DocumentPopulationHelper.build_population_criteria | train | def build_population_criteria(criteria_def, criteria_id, population)
criteria = PopulationCriteria.new(criteria_def, @document, @id_generator)
# check to see if we have an identical population criteria.
# this can happen since the hqmf 2.0 will export a DENOM, NUMER, etc for each population, even if ... | ruby | {
"resource": ""
} |
q11867 | HQMF1.Document.backfill_derived_code_lists | train | def backfill_derived_code_lists
data_criteria_by_id = {}
@data_criteria.each {|criteria| data_criteria_by_id[criteria.id] = criteria}
@data_criteria.each do |criteria|
if (criteria.derived_from)
derived_from = data_criteria_by_id[criteria.derived_from]
criteria.definition =... | ruby | {
"resource": ""
} |
q11868 | HQMF.PopulationCriteriaConverter.get_unmatched_population_keys | train | def get_unmatched_population_keys(target, source)
return [] if target.length == source.length
all_target_keys = target.values.map(&:id)
with_ref_keys = source.values.map(&:id).map {|key| @population_criteria_by_id[@population_reference[key]].id if @population_criteria_by_id[@population_reference[key]]... | ruby | {
"resource": ""
} |
q11869 | HQMF.PopulationCriteriaConverter.apply_to_submeasures | train | def apply_to_submeasures(subs, type, values, unpaired_type=nil, unpaired_keys=[])
new_subs = []
subs.each do |sub|
# this unless prevents us from forcing an exclusion or excepion onto a measure that has a submeasure without
# an exclusion or exception, but other populations with an exclusion... | ruby | {
"resource": ""
} |
q11870 | HQMF2.Document.setup_default_values | train | def setup_default_values(hqmf_contents, use_default_measure_period)
@id_generator = IdGenerator.new
@doc = @entry = Document.parse(hqmf_contents)
@id = attr_val('cda:QualityMeasureDocument/cda:id/@extension') ||
attr_val('cda:QualityMeasureDocument/cda:id/@root').upcase
@hqmf_set_id... | ruby | {
"resource": ""
} |
q11871 | HQMF2.Document.handle_attribute_code | train | def handle_attribute_code(attribute, code, name)
null_flavor = attribute.at_xpath('./cda:code/@nullFlavor', NAMESPACES).try(:value)
o_text = attribute.at_xpath('./cda:code/cda:originalText/@value', NAMESPACES).try(:value)
code_obj = HQMF::Coded.new(attribute.at_xpath('./cda:code/@xsi:type', NAMESPACES... | ruby | {
"resource": ""
} |
q11872 | HQMF2.Document.handle_attribute_value | train | def handle_attribute_value(attribute, value)
type = attribute.at_xpath('./cda:value/@xsi:type', NAMESPACES).try(:value)
case type
when 'II'
if value.nil?
value = attribute.at_xpath('./cda:value/@extension', NAMESPACES).try(:value)
end
HQMF::Identifier.new(type,
... | ruby | {
"resource": ""
} |
q11873 | HQMF2.Document.handle_specific_source_data_criteria_reference | train | def handle_specific_source_data_criteria_reference(criteria)
original_sdc = find(@source_data_criteria, :id, criteria.source_data_criteria)
updated_sdc = find(@source_data_criteria, :id, criteria.id)
if !updated_sdc.nil? && !criteria.specific_occurrence.nil? && (original_sdc.nil? || original_sdc.speci... | ruby | {
"resource": ""
} |
q11874 | HQMF2.DataCriteriaPostProcessing.handle_mapping_template | train | def handle_mapping_template(mapping)
if mapping
if mapping[:valueset_path] && @entry.at_xpath(mapping[:valueset_path])
@code_list_xpath = mapping[:valueset_path]
end
@value = DataCriteriaMethods.parse_value(@entry, mapping[:result_path]) if mapping[:result_path]
end
end | ruby | {
"resource": ""
} |
q11875 | HQMF2.DataCriteriaPostProcessing.handle_derived_specific_occurrences | train | def handle_derived_specific_occurrences
return unless @definition == 'derived'
# remove "_source" from source data critera. It gets added in in SpecificOccurrenceAndSource but
# when it gets added we have not yet determined the definition of the data criteria so we cannot
# skip adding it. Det... | ruby | {
"resource": ""
} |
q11876 | HQMF.DataCriteriaConverter.create_group_data_criteria | train | def create_group_data_criteria(preconditions, type, value, parent_id, id, standard_category, qds_data_type)
extract_group_data_criteria_tree(HQMF::DataCriteria::UNION,preconditions, type, parent_id)
end | ruby | {
"resource": ""
} |
q11877 | HQMF.DataCriteriaConverter.extract_group_data_criteria_tree | train | def extract_group_data_criteria_tree(conjunction, preconditions, type, parent_id)
children = []
preconditions.each do |precondition|
if (precondition.comparison?)
if (precondition.reference.id == HQMF::Document::MEASURE_PERIOD_ID)
children << measure_period_criteria
... | ruby | {
"resource": ""
} |
q11878 | HQMF.DataCriteriaConverter.create_measure_period_v1_data_criteria | train | def create_measure_period_v1_data_criteria(doc,measure_period,v1_data_criteria_by_id)
attributes = doc[:attributes]
attributes.keys.each {|key| attributes[key.to_s] = attributes[key]}
measure_period_key = attributes['MEASUREMENT_PERIOD'][:id]
measure_start_key = attributes['MEASUREMENT_S... | ruby | {
"resource": ""
} |
q11879 | HQMF2.DataCriteriaBaseExtractions.extract_child_criteria | train | def extract_child_criteria
@entry.xpath("./*/cda:outboundRelationship[@typeCode='COMP']/cda:criteriaReference/cda:id",
HQMF2::Document::NAMESPACES).collect do |ref|
Reference.new(ref).id
end.compact
end | ruby | {
"resource": ""
} |
q11880 | HQMF2.DataCriteriaBaseExtractions.all_subset_operators | train | def all_subset_operators
@entry.xpath('./*/cda:excerpt', HQMF2::Document::NAMESPACES).collect do |subset_operator|
SubsetOperator.new(subset_operator)
end
end | ruby | {
"resource": ""
} |
q11881 | HQMF1.Utilities.check_nil_conjunction_on_child | train | def check_nil_conjunction_on_child
if (@preconditions.length == 1 && @preconditions.first.conjunction.nil?)
bad_precondition = @preconditions.first
if (bad_precondition.restrictions.empty? && bad_precondition.subset.nil? && bad_precondition.expression.nil?)
@preconditions = @precondition... | ruby | {
"resource": ""
} |
q11882 | HQMF.Document.specific_occurrence_source_data_criteria | train | def specific_occurrence_source_data_criteria(force_sources=nil)
return [] if @source_data_criteria.nil?
matching = @source_data_criteria.select {|dc| !dc.specific_occurrence.nil?}
if force_sources
existing = matching.map(&:id)
matching.concat @source_data_criteria.select {|dc| !existi... | ruby | {
"resource": ""
} |
q11883 | HQMF.Document.attributes_for_code | train | def attributes_for_code(code, code_system)
@attributes.find_all { |e| e.send(:code) == code && e.send(:code_obj).send(:system) == code_system }
end | ruby | {
"resource": ""
} |
q11884 | HQMF.Document.backfill_patient_characteristics_with_codes | train | def backfill_patient_characteristics_with_codes(codes)
[].concat(self.all_data_criteria).concat(self.source_data_criteria).each do |data_criteria|
if (data_criteria.type == :characteristic and !data_criteria.property.nil?)
if (codes)
value_set = codes[data_criteria.code_list_i... | ruby | {
"resource": ""
} |
q11885 | HQMF2.DataCriteriaTypeAndDefinitionExtraction.handle_known_template_id | train | def handle_known_template_id(template_id)
case template_id
when VARIABLE_TEMPLATE
@derivation_operator = HQMF::DataCriteria::INTERSECT if @derivation_operator == HQMF::DataCriteria::XPRODUCT
@definition ||= 'derived'
@variable = true
@negation = false
when SATISFIES_ANY... | ruby | {
"resource": ""
} |
q11886 | HQMF2.DataCriteriaTypeAndDefinitionExtraction.extract_information_for_specific_variable | train | def extract_information_for_specific_variable
reference = @entry.at_xpath('./*/cda:outboundRelationship/cda:criteriaReference',
HQMF2::Document::NAMESPACES)
if reference
ref_id = strip_tokens(
"#{HQMF2::Utilities.attr_val(reference, 'cda:id/@extension')}_#... | ruby | {
"resource": ""
} |
q11887 | HQMF2.DataCriteriaTypeAndDefinitionExtraction.handle_specific_variable_ref | train | def handle_specific_variable_ref(reference_criteria)
# if there are no referenced children, then it's a variable representing
# a single data criteria, so just reference it
if reference_criteria.children_criteria.empty?
@children_criteria = [reference_criteria.id]
# otherwise pull all th... | ruby | {
"resource": ""
} |
q11888 | HQMF2.DataCriteriaTypeAndDefinitionExtraction.definition_for_nil_entry | train | def definition_for_nil_entry
reference = @entry.at_xpath('./*/cda:outboundRelationship/cda:criteriaReference', HQMF2::Document::NAMESPACES)
ref_id = nil
unless reference.nil?
ref_id = "#{HQMF2::Utilities.attr_val(reference, 'cda:id/@extension')}_#{HQMF2::Utilities.attr_val(reference, 'cda:id/@... | ruby | {
"resource": ""
} |
q11889 | HQMF2.DocumentUtilities.handle_variable | train | def handle_variable(data_criteria, collapsed_source_data_criteria)
if data_criteria.is_derived_specific_occurrence_variable
data_criteria.handle_derived_specific_occurrence_variable
extract_source_data_criteria(data_criteria)
return
end
tmp_id = data_criteria.id
groupe... | ruby | {
"resource": ""
} |
q11890 | HQMF2.DocumentUtilities.complex_coverage | train | def complex_coverage(data_criteria, check_criteria)
same_value = data_criteria.value.nil? ||
data_criteria.value.try(:to_model).try(:to_json) == check_criteria.value.try(:to_model).try(:to_json)
same_field_values = same_field_values_check(data_criteria, check_criteria)
same_negati... | ruby | {
"resource": ""
} |
q11891 | HQMF2.SpecificOccurrenceAndSource.handle_specific_and_source | train | def handle_specific_and_source(occurrence_identifier, source_data_criteria_extension, source_data_criteria_root,
specific_occurrence_const, specific_occurrence)
source_data_criteria = "#{source_data_criteria_extension}_#{source_data_criteria_root}_source"
if !occurrence_id... | ruby | {
"resource": ""
} |
q11892 | HQMF2.DataCriteria.basic_setup | train | def basic_setup
@status = attr_val('./*/cda:statusCode/@code')
@id_xpath = './*/cda:id/@extension'
@id = "#{attr_val('./*/cda:id/@extension')}_#{attr_val('./*/cda:id/@root')}"
@comments = @entry.xpath("./#{CRITERIA_GLOB}/cda:text/cda:xml/cda:qdmUserComments/cda:item/text()",
... | ruby | {
"resource": ""
} |
q11893 | HQMF2.DataCriteria.duplicate_child_info | train | def duplicate_child_info(child_ref)
@title ||= child_ref.title
@type ||= child_ref.subset_operators
@definition ||= child_ref.definition
@status ||= child_ref.status
@code_list_id ||= child_ref.code_list_id
@temporal_references = child_ref.temporal_references if @temporal_references.... | ruby | {
"resource": ""
} |
q11894 | HQMF2.DataCriteria.retrieve_field_values_model_for_model | train | def retrieve_field_values_model_for_model
field_values = {}
@field_values.each_pair do |id, val|
field_values[id] = val.to_model
end
@code_list_id ||= code_list_id
# Model transfers as a field
if %w(transfer_to transfer_from).include? @definition
field_code_list_id =... | ruby | {
"resource": ""
} |
q11895 | HQMF2.DataCriteria.retrieve_title_and_description_for_model | train | def retrieve_title_and_description_for_model
# drop "* Value Set" from titles
exact_desc = title.split(' ')[0...-3].join(' ')
# don't drop anything for patient characterstic titles
exact_desc = title if @definition.start_with?('patient_characteristic') && !title.end_with?('Value Set')
# r... | ruby | {
"resource": ""
} |
q11896 | Doggy.Model.save_local | train | def save_local
ensure_read_only!
self.path ||= Doggy.object_root.join("#{prefix}-#{id}.json")
File.open(@path, 'w') { |f| f.write(JSON.pretty_generate(to_h)) }
end | ruby | {
"resource": ""
} |
q11897 | ChefZero.Server.url | train | def url
sch = @options[:ssl] ? "https" : "http"
hosts = Array(@options[:host])
@url ||= if hosts.first.include?(":")
URI("#{sch}://[#{hosts.first}]:#{port}").to_s
else
URI("#{sch}://#{hosts.first}:#{port}").to_s
end
end | ruby | {
"resource": ""
} |
q11898 | ChefZero.Server.listen | train | def listen(hosts, port)
hosts.each do |host|
@server.listen(host, port)
end
true
rescue Errno::EADDRINUSE
ChefZero::Log.warn("Port #{port} not available")
@server.listeners.each { |l| l.close }
@server.listeners.clear
false
end | ruby | {
"resource": ""
} |
q11899 | ChefZero.Server.stop | train | def stop(wait = 5)
if @running
@server.shutdown if @server
@thread.join(wait) if @thread
end
rescue Timeout::Error
if @thread
ChefZero::Log.error("Chef Zero did not stop within #{wait} seconds! Killing...")
@thread.kill
SocketlessServerMap.deregister(port)
... | ruby | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.