tiss-ruby 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/.rspec +3 -0
- data/.rubocop.yml +1 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +111 -0
- data/LICENSE.txt +21 -0
- data/README.md +43 -0
- data/Rakefile +8 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/tiss/constants.rb +73 -0
- data/lib/tiss/creator.rb +52 -0
- data/lib/tiss/generator/generator.rb +20 -0
- data/lib/tiss/generator/generators/base_generator.rb +54 -0
- data/lib/tiss/generator/generators/model_generator.rb +36 -0
- data/lib/tiss/generator/generators/templates/model_template.erb +22 -0
- data/lib/tiss/generator/generators/templates/validator_template.erb +60 -0
- data/lib/tiss/generator/generators/validator_generator.rb +44 -0
- data/lib/tiss/model.rb +66 -0
- data/lib/tiss/models/anexo_clinico.rb +18 -0
- data/lib/tiss/models/anexo_clinico_prorrogacao.rb +18 -0
- data/lib/tiss/models/anexos_clinicos.rb +22 -0
- data/lib/tiss/models/anexos_guias_tiss.rb +22 -0
- data/lib/tiss/models/beneficiario.rb +18 -0
- data/lib/tiss/models/cabecalho_demonstrativo_odonto.rb +26 -0
- data/lib/tiss/models/cabecalho_guia.rb +11 -0
- data/lib/tiss/models/cabecalho_transacao.rb +36 -0
- data/lib/tiss/models/cod_profissional.rb +14 -0
- data/lib/tiss/models/codigo_contratado.rb +14 -0
- data/lib/tiss/models/contratado_executante.rb +11 -0
- data/lib/tiss/models/cpf_cnpj_contratado.rb +14 -0
- data/lib/tiss/models/ct_anexo_cabecalho.rb +34 -0
- data/lib/tiss/models/ct_anexo_lote.rb +14 -0
- data/lib/tiss/models/ct_anexo_recebimento.rb +38 -0
- data/lib/tiss/models/ct_autorizacao_dados.rb +36 -0
- data/lib/tiss/models/ct_autorizacao_internacao.rb +32 -0
- data/lib/tiss/models/ct_autorizacao_sadt.rb +32 -0
- data/lib/tiss/models/ct_autorizacao_solicita_status.rb +18 -0
- data/lib/tiss/models/ct_beneficiario_dados.rb +36 -0
- data/lib/tiss/models/ct_conta_medica_resumo.rb +52 -0
- data/lib/tiss/models/ct_contratado_dados.rb +22 -0
- data/lib/tiss/models/ct_contratado_profissional_dados.rb +26 -0
- data/lib/tiss/models/ct_credito_odonto.rb +14 -0
- data/lib/tiss/models/ct_dados_complementares_beneficiario.rb +26 -0
- data/lib/tiss/models/ct_dados_complementares_beneficiario_radio.rb +14 -0
- data/lib/tiss/models/ct_dados_resumo_demonstrativo.rb +34 -0
- data/lib/tiss/models/ct_demonstrativo_cabecalho.rb +26 -0
- data/lib/tiss/models/ct_demonstrativo_retorno.rb +26 -0
- data/lib/tiss/models/ct_demonstrativo_solicitacao.rb +14 -0
- data/lib/tiss/models/ct_descontos.rb +22 -0
- data/lib/tiss/models/ct_diagnostico.rb +18 -0
- data/lib/tiss/models/ct_diagnostico_oncologico.rb +34 -0
- data/lib/tiss/models/ct_drogas_solicitadas.rb +31 -0
- data/lib/tiss/models/ct_elegibilidade_recibo.rb +58 -0
- data/lib/tiss/models/ct_elegibilidade_verifica.rb +50 -0
- data/lib/tiss/models/ct_fonte_pagadora.rb +14 -0
- data/lib/tiss/models/ct_glosa_recibo.rb +54 -0
- data/lib/tiss/models/ct_glosa_recibo_odonto.rb +54 -0
- data/lib/tiss/models/ct_guia_cabecalho.rb +14 -0
- data/lib/tiss/models/ct_guia_cancelamento.rb +22 -0
- data/lib/tiss/models/ct_guia_cancelamento_recibo.rb +18 -0
- data/lib/tiss/models/ct_guia_dados.rb +44 -0
- data/lib/tiss/models/ct_guia_dados_anexo.rb +34 -0
- data/lib/tiss/models/ct_guia_dados_odonto.rb +66 -0
- data/lib/tiss/models/ct_guia_recurso.rb +26 -0
- data/lib/tiss/models/ct_guia_recurso_lote.rb +14 -0
- data/lib/tiss/models/ct_guia_valor_total.rb +38 -0
- data/lib/tiss/models/ct_guia_valor_total_sadt.rb +34 -0
- data/lib/tiss/models/ct_hipotese_diagnostica.rb +14 -0
- data/lib/tiss/models/ct_ident_equipe.rb +34 -0
- data/lib/tiss/models/ct_ident_equipe_sadt.rb +34 -0
- data/lib/tiss/models/ct_intervalo_ciclos.rb +14 -0
- data/lib/tiss/models/ct_login_senha.rb +14 -0
- data/lib/tiss/models/ct_lote_anexo_status.rb +26 -0
- data/lib/tiss/models/ct_lote_status.rb +30 -0
- data/lib/tiss/models/ct_motivo_glosa.rb +14 -0
- data/lib/tiss/models/ct_opm_utilizada.rb +14 -0
- data/lib/tiss/models/ct_opme_dados.rb +14 -0
- data/lib/tiss/models/ct_outras_despesas.rb +10 -0
- data/lib/tiss/models/ct_pagamento_dados.rb +26 -0
- data/lib/tiss/models/ct_pagamento_resumo.rb +22 -0
- data/lib/tiss/models/ct_prestador_identificacao.rb +18 -0
- data/lib/tiss/models/ct_procedimento_autorizado.rb +51 -0
- data/lib/tiss/models/ct_procedimento_dados.rb +18 -0
- data/lib/tiss/models/ct_procedimento_executado.rb +59 -0
- data/lib/tiss/models/ct_procedimento_executado_honor_indiv.rb +55 -0
- data/lib/tiss/models/ct_procedimento_executado_int.rb +55 -0
- data/lib/tiss/models/ct_procedimento_executado_odonto.rb +47 -0
- data/lib/tiss/models/ct_procedimento_executado_outras.rb +62 -0
- data/lib/tiss/models/ct_procedimento_executado_sadt.rb +55 -0
- data/lib/tiss/models/ct_procedimento_solicitado.rb +18 -0
- data/lib/tiss/models/ct_procedimentos_complementares.rb +18 -0
- data/lib/tiss/models/ct_protocolo_anexo_status.rb +18 -0
- data/lib/tiss/models/ct_protocolo_detalhe.rb +22 -0
- data/lib/tiss/models/ct_protocolo_detalhe_anexo.rb +26 -0
- data/lib/tiss/models/ct_protocolo_recebimento.rb +26 -0
- data/lib/tiss/models/ct_protocolo_recebimento_anexo.rb +30 -0
- data/lib/tiss/models/ct_protocolo_recebimento_recurso.rb +30 -0
- data/lib/tiss/models/ct_protocolo_recurso.rb +18 -0
- data/lib/tiss/models/ct_protocolo_solicitacao_status.rb +14 -0
- data/lib/tiss/models/ct_protocolo_status.rb +18 -0
- data/lib/tiss/models/ct_recebimento_lote.rb +14 -0
- data/lib/tiss/models/ct_recebimento_recurso.rb +14 -0
- data/lib/tiss/models/ct_recibo_cancela_guia.rb +14 -0
- data/lib/tiss/models/ct_recibo_comunicacao.rb +14 -0
- data/lib/tiss/models/ct_recurso_glosa_recebimento.rb +54 -0
- data/lib/tiss/models/ct_resposta_elegibilidade.rb +14 -0
- data/lib/tiss/models/ct_resposta_glosa.rb +22 -0
- data/lib/tiss/models/ct_resposta_glosa_guia_medica.rb +35 -0
- data/lib/tiss/models/ct_resposta_glosa_item_medico.rb +55 -0
- data/lib/tiss/models/ct_resposta_recurso_guia_odonto.rb +34 -0
- data/lib/tiss/models/ct_resposta_recurso_item_odonto.rb +26 -0
- data/lib/tiss/models/ct_situacao_autorizacao.rb +26 -0
- data/lib/tiss/models/ct_situacao_clinica.rb +10 -0
- data/lib/tiss/models/ct_situacao_inicial.rb +22 -0
- data/lib/tiss/models/ct_situacao_protocolo.rb +18 -0
- data/lib/tiss/models/ct_valor_credito_desconto.rb +18 -0
- data/lib/tiss/models/ct_valor_total.rb +18 -0
- data/lib/tiss/models/ctm_anexo_solicitacao_opme.rb +34 -0
- data/lib/tiss/models/ctm_anexo_solicitacao_quimio.rb +55 -0
- data/lib/tiss/models/ctm_anexo_solicitacao_radio.rb +59 -0
- data/lib/tiss/models/ctm_anexo_solicitante.rb +18 -0
- data/lib/tiss/models/ctm_autorizacao_internacao.rb +22 -0
- data/lib/tiss/models/ctm_autorizacao_opme.rb +30 -0
- data/lib/tiss/models/ctm_autorizacao_prorrogacao.rb +22 -0
- data/lib/tiss/models/ctm_autorizacao_quimio.rb +67 -0
- data/lib/tiss/models/ctm_autorizacao_radio.rb +71 -0
- data/lib/tiss/models/ctm_autorizacao_servico.rb +47 -0
- data/lib/tiss/models/ctm_beneficiario_comunicacao.rb +22 -0
- data/lib/tiss/models/ctm_beneficiario_comunicacao_recibo.rb +18 -0
- data/lib/tiss/models/ctm_consulta_atendimento.rb +18 -0
- data/lib/tiss/models/ctm_consulta_guia.rb +52 -0
- data/lib/tiss/models/ctm_demonstrativo_analise_conta.rb +34 -0
- data/lib/tiss/models/ctm_demonstrativo_pagamento.rb +26 -0
- data/lib/tiss/models/ctm_guia_lote.rb +14 -0
- data/lib/tiss/models/ctm_honorario_individual_guia.rb +58 -0
- data/lib/tiss/models/ctm_internacao_dados.rb +42 -0
- data/lib/tiss/models/ctm_internacao_dados_saida.rb +18 -0
- data/lib/tiss/models/ctm_internacao_resumo_guia.rb +54 -0
- data/lib/tiss/models/ctm_internacao_solicitacao_guia.rb +65 -0
- data/lib/tiss/models/ctm_prorrogacao_solicitacao_guia.rb +50 -0
- data/lib/tiss/models/ctm_recurso_glosa.rb +50 -0
- data/lib/tiss/models/ctm_solicitacao_lote.rb +22 -0
- data/lib/tiss/models/ctm_sp_sadt_atendimento.rb +22 -0
- data/lib/tiss/models/ctm_sp_sadt_guia.rb +54 -0
- data/lib/tiss/models/ctm_sp_sadt_solicitacao_guia.rb +65 -0
- data/lib/tiss/models/cto_anexo_situacao_inicial.rb +34 -0
- data/lib/tiss/models/cto_anexo_situacao_inicialna_gto.rb +22 -0
- data/lib/tiss/models/cto_autorizacao_servico.rb +52 -0
- data/lib/tiss/models/cto_demonstrativo_odontologia.rb +42 -0
- data/lib/tiss/models/cto_guia_odontologia.rb +108 -0
- data/lib/tiss/models/cto_odonto_solicitacao_guia.rb +110 -0
- data/lib/tiss/models/cto_recurso_glosa_odonto.rb +50 -0
- data/lib/tiss/models/dados_beneficiario.rb +28 -0
- data/lib/tiss/models/dados_conta.rb +10 -0
- data/lib/tiss/models/dados_contratado.rb +22 -0
- data/lib/tiss/models/dados_contratado_executante.rb +18 -0
- data/lib/tiss/models/dados_executante.rb +22 -0
- data/lib/tiss/models/dados_guia.rb +18 -0
- data/lib/tiss/models/dados_guias_protocolo.rb +14 -0
- data/lib/tiss/models/dados_hospital_solicitado.rb +18 -0
- data/lib/tiss/models/dados_internacao.rb +54 -0
- data/lib/tiss/models/dados_pagamento.rb +71 -0
- data/lib/tiss/models/dados_pagamento_guia.rb +58 -0
- data/lib/tiss/models/dados_pagamento_por_data.rb +26 -0
- data/lib/tiss/models/dados_prestador.rb +26 -0
- data/lib/tiss/models/dados_profissionais_responsaveis.rb +58 -0
- data/lib/tiss/models/dados_resumo.rb +10 -0
- data/lib/tiss/models/dados_solicitacao.rb +18 -0
- data/lib/tiss/models/dados_solicitante.rb +14 -0
- data/lib/tiss/models/deb_cred_demonstrativo.rb +10 -0
- data/lib/tiss/models/deb_cred_por_data_pagamento.rb +10 -0
- data/lib/tiss/models/debitos_creditos_por_data.rb +10 -0
- data/lib/tiss/models/declaracoes.rb +22 -0
- data/lib/tiss/models/demonstrativo_analise.rb +18 -0
- data/lib/tiss/models/demonstrativo_pagamento.rb +22 -0
- data/lib/tiss/models/dente_regiao.rb +14 -0
- data/lib/tiss/models/dentes.rb +14 -0
- data/lib/tiss/models/despesa.rb +24 -0
- data/lib/tiss/models/destino.rb +14 -0
- data/lib/tiss/models/detalhes_guia.rb +43 -0
- data/lib/tiss/models/diagnostico_oncologico_quimioterapia.rb +33 -0
- data/lib/tiss/models/diagnostico_oncologico_radio.rb +14 -0
- data/lib/tiss/models/drogas_solicitadas.rb +10 -0
- data/lib/tiss/models/epilogo.rb +10 -0
- data/lib/tiss/models/glosa_anexo.rb +14 -0
- data/lib/tiss/models/glosa_guia.rb +10 -0
- data/lib/tiss/models/glosa_protocolo.rb +14 -0
- data/lib/tiss/models/glosas_procedimento.rb +14 -0
- data/lib/tiss/models/guias_canceladas.rb +10 -0
- data/lib/tiss/models/guias_cancelamento.rb +14 -0
- data/lib/tiss/models/guias_medicas.rb +10 -0
- data/lib/tiss/models/guias_odonto.rb +10 -0
- data/lib/tiss/models/guias_recurso.rb +22 -0
- data/lib/tiss/models/guias_tiss.rb +34 -0
- data/lib/tiss/models/hipoteses_diagnosticas.rb +14 -0
- data/lib/tiss/models/ident_equipe.rb +10 -0
- data/lib/tiss/models/identificacao_opm.rb +26 -0
- data/lib/tiss/models/identificacao_solicitante.rb +14 -0
- data/lib/tiss/models/identificacao_transacao.rb +22 -0
- data/lib/tiss/models/itens_guia.rb +47 -0
- data/lib/tiss/models/local_contratado.rb +18 -0
- data/lib/tiss/models/lote.rb +14 -0
- data/lib/tiss/models/lote_anexo.rb +14 -0
- data/lib/tiss/models/mensagem_tiss.rb +27 -0
- data/lib/tiss/models/motivos_glosa.rb +10 -0
- data/lib/tiss/models/motivos_negativa.rb +10 -0
- data/lib/tiss/models/opcao_recurso.rb +14 -0
- data/lib/tiss/models/opcao_recurso_guia.rb +18 -0
- data/lib/tiss/models/operadora_prestador.rb +50 -0
- data/lib/tiss/models/opm.rb +10 -0
- data/lib/tiss/models/opme_solicitada.rb +34 -0
- data/lib/tiss/models/opme_solicitadas.rb +10 -0
- data/lib/tiss/models/origem.rb +14 -0
- data/lib/tiss/models/pagamentos.rb +10 -0
- data/lib/tiss/models/pagamentos_por_data.rb +26 -0
- data/lib/tiss/models/periodo.rb +14 -0
- data/lib/tiss/models/periodo_proc.rb +14 -0
- data/lib/tiss/models/prestador_autorizado.rb +14 -0
- data/lib/tiss/models/prestador_operadora.rb +50 -0
- data/lib/tiss/models/procedimento.rb +18 -0
- data/lib/tiss/models/procedimento_realizado.rb +11 -0
- data/lib/tiss/models/procedimento_solicitado.rb +34 -0
- data/lib/tiss/models/procedimentos_adicionais.rb +14 -0
- data/lib/tiss/models/procedimentos_autorizados.rb +48 -0
- data/lib/tiss/models/procedimentos_complementares.rb +11 -0
- data/lib/tiss/models/procedimentos_executados.rb +51 -0
- data/lib/tiss/models/procedimentos_realizados.rb +10 -0
- data/lib/tiss/models/procedimentos_solicitados.rb +54 -0
- data/lib/tiss/models/profissionais.rb +34 -0
- data/lib/tiss/models/protocolos.rb +22 -0
- data/lib/tiss/models/recebimento_anexo.rb +14 -0
- data/lib/tiss/models/recibo_glosa_status.rb +42 -0
- data/lib/tiss/models/recurso_guia.rb +58 -0
- data/lib/tiss/models/recurso_guia_completa.rb +14 -0
- data/lib/tiss/models/recurso_procedimento.rb +55 -0
- data/lib/tiss/models/recurso_protocolo.rb +23 -0
- data/lib/tiss/models/relacao_glosa.rb +14 -0
- data/lib/tiss/models/relacao_guias.rb +70 -0
- data/lib/tiss/models/resposta_elegibilidade.rb +14 -0
- data/lib/tiss/models/servicos_autorizados.rb +10 -0
- data/lib/tiss/models/situacao_demonstrativo_retorno.rb +34 -0
- data/lib/tiss/models/totais_bruto_demonstrativo.rb +26 -0
- data/lib/tiss/models/totais_brutos_demonstrativo.rb +22 -0
- data/lib/tiss/models/totais_brutos_por_data.rb +22 -0
- data/lib/tiss/models/totais_demonstrativo.rb +18 -0
- data/lib/tiss/models/totais_liquidos_demonstrativo.rb +18 -0
- data/lib/tiss/models/totais_liquidos_por_data.rb +18 -0
- data/lib/tiss/models/totais_por_data.rb +26 -0
- data/lib/tiss/models/totais_por_protocolo.rb +26 -0
- data/lib/tiss/models/total_liquido_por_data.rb +18 -0
- data/lib/tiss/models/tratamentos_anteriores.rb +30 -0
- data/lib/tiss/tiss.rb +39 -0
- data/lib/tiss/version.rb +5 -0
- data/lib/tiss/xsd/class_maker.rb +242 -0
- data/lib/tiss/xsd/convert.rb +26 -0
- data/lib/tiss-ruby.rb +3 -0
- data/lib/xsd/class_maker.rb +219 -0
- data/lib/xsd/convert.rb +26 -0
- data/resources/TabelasDominio.doc +0 -0
- data/resources/tissAssinaturaDigital_v1.01.xsd +16 -0
- data/resources/tissComplexTypesV3_02_00.xsd +1370 -0
- data/resources/tissComplexTypesV3_02_01.xsd +1370 -0
- data/resources/tissComplexTypesV3_02_02.xsd +1370 -0
- data/resources/tissComplexTypesV3_03_01.xsd +1372 -0
- data/resources/tissComplexTypesV3_03_02.xsd +1372 -0
- data/resources/tissComplexTypesV3_03_03.xsd +1372 -0
- data/resources/tissComplexTypesV3_04_00.xsd +1406 -0
- data/resources/tissGuiasV3_02_00.xsd +1387 -0
- data/resources/tissGuiasV3_02_01.xsd +1388 -0
- data/resources/tissGuiasV3_02_02.xsd +1389 -0
- data/resources/tissGuiasV3_03_01.xsd +1402 -0
- data/resources/tissGuiasV3_03_02.xsd +1401 -0
- data/resources/tissGuiasV3_03_03.xsd +1401 -0
- data/resources/tissGuiasV3_04_00.xsd +1387 -0
- data/resources/tissSimpleTypesV3_02_00.xsd +3158 -0
- data/resources/tissSimpleTypesV3_02_01.xsd +3597 -0
- data/resources/tissSimpleTypesV3_02_02.xsd +3830 -0
- data/resources/tissSimpleTypesV3_03_01.xsd +4120 -0
- data/resources/tissSimpleTypesV3_03_02.xsd +4144 -0
- data/resources/tissSimpleTypesV3_03_03.xsd +4163 -0
- data/resources/tissSimpleTypesV3_04_00.xsd +4233 -0
- data/resources/tissV3_02_00.xsd +118 -0
- data/resources/tissV3_02_01.xsd +118 -0
- data/resources/tissV3_02_02.xsd +121 -0
- data/resources/tissV3_03_01.xsd +118 -0
- data/resources/tissV3_03_02.xsd +118 -0
- data/resources/tissV3_03_03.xsd +118 -0
- data/resources/tissV3_04_00.xsd +118 -0
- data/resources/xmldsig-core-schema.xsd +309 -0
- data/tiss-ruby.gemspec +55 -0
- metadata +569 -0
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'erb'
|
4
|
+
|
5
|
+
module Tiss::Generator
|
6
|
+
class ValidatorGenerator < BaseGenerator
|
7
|
+
def call(version, name, restrictions, target)
|
8
|
+
name = classify "#{underscore(name)}_validator"
|
9
|
+
ap name
|
10
|
+
base = restrictions
|
11
|
+
.attributes['base'].value.split(':').last
|
12
|
+
|
13
|
+
base = case base
|
14
|
+
when 'decimal'
|
15
|
+
'float'
|
16
|
+
when 'boolean'
|
17
|
+
'true_class'
|
18
|
+
else
|
19
|
+
base
|
20
|
+
end
|
21
|
+
|
22
|
+
type = constantize classify base
|
23
|
+
|
24
|
+
ws_action = select_children(restrictions, 'whiteSpace').first
|
25
|
+
ws_action = ws_action.attributes['value'].value unless ws_action.nil?
|
26
|
+
|
27
|
+
enum_values = select_children(restrictions, 'enumeration').collect do |enum|
|
28
|
+
enum.attributes['value'].value
|
29
|
+
end
|
30
|
+
|
31
|
+
pattern = select_children(restrictions, 'pattern').first
|
32
|
+
pattern = pattern.attributes['value'].value unless pattern.nil?
|
33
|
+
|
34
|
+
template = File.read(File.join(template_dir, 'validator_template.erb'))
|
35
|
+
file_content = ERB.new(template).result(binding)
|
36
|
+
File.open("lib/tiss/#{version}/validators/#{underscore(name)}.rb", 'w+') do |f|
|
37
|
+
f.write(file_content)
|
38
|
+
end
|
39
|
+
File.open("lib/tiss/#{version}/#{version}.rb", 'a') do |f|
|
40
|
+
f.puts "require_relative 'validators/#{underscore(name)}'"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
data/lib/tiss/model.rb
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Tiss
|
4
|
+
module Model
|
5
|
+
class Base
|
6
|
+
DEFINED_ATTRIBUTES = Hash.new { |hash, key| hash[key] = [] }
|
7
|
+
|
8
|
+
class << self
|
9
|
+
def attr_accessor(*vars)
|
10
|
+
@attributes ||= []
|
11
|
+
@attributes.concat vars
|
12
|
+
super(*vars)
|
13
|
+
end
|
14
|
+
|
15
|
+
attr_reader :attributes
|
16
|
+
|
17
|
+
def attribute_config(name, **opts)
|
18
|
+
DEFINED_ATTRIBUTES[self.name] << { name: name, options: opts }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def attributes
|
23
|
+
(self.class.ancestors&.second&.attributes || []) + self.class.attributes
|
24
|
+
end
|
25
|
+
|
26
|
+
def attributes_by(version)
|
27
|
+
version = version.gsub('.', '_')
|
28
|
+
|
29
|
+
attributes.map do |key|
|
30
|
+
config = attribute_configs.find { |i| i[:name] == key }
|
31
|
+
|
32
|
+
unless_versions = []
|
33
|
+
only_versions = []
|
34
|
+
|
35
|
+
if config
|
36
|
+
unless_versions = config[:options] && config[:options].fetch(:unless, [])
|
37
|
+
end
|
38
|
+
if config
|
39
|
+
only_versions = config[:options] && config[:options].fetch(:only, [])
|
40
|
+
end
|
41
|
+
|
42
|
+
if unless_versions.any? || only_versions.any?
|
43
|
+
if (unless_versions.any? && unless_versions.include?(version)) ||
|
44
|
+
(only_versions.any? && !only_versions.include?(version))
|
45
|
+
nil
|
46
|
+
else
|
47
|
+
[key, send(key)]
|
48
|
+
end
|
49
|
+
else
|
50
|
+
[key, send(key)]
|
51
|
+
end
|
52
|
+
end.compact.to_h
|
53
|
+
end
|
54
|
+
|
55
|
+
def attributes_with_values
|
56
|
+
attributes.map do |attr|
|
57
|
+
[attr, send(attr)]
|
58
|
+
end.to_h
|
59
|
+
end
|
60
|
+
|
61
|
+
def attribute_configs
|
62
|
+
DEFINED_ATTRIBUTES[self.class.name]
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
|
2
|
+
module Tiss::Model
|
3
|
+
class AnexoClinico < Base
|
4
|
+
|
5
|
+
# @type: CtmAnexoSolicitacaoQuimio
|
6
|
+
attr_accessor :solicitacaoQuimioterapia
|
7
|
+
|
8
|
+
# @type: CtmAnexoSolicitacaoRadio
|
9
|
+
attr_accessor :solicitacaoRadioterapia
|
10
|
+
|
11
|
+
# @type: CtmAnexoSolicitacaoOpme
|
12
|
+
attr_accessor :solicitacaoOPME
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
|
2
|
+
module Tiss::Model
|
3
|
+
class AnexoClinicoProrrogacao < Base
|
4
|
+
|
5
|
+
# @type: CtmAnexoSolicitacaoQuimio
|
6
|
+
attr_accessor :solicitacaoQuimioterapia
|
7
|
+
|
8
|
+
# @type: CtmAnexoSolicitacaoRadio
|
9
|
+
attr_accessor :solicitacaoRadioterapia
|
10
|
+
|
11
|
+
# @type: CtmAnexoSolicitacaoOpme
|
12
|
+
attr_accessor :solicitacaoOPME
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
|
2
|
+
module Tiss::Model
|
3
|
+
class AnexosClinicos < Base
|
4
|
+
|
5
|
+
# @type: CtmAutorizacaoOpme
|
6
|
+
attr_accessor :anexoOPME
|
7
|
+
|
8
|
+
# @type: CtmAutorizacaoQuimio
|
9
|
+
attr_accessor :anexoQuimio
|
10
|
+
|
11
|
+
# @type: CtmAutorizacaoRadio
|
12
|
+
attr_accessor :anexoRadio
|
13
|
+
|
14
|
+
# @type: CtoAnexoSituacaoInicial
|
15
|
+
attr_accessor :anexoSituacaoInicial
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
|
2
|
+
module Tiss::Model
|
3
|
+
class AnexosGuiasTiss < Base
|
4
|
+
|
5
|
+
# @type: CtoAnexoSituacaoInicial
|
6
|
+
attr_accessor :anexoSituacaoInicial
|
7
|
+
|
8
|
+
# @type: CtmAnexoSolicitacaoRadio
|
9
|
+
attr_accessor :anexoSolicitacaoRadio
|
10
|
+
|
11
|
+
# @type: CtmAnexoSolicitacaoQuimio
|
12
|
+
attr_accessor :anexoSolicitacaoQuimio
|
13
|
+
|
14
|
+
# @type: CtmAnexoSolicitacaoOpme
|
15
|
+
attr_accessor :anexoSolicitacaoOPME
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
|
2
|
+
module Tiss::Model
|
3
|
+
class CabecalhoDemonstrativoOdonto < Base
|
4
|
+
|
5
|
+
# @type: StRegistroAns
|
6
|
+
attr_accessor :registroANS
|
7
|
+
|
8
|
+
# @type: StTexto12
|
9
|
+
attr_accessor :numeroDemonstrativo
|
10
|
+
|
11
|
+
# @type: StTexto70
|
12
|
+
attr_accessor :nomeOperadora
|
13
|
+
|
14
|
+
# @type: StCnpj
|
15
|
+
attr_accessor :cnpjOper
|
16
|
+
|
17
|
+
# @type: PeriodoProc
|
18
|
+
attr_accessor :periodoProc
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
|
2
|
+
module Tiss::Model
|
3
|
+
class CabecalhoTransacao < Base
|
4
|
+
|
5
|
+
# @type: IdentificacaoTransacao
|
6
|
+
attr_accessor :identificacaoTransacao
|
7
|
+
|
8
|
+
# @type: DmTipoGlosa
|
9
|
+
attr_accessor :falhaNegocio
|
10
|
+
|
11
|
+
# @type: Origem
|
12
|
+
attr_accessor :origem
|
13
|
+
|
14
|
+
# @type: Destino
|
15
|
+
attr_accessor :destino
|
16
|
+
|
17
|
+
# @type: DmVersao
|
18
|
+
attr_accessor :versaoPadrao
|
19
|
+
|
20
|
+
# @type: CtLoginSenha
|
21
|
+
attr_accessor :loginSenhaPrestador
|
22
|
+
|
23
|
+
# @type: DmVersao
|
24
|
+
attr_accessor :Padrao
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
attribute_config :versaoPadrao, only: %w[3_02_00 3_02_01]
|
31
|
+
|
32
|
+
|
33
|
+
attribute_config :Padrao, unless: %w[3_02_00 3_02_01]
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
|
2
|
+
module Tiss::Model
|
3
|
+
class CtAnexoCabecalho < Base
|
4
|
+
|
5
|
+
# @type: StRegistroAns
|
6
|
+
attr_accessor :registroANS
|
7
|
+
|
8
|
+
# @type: StTexto20
|
9
|
+
attr_accessor :numeroGuiaAnexo
|
10
|
+
|
11
|
+
# @type: StTexto20
|
12
|
+
attr_accessor :numeroGuiaReferenciada
|
13
|
+
|
14
|
+
# @type: StTexto20
|
15
|
+
attr_accessor :numeroGuiaOperadora
|
16
|
+
|
17
|
+
# @type: StData
|
18
|
+
attr_accessor :dataSolicitacao
|
19
|
+
|
20
|
+
# @type: StTexto20
|
21
|
+
attr_accessor :senha
|
22
|
+
|
23
|
+
# @type: StData
|
24
|
+
attr_accessor :dataAutorizacao
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
|
2
|
+
module Tiss::Model
|
3
|
+
class CtAnexoRecebimento < Base
|
4
|
+
|
5
|
+
# @type: StTexto12
|
6
|
+
attr_accessor :nrProtocoloRecebimento
|
7
|
+
|
8
|
+
# @type: StData
|
9
|
+
attr_accessor :dataEnvioAnexo
|
10
|
+
|
11
|
+
# @type: StTexto12
|
12
|
+
attr_accessor :numeroLote
|
13
|
+
|
14
|
+
# @type: StRegistroAns
|
15
|
+
attr_accessor :registroANS
|
16
|
+
|
17
|
+
# @type: CtContratadoDados
|
18
|
+
attr_accessor :dadosPrestador
|
19
|
+
|
20
|
+
# @type: StNumerico3
|
21
|
+
attr_accessor :qtAnexosClinicos
|
22
|
+
|
23
|
+
# @type: AnexosClinicos
|
24
|
+
attr_accessor :anexosClinicos
|
25
|
+
|
26
|
+
# @type: StTexto500
|
27
|
+
attr_accessor :observacao
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
|
2
|
+
module Tiss::Model
|
3
|
+
class CtAutorizacaoDados < Base
|
4
|
+
|
5
|
+
# @type: StTexto20
|
6
|
+
attr_accessor :numeroGuiaPrestador
|
7
|
+
|
8
|
+
# @type: StTexto20
|
9
|
+
attr_accessor :numeroGuiaOperadora
|
10
|
+
|
11
|
+
# @type: StData
|
12
|
+
attr_accessor :dataAutorizacao
|
13
|
+
|
14
|
+
# @type: StTexto20
|
15
|
+
attr_accessor :senha
|
16
|
+
|
17
|
+
# @type: StData
|
18
|
+
attr_accessor :dataValidadeSenha
|
19
|
+
|
20
|
+
# @type: DmAusenciaCodValidacao
|
21
|
+
attr_accessor :ausenciaCodValidacao
|
22
|
+
|
23
|
+
# @type: StTexto10
|
24
|
+
attr_accessor :codValidacao
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
attribute_config :ausenciaCodValidacao, only: %w[3_04_00]
|
32
|
+
|
33
|
+
attribute_config :codValidacao, only: %w[3_04_00]
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
|
2
|
+
module Tiss::Model
|
3
|
+
class CtAutorizacaoInternacao < Base
|
4
|
+
|
5
|
+
# @type: StTexto20
|
6
|
+
attr_accessor :numeroGuiaOperadora
|
7
|
+
|
8
|
+
# @type: StData
|
9
|
+
attr_accessor :dataAutorizacao
|
10
|
+
|
11
|
+
# @type: StTexto20
|
12
|
+
attr_accessor :senha
|
13
|
+
|
14
|
+
# @type: StData
|
15
|
+
attr_accessor :dataValidadeSenha
|
16
|
+
|
17
|
+
# @type: DmAusenciaCodValidacao
|
18
|
+
attr_accessor :ausenciaCodValidacao
|
19
|
+
|
20
|
+
# @type: StTexto10
|
21
|
+
attr_accessor :codValidacao
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
attribute_config :ausenciaCodValidacao, only: %w[3_04_00]
|
28
|
+
|
29
|
+
attribute_config :codValidacao, only: %w[3_04_00]
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
|
2
|
+
module Tiss::Model
|
3
|
+
class CtAutorizacaoSadt < Base
|
4
|
+
|
5
|
+
# @type: StTexto20
|
6
|
+
attr_accessor :numeroGuiaOperadora
|
7
|
+
|
8
|
+
# @type: StData
|
9
|
+
attr_accessor :dataAutorizacao
|
10
|
+
|
11
|
+
# @type: StTexto20
|
12
|
+
attr_accessor :senha
|
13
|
+
|
14
|
+
# @type: StData
|
15
|
+
attr_accessor :dataValidadeSenha
|
16
|
+
|
17
|
+
# @type: DmAusenciaCodValidacao
|
18
|
+
attr_accessor :ausenciaCodValidacao
|
19
|
+
|
20
|
+
# @type: StTexto10
|
21
|
+
attr_accessor :codValidacao
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
attribute_config :ausenciaCodValidacao, only: %w[3_04_00]
|
28
|
+
|
29
|
+
attribute_config :codValidacao, only: %w[3_04_00]
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
|
2
|
+
module Tiss::Model
|
3
|
+
class CtAutorizacaoSolicitaStatus < Base
|
4
|
+
|
5
|
+
# @type: CtGuiaCabecalho
|
6
|
+
attr_accessor :identificacaoSolicitacao
|
7
|
+
|
8
|
+
# @type: CtBeneficiarioDados
|
9
|
+
attr_accessor :dadosBeneficiario
|
10
|
+
|
11
|
+
# @type: CtContratadoDados
|
12
|
+
attr_accessor :dadosContratado
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
|
2
|
+
module Tiss::Model
|
3
|
+
class CtBeneficiarioDados < Base
|
4
|
+
|
5
|
+
# @type: StTexto20
|
6
|
+
attr_accessor :numeroCarteira
|
7
|
+
|
8
|
+
# @type: DmSimNao
|
9
|
+
attr_accessor :atendimentoRN
|
10
|
+
|
11
|
+
# @type: StTexto70
|
12
|
+
attr_accessor :nomeBeneficiario
|
13
|
+
|
14
|
+
# @type: StTexto15
|
15
|
+
attr_accessor :numeroCNS
|
16
|
+
|
17
|
+
# @type: Base64Binary
|
18
|
+
attr_accessor :identificadorBeneficiario
|
19
|
+
|
20
|
+
# @type: DmTipoIdent
|
21
|
+
attr_accessor :tipoIdent
|
22
|
+
|
23
|
+
# @type: Base64Binary
|
24
|
+
attr_accessor :templateBiometrico
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
attribute_config :tipoIdent, only: %w[3_04_00]
|
32
|
+
|
33
|
+
attribute_config :templateBiometrico, only: %w[3_04_00]
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
|
2
|
+
module Tiss::Model
|
3
|
+
class CtContaMedicaResumo < Base
|
4
|
+
|
5
|
+
# @type: StTexto12
|
6
|
+
attr_accessor :numeroLotePrestador
|
7
|
+
|
8
|
+
# @type: StTexto12
|
9
|
+
attr_accessor :numeroProtocolo
|
10
|
+
|
11
|
+
# @type: StData
|
12
|
+
attr_accessor :dataProtocolo
|
13
|
+
|
14
|
+
# @type: CtMotivoGlosa
|
15
|
+
attr_accessor :GlosaProtocolo
|
16
|
+
|
17
|
+
# @type: DmStatusProtocolo
|
18
|
+
attr_accessor :situacaoProtrocolo
|
19
|
+
|
20
|
+
# @type: RelacaoGuias
|
21
|
+
attr_accessor :relacaoGuias
|
22
|
+
|
23
|
+
# @type: StDecimal102
|
24
|
+
attr_accessor :valorInformadoProtocolo
|
25
|
+
|
26
|
+
# @type: StDecimal102
|
27
|
+
attr_accessor :valorProcessadoProtocolo
|
28
|
+
|
29
|
+
# @type: StDecimal102
|
30
|
+
attr_accessor :valorLiberadoProtocolo
|
31
|
+
|
32
|
+
# @type: StDecimal102
|
33
|
+
attr_accessor :valorGlosaProtocolo
|
34
|
+
|
35
|
+
# @type: DmStatusProtocolo
|
36
|
+
attr_accessor :situacaoProtocolo
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
attribute_config :situacaoProtrocolo, only: %w[3_02_00]
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
attribute_config :situacaoProtocolo, unless: %w[3_02_00]
|
50
|
+
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
|
2
|
+
module Tiss::Model
|
3
|
+
class CtContratadoDados < Base
|
4
|
+
|
5
|
+
# @type: StTexto14
|
6
|
+
attr_accessor :codigoPrestadorNaOperadora
|
7
|
+
|
8
|
+
# @type: StCpf
|
9
|
+
attr_accessor :cpfContratado
|
10
|
+
|
11
|
+
# @type: StCnpj
|
12
|
+
attr_accessor :cnpjContratado
|
13
|
+
|
14
|
+
# @type: StTexto70
|
15
|
+
attr_accessor :nomeContratado
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
|
2
|
+
module Tiss::Model
|
3
|
+
class CtContratadoProfissionalDados < Base
|
4
|
+
|
5
|
+
# @type: StTexto70
|
6
|
+
attr_accessor :nomeProfissional
|
7
|
+
|
8
|
+
# @type: DmConselhoProfissional
|
9
|
+
attr_accessor :conselhoProfissional
|
10
|
+
|
11
|
+
# @type: StTexto15
|
12
|
+
attr_accessor :numeroConselhoProfissional
|
13
|
+
|
14
|
+
# @type: DmUf
|
15
|
+
attr_accessor :UF
|
16
|
+
|
17
|
+
# @type: DmCbos
|
18
|
+
attr_accessor :CBOS
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|