gerint 0.1.3 → 0.1.6
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 +4 -4
- data/README.md +1 -0
- data/lib/gerint/comunicacao/comunicacao.rb +28 -7
- data/lib/gerint/servicos/bloqueio_leito.rb +33 -0
- data/lib/gerint/servicos/desbloqueio_leito.rb +32 -0
- data/lib/gerint/servicos/reversao_alta.rb +35 -0
- data/lib/gerint/servicos/reversao_internacao.rb +30 -0
- data/lib/gerint/version.rb +1 -1
- data/lib/gerint.rb +4 -0
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8e164688994fb4c2e327b7273fd0aa92a745c66d8544a17e7d627727cf84e24
|
4
|
+
data.tar.gz: '095013c7c0e72b72ad9a11f95808432bd76e8e931def66d5687a4d54f1aefd1c'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3981dbb9a713124471acfedd016d55fc2d6ac56758e40042a6f9b03331b18b89d57d147ac4afb06b1a48ae140f5bbb0dcfd475634ec5490b305a22416fa44e04
|
7
|
+
data.tar.gz: 5ed84cfcd026534ac2afec8a8d728563f2b1c545717f33513574ecdb9b2931ce3d076d059f0a6a111182f86b783ef1bb8130b1140e83ba0d75e65b55166c6972
|
data/README.md
CHANGED
@@ -13,12 +13,6 @@ module Gerint
|
|
13
13
|
@senha = senha
|
14
14
|
|
15
15
|
@cnes = cnes
|
16
|
-
if ambiente == 'H' && apikey == '' # Se não informar a apikey, pega os dados de teste do HEPA
|
17
|
-
@apikey = "0ecc120b-c3bf-4e71-a5f9-cbaf0e394e34"
|
18
|
-
@usuario = "integracao.2237180"
|
19
|
-
@senha = "integracao.2237180"
|
20
|
-
@cnes = "2237180"
|
21
|
-
end
|
22
16
|
end
|
23
17
|
|
24
18
|
def credenciais # Consulta as credenciais instanciadas
|
@@ -34,8 +28,12 @@ module Gerint
|
|
34
28
|
"https://api.procempa.com.br/apiman-gateway/saude/api/1.0/gerint"
|
35
29
|
elsif @ambiente == 'H'
|
36
30
|
"https://api-hom.procempa.com.br/apiman-gateway/saude/api/1.1/gerint"
|
31
|
+
elsif @ambiente == 'P2'
|
32
|
+
"https://apigateway.procempa.com.br/apiman-gateway/saude/saude-api/1.0/gerint"
|
33
|
+
elsif @ambiente == 'H2'
|
34
|
+
"https://apigateway-hom.procempa.com.br/apiman-gateway/saude/saude-api/1.0/gerint"
|
37
35
|
else
|
38
|
-
"ERRO: Ambiente inválido, informa P
|
36
|
+
"ERRO: Ambiente inválido, informa P, H, P2 ou H2"
|
39
37
|
end
|
40
38
|
end
|
41
39
|
|
@@ -111,6 +109,12 @@ module Gerint
|
|
111
109
|
body = internacao.to_json
|
112
110
|
retorno = self.executa_post(ender, body)
|
113
111
|
end
|
112
|
+
|
113
|
+
def reversao_internacao(reversao_internacao)
|
114
|
+
ender = "/internacoes/reverterInternacao" # Usado para reversao de internações
|
115
|
+
body = reversao_internacao.to_json
|
116
|
+
retorno = self.executa_post(ender, body)
|
117
|
+
end
|
114
118
|
|
115
119
|
def alta(alta)
|
116
120
|
ender = "/internacoes/liberar" # No GERINT o serviço é chamado de Liberação de Internação
|
@@ -118,12 +122,29 @@ module Gerint
|
|
118
122
|
retorno = self.executa_post(ender, body)
|
119
123
|
end
|
120
124
|
|
125
|
+
def reversao_alta(reversao_alta)
|
126
|
+
ender = "/internacoes/reverterAlta" # Usado para reversao de internações
|
127
|
+
body = reversao_alta.to_json
|
128
|
+
retorno = self.executa_post(ender, body)
|
129
|
+
end
|
130
|
+
|
121
131
|
def transferir_leito(transf)
|
122
132
|
ender = "/internacoes/transferir"
|
123
133
|
body = transf.to_json
|
124
134
|
retorno = self.executa_post(ender, body)
|
125
135
|
end
|
126
136
|
|
137
|
+
def bloquear_leito(bloqueio_leito) # Usado para bloqueio de leito
|
138
|
+
ender = "/leitos/bloquearLeito"
|
139
|
+
body = bloqueio_leito.to_json
|
140
|
+
retorno = self.executa_post(ender, body)
|
141
|
+
end
|
142
|
+
|
143
|
+
def desbloquear_leito(desbloqueio_leito) # Usado para desbloqueio de leito
|
144
|
+
ender = "/leitos/desbloquearLeito"
|
145
|
+
body = desbloqueio_leito.to_json
|
146
|
+
retorno = self.executa_post(ender, body)
|
147
|
+
end
|
127
148
|
end
|
128
149
|
|
129
150
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
|
2
|
+
module Gerint
|
3
|
+
|
4
|
+
class BloqueioLeito < Gerint::Padrao
|
5
|
+
attr_accessor :identLeito, :codTipoLeito, :identMotivoBloqueio
|
6
|
+
|
7
|
+
def as_json(options={})
|
8
|
+
h = {
|
9
|
+
identLeito: @identLeito,
|
10
|
+
codTipoLeito: @codTipoLeito,
|
11
|
+
identMotivoBloqueio: @identMotivoBloqueio
|
12
|
+
}
|
13
|
+
h
|
14
|
+
end
|
15
|
+
|
16
|
+
def all_json # Gera hash com todas as variaveis de instancia
|
17
|
+
vinstancia = self.instance_variables
|
18
|
+
h = {}
|
19
|
+
vinstancia.each do |v|
|
20
|
+
h.store(v[1..50], "#{v}") # BUG: v contem o nome da variavel e não o valor int
|
21
|
+
end
|
22
|
+
h
|
23
|
+
h.to_json
|
24
|
+
end
|
25
|
+
|
26
|
+
def to_json(*options)
|
27
|
+
as_json(*options).to_json(*options)
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
@@ -0,0 +1,32 @@
|
|
1
|
+
|
2
|
+
module Gerint
|
3
|
+
|
4
|
+
class DesbloqueioLeito < Gerint::Padrao
|
5
|
+
attr_accessor :identLeito, :codTipoLeito
|
6
|
+
|
7
|
+
def as_json(options={})
|
8
|
+
h = {
|
9
|
+
identLeito: @identLeito,
|
10
|
+
codTipoLeito: @codTipoLeito
|
11
|
+
}
|
12
|
+
h
|
13
|
+
end
|
14
|
+
|
15
|
+
def all_json # Gera hash com todas as variaveis de instancia
|
16
|
+
vinstancia = self.instance_variables
|
17
|
+
h = {}
|
18
|
+
vinstancia.each do |v|
|
19
|
+
h.store(v[1..50], "#{v}") # BUG: v contem o nome da variavel e não o valor int
|
20
|
+
end
|
21
|
+
h
|
22
|
+
h.to_json
|
23
|
+
end
|
24
|
+
|
25
|
+
def to_json(*options)
|
26
|
+
as_json(*options).to_json(*options)
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
|
2
|
+
module Gerint
|
3
|
+
|
4
|
+
class ReversaoAlta < Gerint::Padrao
|
5
|
+
attr_accessor :protocoloSolicitacao, :identificacaoLeito, :codTipoLeito, :leitoExtra
|
6
|
+
|
7
|
+
def as_json(options={})
|
8
|
+
h = {
|
9
|
+
protocoloSolicitacao: @protocoloSolicitacao,
|
10
|
+
identificacaoLeito: @identificacaoLeito,
|
11
|
+
codTipoLeito: @codTipoLeito,
|
12
|
+
}
|
13
|
+
|
14
|
+
h.store(:leitoExtra, @leitoExtra) unless @leitoExtra.nil?
|
15
|
+
h
|
16
|
+
end
|
17
|
+
|
18
|
+
def all_json # Gera hash com todas as variaveis de instancia
|
19
|
+
vinstancia = self.instance_variables
|
20
|
+
h = {}
|
21
|
+
vinstancia.each do |v|
|
22
|
+
h.store(v[1..50], "#{v}") # BUG: v contem o nome da variavel e não o valor int
|
23
|
+
end
|
24
|
+
h
|
25
|
+
h.to_json
|
26
|
+
end
|
27
|
+
|
28
|
+
def to_json(*options)
|
29
|
+
as_json(*options).to_json(*options)
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
|
2
|
+
module Gerint
|
3
|
+
|
4
|
+
class ReversaoInternacao < Gerint::Padrao
|
5
|
+
attr_accessor :protocoloSolicitacao
|
6
|
+
|
7
|
+
def as_json(options={})
|
8
|
+
h = {
|
9
|
+
protocoloSolicitacao: @protocoloSolicitacao
|
10
|
+
}
|
11
|
+
end
|
12
|
+
|
13
|
+
def all_json # Gera hash com todas as variaveis de instancia
|
14
|
+
vinstancia = self.instance_variables
|
15
|
+
h = {}
|
16
|
+
vinstancia.each do |v|
|
17
|
+
h.store(v[1..50], "#{v}") # BUG: v contem o nome da variavel e não o valor int
|
18
|
+
end
|
19
|
+
h
|
20
|
+
h.to_json
|
21
|
+
end
|
22
|
+
|
23
|
+
def to_json(*options)
|
24
|
+
as_json(*options).to_json(*options)
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
data/lib/gerint/version.rb
CHANGED
data/lib/gerint.rb
CHANGED
@@ -9,6 +9,10 @@ require "gerint/servicos/transferir_leito"
|
|
9
9
|
require "gerint/servicos/alta"
|
10
10
|
require "gerint/servicos/solicitacao_internacao"
|
11
11
|
require "gerint/servicos/solicitacao_internacao_psiquiatria"
|
12
|
+
require "gerint/servicos/reversao_internacao"
|
13
|
+
require "gerint/servicos/reversao_alta"
|
14
|
+
require "gerint/servicos/desbloqueio_leito"
|
15
|
+
require "gerint/servicos/bloqueio_leito"
|
12
16
|
|
13
17
|
module Gerint
|
14
18
|
class Error < StandardError; end # Deixado aqui como exemplo, pra criar uma classe de erros
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gerint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nelson Coelho
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -73,8 +73,12 @@ files:
|
|
73
73
|
- lib/gerint.rb
|
74
74
|
- lib/gerint/comunicacao/comunicacao.rb
|
75
75
|
- lib/gerint/servicos/alta.rb
|
76
|
+
- lib/gerint/servicos/bloqueio_leito.rb
|
77
|
+
- lib/gerint/servicos/desbloqueio_leito.rb
|
76
78
|
- lib/gerint/servicos/internacao.rb
|
77
79
|
- lib/gerint/servicos/padrao.rb
|
80
|
+
- lib/gerint/servicos/reversao_alta.rb
|
81
|
+
- lib/gerint/servicos/reversao_internacao.rb
|
78
82
|
- lib/gerint/servicos/solicitacao_internacao.rb
|
79
83
|
- lib/gerint/servicos/solicitacao_internacao_psiquiatria.rb
|
80
84
|
- lib/gerint/servicos/transferir_leito.rb
|
@@ -98,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
102
|
- !ruby/object:Gem::Version
|
99
103
|
version: '0'
|
100
104
|
requirements: []
|
101
|
-
rubygems_version: 3.
|
105
|
+
rubygems_version: 3.2.32
|
102
106
|
signing_key:
|
103
107
|
specification_version: 4
|
104
108
|
summary: Integração com GERINT.
|