tiss_validator 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +53 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +53 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/exe/tiss_validate +19 -0
- data/lib/tiss/030301/tissAssinaturaDigital_v1.01.xsd +16 -0
- data/lib/tiss/030301/tissComplexTypesV3_03_01.xsd +1372 -0
- data/lib/tiss/030301/tissGuiasV3_03_01.xsd +1402 -0
- data/lib/tiss/030301/tissMonitoramentoQualidadeV3_03_01.xsd +152 -0
- data/lib/tiss/030301/tissMonitoramentoV3_03_01.xsd +511 -0
- data/lib/tiss/030301/tissSimpleTypesV3_03_01.xsd +4120 -0
- data/lib/tiss/030301/tissV3_03_01.xsd +118 -0
- data/lib/tiss/030301/tissWebServicesV3_03_01.xsd +330 -0
- data/lib/tiss/030301/xmldsig-core-schema.xsd +308 -0
- data/lib/tiss_validator.rb +16 -0
- data/lib/tiss_validator/version.rb +3 -0
- data/tiss_validator.gemspec +48 -0
- metadata +131 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
require "tiss_validator/version"
|
2
|
+
require 'nokogiri'
|
3
|
+
|
4
|
+
module TissValidator
|
5
|
+
TISS_SCHEMA_PATH =
|
6
|
+
File.expand_path "../tiss/030301/tissV3_03_01.xsd", __FILE__
|
7
|
+
|
8
|
+
def self.errors(file_name)
|
9
|
+
xsd = Nokogiri::XML::Schema(File.open(TISS_SCHEMA_PATH))
|
10
|
+
doc = Nokogiri::XML(File.read(file_name))
|
11
|
+
xsd.validate(doc).map do |error|
|
12
|
+
message = error.message.gsub /\{.*?\}/, ""
|
13
|
+
"Linha: #{error.line} - #{message}"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'tiss_validator/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "tiss_validator"
|
8
|
+
spec.version = TissValidator::VERSION
|
9
|
+
spec.authors = ["Abinoam P. Marques Jr."]
|
10
|
+
spec.email = ["abinoam@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{TISS Validator: validates xml file against ANS TISS xsd}
|
13
|
+
spec.description = <<~END
|
14
|
+
TISS Validator takes a TISS xml file and validates it against
|
15
|
+
the ANS schemas (xsd files). It's a really simple wrapper around Nokogiri.
|
16
|
+
|
17
|
+
TISS: Troca de Informação em Saúde Suplementar. A brazilian standard for
|
18
|
+
information exchange between private healthcare providers.
|
19
|
+
|
20
|
+
ANS: Agência Nacional de Saúde. National Health Agency from Brazil.
|
21
|
+
END
|
22
|
+
|
23
|
+
spec.homepage = "https://github.com/abinoam/tiss_validator"
|
24
|
+
spec.license = "MIT"
|
25
|
+
|
26
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
27
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
28
|
+
if spec.respond_to?(:metadata)
|
29
|
+
spec.metadata['allowed_push_host'] = "https://rubygems.org"
|
30
|
+
else
|
31
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
32
|
+
"public gem pushes."
|
33
|
+
end
|
34
|
+
|
35
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
36
|
+
f.match(%r{^(test|spec|features)/})
|
37
|
+
end
|
38
|
+
spec.bindir = "exe"
|
39
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
40
|
+
spec.require_paths = ["lib"]
|
41
|
+
|
42
|
+
spec.add_development_dependency "bundler", "~> 1.14"
|
43
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
44
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
45
|
+
|
46
|
+
spec.required_ruby_version = ">= 2.3"
|
47
|
+
spec.add_dependency "nokogiri"
|
48
|
+
end
|
metadata
ADDED
@@ -0,0 +1,131 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tiss_validator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Abinoam P. Marques Jr.
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-03-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.14'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.14'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: nokogiri
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: |
|
70
|
+
TISS Validator takes a TISS xml file and validates it against
|
71
|
+
the ANS schemas (xsd files). It's a really simple wrapper around Nokogiri.
|
72
|
+
|
73
|
+
TISS: Troca de Informação em Saúde Suplementar. A brazilian standard for
|
74
|
+
information exchange between private healthcare providers.
|
75
|
+
|
76
|
+
ANS: Agência Nacional de Saúde. National Health Agency from Brazil.
|
77
|
+
email:
|
78
|
+
- abinoam@gmail.com
|
79
|
+
executables:
|
80
|
+
- tiss_validate
|
81
|
+
extensions: []
|
82
|
+
extra_rdoc_files: []
|
83
|
+
files:
|
84
|
+
- ".gitignore"
|
85
|
+
- ".rspec"
|
86
|
+
- ".travis.yml"
|
87
|
+
- Gemfile
|
88
|
+
- LICENSE.txt
|
89
|
+
- README.md
|
90
|
+
- Rakefile
|
91
|
+
- bin/console
|
92
|
+
- bin/setup
|
93
|
+
- exe/tiss_validate
|
94
|
+
- lib/tiss/030301/tissAssinaturaDigital_v1.01.xsd
|
95
|
+
- lib/tiss/030301/tissComplexTypesV3_03_01.xsd
|
96
|
+
- lib/tiss/030301/tissGuiasV3_03_01.xsd
|
97
|
+
- lib/tiss/030301/tissMonitoramentoQualidadeV3_03_01.xsd
|
98
|
+
- lib/tiss/030301/tissMonitoramentoV3_03_01.xsd
|
99
|
+
- lib/tiss/030301/tissSimpleTypesV3_03_01.xsd
|
100
|
+
- lib/tiss/030301/tissV3_03_01.xsd
|
101
|
+
- lib/tiss/030301/tissWebServicesV3_03_01.xsd
|
102
|
+
- lib/tiss/030301/xmldsig-core-schema.xsd
|
103
|
+
- lib/tiss_validator.rb
|
104
|
+
- lib/tiss_validator/version.rb
|
105
|
+
- tiss_validator.gemspec
|
106
|
+
homepage: https://github.com/abinoam/tiss_validator
|
107
|
+
licenses:
|
108
|
+
- MIT
|
109
|
+
metadata:
|
110
|
+
allowed_push_host: https://rubygems.org
|
111
|
+
post_install_message:
|
112
|
+
rdoc_options: []
|
113
|
+
require_paths:
|
114
|
+
- lib
|
115
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '2.3'
|
120
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
requirements: []
|
126
|
+
rubyforge_project:
|
127
|
+
rubygems_version: 2.6.9
|
128
|
+
signing_key:
|
129
|
+
specification_version: 4
|
130
|
+
summary: 'TISS Validator: validates xml file against ANS TISS xsd'
|
131
|
+
test_files: []
|