mediserv 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 942be1a11e51b88dbfdeffcba799922cb926315c8d363e3ddaac8ed5673443e7
4
- data.tar.gz: 435e359999cd89ec6b518493a9c572e32af78513a9267e43be7bd5c3284fa020
3
+ metadata.gz: 529faf107e29e2686474b898eb718653813eeb245cff890bc75ffec0811ffe6c
4
+ data.tar.gz: 979232e22b4ef66970278019f2d0e0153c4d20d8cf97b8ac07f8696c01ea052d
5
5
  SHA512:
6
- metadata.gz: 94e45a8845fa78390a790ab641bad7a616537e89f566660bf4837ccdd3595b5000543d068643e189f77012b9c208ce3c575b53fd9c661f80251eb505cd205dd4
7
- data.tar.gz: 0cd2c989e4fc5b8036c49d13a33a2a6cc5acb345b058217ab216d0a80f71ea45544a458b8940b9b8b45e273e67f6a86ad4aa12b133e9b16d327a719be04bf6b2
6
+ metadata.gz: 50725b2b996a7664feabbe3b19c329a954fec115818a26f67078802ac0df1ccada048afdf66a0406ca305305d58311ef675cbd9665b19bcf22b96fcc904c68bf
7
+ data.tar.gz: a8aae0eb8a48ba98a2a192ebe9d430efa8b4ae58af34e41413f84bbb800a67b73f57c47215f77b4d3e37bb75ccf1900311ff5a50859c3769f3047200b70ce5d4
@@ -10,7 +10,7 @@ module MediServ::API
10
10
  @encoder = MediServ::API::Encoder.new
11
11
  @default_header = {
12
12
  programm: 'MediServ gem',
13
- programm_version: '0.0.1', # TODO: Load from gemspec
13
+ programm_version: '0.2.0', # TODO: Load from gemspec
14
14
  version: 'v2',
15
15
  kundennummer: clientId,
16
16
  stapelnummer: 0,
@@ -28,4 +28,4 @@ module MediServ::API
28
28
  @storage.put(id, @encoder.encode(b.to_h))
29
29
  end
30
30
  end
31
- end
31
+ end
@@ -90,11 +90,8 @@ module MediServ::API
90
90
  attribute :rabatt, Types::Strict::Bool.default(false)
91
91
  # Betrag
92
92
  attribute :betrag, Types::Strict::Float
93
-
94
- # Bruttobetrag (Anzahl * Betrag)
95
- def total
96
- anzahl * betrag
97
- end
93
+ # Total
94
+ attribute :total, Types::Strict::Float
98
95
  end
99
96
 
100
97
  class Invoice < Struct
@@ -148,6 +145,18 @@ module MediServ::API
148
145
  attribute :total_rabatt, Types::Strict::Float
149
146
  # Total aller Vorauszahlungen dieser Rechnung
150
147
  attribute :total_vz, Types::Strict::Float
148
+ # Total von allen Leistungen
149
+ attribute :total_leis, Types::Strict::Float
150
+ # Total von allen Medikamenten
151
+ attribute :total_med, Types::Strict::Float
152
+ # Total von allen Labors
153
+ attribute :total_labor, Types::Strict::Float
154
+ # Total diverse Positionen
155
+ attribute :total_diverse, Types::Strict::Float
156
+ # Total minus Vorauszahlungen dieser Rechnung
157
+ attribute :total_netto, Types::Strict::Float
158
+ # # Rechnungsbetrag (ohne Vorauszahlungen)
159
+ attribute :rechnungsbetrag, Types::Strict::Float
151
160
 
152
161
  attribute :empfanger, Recipient.optional.default(nil)
153
162
  attribute :patient, Patient
@@ -157,36 +166,6 @@ module MediServ::API
157
166
  leistungen.select{|l| l.punkte != nil }.map(&:punkte).reduce(0.0, :+)
158
167
  end
159
168
 
160
- # Total von allen Leistungen
161
- def total_leis
162
- leistungen.select{|l| l.art == 0 }.map(&:total).reduce(0.0, :+)
163
- end
164
-
165
- # Rechnungsbetrag (ohne Vorauszahlungen)
166
- def total_med
167
- leistungen.select{|l| l.art == 1 }.map(&:total).reduce(0.0, :+)
168
- end
169
-
170
- # Rechnungsbetrag (ohne Vorauszahlungen)
171
- def total_labor
172
- leistungen.select{|l| l.art == 2 }.map(&:total).reduce(0.0, :+)
173
- end
174
-
175
- # Rechnungsbetrag (ohne Vorauszahlungen)
176
- def total_diverse
177
- leistungen.select{|l| l.art == 3 }.map(&:total).reduce(0.0, :+)
178
- end
179
-
180
- # Total minus Vorauszahlungen dieser Rechnung
181
- def total_netto
182
- total_leis + total_med + total_labor + total_diverse + total_rabatt
183
- end
184
-
185
- # Rechnungsbetrag (ohne Vorauszahlungen)
186
- def rechnungsbetrag
187
- total_netto + total_vz
188
- end
189
-
190
169
  def to_h
191
170
  h = {
192
171
  RechNr: nummer,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mediserv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denteo AG
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-19 00:00:00.000000000 Z
11
+ date: 2021-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-types
@@ -71,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
71
  - !ruby/object:Gem::Version
72
72
  version: '0'
73
73
  requirements: []
74
- rubygems_version: 3.1.2
74
+ rubygems_version: 3.2.7
75
75
  signing_key:
76
76
  specification_version: 4
77
77
  summary: Ruby client interacting with MediServ