pueri 0.11.2 → 0.11.4
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/CHANGELOG.md +8 -1
- data/Gemfile.lock +1 -1
- data/lib/pueri/dosecalc.rb +31 -5
- data/lib/pueri/dosecheck.rb +20 -5
- data/lib/pueri/version.rb +1 -1
- data/package.json +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6ba46055aa80656a2d982c5a80dd70a38f51706bc7eb7d6cf53f327e4695522
|
4
|
+
data.tar.gz: 27d0d365013582129131ae72f3b40f77300c31ed897f89669618b5411e282e0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3485877c8725ba9632fc168f919a44794cce1859413f65ea2fdec8018d767f99e52a1d1236baf285aa9973f36cfedf76e95773de4f1bc621bf061f0a0266acfc
|
7
|
+
data.tar.gz: 584bf81e59ab7b87d7ba7496adfdf3e2b961a5129d0fc0d3ecfc1e6561ce0492f39d191b096c5ce2d5ff3399aa250eff341184aabf78b8c660ce836c1a897765
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [0.11.4] - `2019-10-28`
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
* Included prettified output for `DoseCalc`'s `to_s` method.
|
14
|
+
* Included prettified output for `DoseCheck`'s `to_s` method.
|
15
|
+
|
10
16
|
## [0.11.2] - `2019-10-28`
|
11
17
|
|
12
18
|
### Added
|
@@ -37,6 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
37
43
|
[PNI]: http://www.saude.gov.br/saude-de-a-z/vacinacao/calendario-vacinacao
|
38
44
|
[DNPM]: https://www.fcm.unicamp.br/fcm/neuropediatria-conteudo-didatico/desenvolvimento-neuropsicomotor
|
39
45
|
|
40
|
-
[Unreleased]: https://github.com/Nereare/pueri/compare/v0.11.
|
46
|
+
[Unreleased]: https://github.com/Nereare/pueri/compare/v0.11.4...HEAD
|
47
|
+
[0.11.4]: https://github.com/Nereare/pueri/compare/v0.11.2...v0.11.4
|
41
48
|
[0.11.2]: https://github.com/Nereare/pueri/compare/v0.7.0...v0.11.2
|
42
49
|
[0.7.0]: https://github.com/Nereare/pueri/releases/tag/v0.7.0
|
data/Gemfile.lock
CHANGED
data/lib/pueri/dosecalc.rb
CHANGED
@@ -28,11 +28,16 @@ module Pueri
|
|
28
28
|
# Outputs the calculated dosage into a prescription string.
|
29
29
|
#
|
30
30
|
# @return [String] The prescription string.
|
31
|
-
def to_s
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
31
|
+
def to_s(pretty = false)
|
32
|
+
if pretty
|
33
|
+
pretty_to_s
|
34
|
+
else
|
35
|
+
[
|
36
|
+
'',
|
37
|
+
"- #{@name} #{@concentration.to_i}#{@conc_unit.join '/'}",
|
38
|
+
"Tomar #{@result}#{@conc_unit[1]} #{time_to_s} #{days_to_s}."
|
39
|
+
].join "\n"
|
40
|
+
end
|
36
41
|
end
|
37
42
|
|
38
43
|
# Outputs the calculated dosage for each taking. _E.g._ +3.7+, as in _use
|
@@ -45,6 +50,27 @@ module Pueri
|
|
45
50
|
|
46
51
|
private
|
47
52
|
|
53
|
+
def pre_pretty_to_s
|
54
|
+
p = Pastel.new
|
55
|
+
qtt = p.cyan(@result, @conc_unit[1])
|
56
|
+
time = @time.to_i.to_s.rjust(2, '0')
|
57
|
+
time = p.cyan(time, '/', time, 'h')
|
58
|
+
days = p.cyan(@days.to_s.rjust(2, '0'), ' dias')
|
59
|
+
|
60
|
+
[qtt, time, days]
|
61
|
+
end
|
62
|
+
|
63
|
+
def pretty_to_s
|
64
|
+
p = Pastel.new
|
65
|
+
qtt, time, days = pre_pretty_to_s
|
66
|
+
[
|
67
|
+
'',
|
68
|
+
"#{p.cyan('1.')} #{@name} #{@concentration.to_i}"\
|
69
|
+
"#{@conc_unit.join('/')} ".ljust(90, '-'),
|
70
|
+
" Dar #{qtt} de #{time} por #{days}."
|
71
|
+
].join("\n")
|
72
|
+
end
|
73
|
+
|
48
74
|
def time_to_s
|
49
75
|
if @time == 24.0
|
50
76
|
'uma vez por dia'
|
data/lib/pueri/dosecheck.rb
CHANGED
@@ -28,11 +28,16 @@ module Pueri
|
|
28
28
|
# Outputs the calculated dosage as a string.
|
29
29
|
#
|
30
30
|
# @return [String] The dosage-per-weight-day string.
|
31
|
-
def to_s
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
31
|
+
def to_s(pretty = false)
|
32
|
+
if pretty
|
33
|
+
pretty_to_s
|
34
|
+
else
|
35
|
+
[
|
36
|
+
'',
|
37
|
+
"#{@name} #{@concentration.to_i}#{@conc_unit.join '/'} (#{usage})",
|
38
|
+
" - Dose de #{@result}#{@conc_unit[0]}/kg/d."
|
39
|
+
].join "\n"
|
40
|
+
end
|
36
41
|
end
|
37
42
|
|
38
43
|
# Outputs the calculated dosage-per-weight-day as a float.
|
@@ -44,6 +49,16 @@ module Pueri
|
|
44
49
|
|
45
50
|
private
|
46
51
|
|
52
|
+
def pretty_to_s
|
53
|
+
p = Pastel.new
|
54
|
+
[
|
55
|
+
'',
|
56
|
+
"#{p.cyan(@name, ' ', @concentration.to_i, @conc_unit.join('/'))} "\
|
57
|
+
"(#{usage}) ".ljust(90, '-'),
|
58
|
+
" - Dose de #{p.cyan(@result, @conc_unit[0], '/kg/d')}."
|
59
|
+
].join("\n")
|
60
|
+
end
|
61
|
+
|
47
62
|
def usage
|
48
63
|
time = @time.to_i
|
49
64
|
"#{@dose}#{@dose_unit} #{@way} #{time}/#{time}h por #{@days.to_i}d"
|
data/lib/pueri/version.rb
CHANGED
data/package.json
CHANGED