nuva 0.1.7 → 0.2.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 +4 -4
- data/.devcontainer/devcontainer.json +25 -0
- data/Changelog.md +13 -0
- data/lib/nuva/Code_pb.rb +3 -3
- data/lib/nuva/Disease_pb.rb +6 -6
- data/lib/nuva/InjectionMethod_pb.rb +1 -1
- data/lib/nuva/NuvaDatabase_pb.rb +4 -4
- data/lib/nuva/Vaccine_pb.rb +9 -9
- data/lib/nuva/Valence_pb.rb +8 -8
- data/lib/nuva/VersionInfo_pb.rb +4 -4
- data/lib/nuva/repository.rb +3 -6
- data/lib/nuva/version.rb +1 -1
- data/nuva.gemspec +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 391786d07b2a721da8b3c80f24937cd69c62221c0e67f0eaa2803ecbb243fe54
|
4
|
+
data.tar.gz: 5e31145383cf0e4c70686d2f65121401f49465a4c72ca18f6cb2291085fdbd0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f387e49eb07942ba3192aa92a34632662bc9fcf6ffaae18c5ea85225ea8a7c897f345fb3112c5c0c4795f4a8be540a4d7e49a7490abffd4ba19ce6ed09f5e860
|
7
|
+
data.tar.gz: 26e0ba31d8834da784eae5da7915360caf1bc26f134c19875ddaef477fb7131b12e53b9547e8bb4daca21ca330d7ba315c833b1c26e08695ebe6ba76b24670c9
|
@@ -0,0 +1,25 @@
|
|
1
|
+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
2
|
+
// README at: https://github.com/devcontainers/templates/tree/main/src/ruby
|
3
|
+
{
|
4
|
+
"name": "nuva-ruby",
|
5
|
+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
6
|
+
"image": "mcr.microsoft.com/devcontainers/ruby:1-3.3-bullseye",
|
7
|
+
"features": {
|
8
|
+
"ghcr.io/devcontainers/features/common-utils:2": {}
|
9
|
+
}
|
10
|
+
|
11
|
+
// Features to add to the dev container. More info: https://containers.dev/features.
|
12
|
+
// "features": {},
|
13
|
+
|
14
|
+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
15
|
+
// "forwardPorts": [],
|
16
|
+
|
17
|
+
// Use 'postCreateCommand' to run commands after the container is created.
|
18
|
+
// "postCreateCommand": "ruby --version",
|
19
|
+
|
20
|
+
// Configure tool-specific properties.
|
21
|
+
// "customizations": {},
|
22
|
+
|
23
|
+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
24
|
+
// "remoteUser": "root"
|
25
|
+
}
|
data/Changelog.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
|
+
|
8
|
+
## [0.2.0] - 2025-01-17
|
9
|
+
|
10
|
+
### Added
|
11
|
+
|
12
|
+
- Support finding entities (vaccines, diseases, valences) by numeric code (not just uuid)
|
13
|
+
- Add changelog file
|
data/lib/nuva/Code_pb.rb
CHANGED
@@ -4,10 +4,10 @@
|
|
4
4
|
require 'google/protobuf'
|
5
5
|
|
6
6
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
|
-
add_file("Code.proto", :syntax => :
|
7
|
+
add_file("Code.proto", :syntax => :proto3) do
|
8
8
|
add_message "nuva.Code" do
|
9
|
-
|
10
|
-
|
9
|
+
optional :nomenclature, :string, 1
|
10
|
+
optional :value, :string, 2
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
data/lib/nuva/Disease_pb.rb
CHANGED
@@ -7,14 +7,14 @@ require 'google/protobuf/timestamp_pb'
|
|
7
7
|
require_relative 'Code_pb'
|
8
8
|
|
9
9
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
10
|
-
add_file("Disease.proto", :syntax => :
|
10
|
+
add_file("Disease.proto", :syntax => :proto3) do
|
11
11
|
add_message "nuva.Disease" do
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
optional :id, :string, 1
|
13
|
+
optional :name, :string, 2
|
14
|
+
optional :code, :uint32, 3
|
15
15
|
repeated :codes, :message, 4, "nuva.Code"
|
16
|
-
|
17
|
-
|
16
|
+
optional :vaccinable, :bool, 5
|
17
|
+
optional :screenable, :bool, 6
|
18
18
|
repeated :valence_ids, :string, 7
|
19
19
|
optional :created_at, :message, 16, "google.protobuf.Timestamp"
|
20
20
|
optional :updated_at, :message, 17, "google.protobuf.Timestamp"
|
@@ -4,7 +4,7 @@
|
|
4
4
|
require 'google/protobuf'
|
5
5
|
|
6
6
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
|
-
add_file("InjectionMethod.proto", :syntax => :
|
7
|
+
add_file("InjectionMethod.proto", :syntax => :proto3) do
|
8
8
|
add_enum "nuva.InjectionMethod" do
|
9
9
|
value :UnspecifiedInjectionMethod, 0
|
10
10
|
value :Intramuscular, 1
|
data/lib/nuva/NuvaDatabase_pb.rb
CHANGED
@@ -10,11 +10,11 @@ require_relative 'Disease_pb'
|
|
10
10
|
require_relative 'Valence_pb'
|
11
11
|
|
12
12
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
13
|
-
add_file("NuvaDatabase.proto", :syntax => :
|
13
|
+
add_file("NuvaDatabase.proto", :syntax => :proto3) do
|
14
14
|
add_message "nuva.NuvaDatabase" do
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
optional :version, :message, 1, "nuva.VersionInfo"
|
16
|
+
optional :generated_at, :message, 2, "google.protobuf.Timestamp"
|
17
|
+
optional :locale, :string, 3
|
18
18
|
repeated :vaccines, :message, 4, "nuva.Vaccine"
|
19
19
|
repeated :diseases, :message, 5, "nuva.Disease"
|
20
20
|
repeated :valences, :message, 6, "nuva.Valence"
|
data/lib/nuva/Vaccine_pb.rb
CHANGED
@@ -8,21 +8,21 @@ require_relative 'InjectionMethod_pb'
|
|
8
8
|
require_relative 'Code_pb'
|
9
9
|
|
10
10
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
11
|
-
add_file("Vaccine.proto", :syntax => :
|
11
|
+
add_file("Vaccine.proto", :syntax => :proto3) do
|
12
12
|
add_message "nuva.Vaccine" do
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
optional :id, :string, 1
|
14
|
+
optional :name, :string, 2
|
15
|
+
optional :short_description, :string, 3
|
16
|
+
optional :description, :string, 4
|
17
17
|
repeated :injection_methods, :enum, 5, "nuva.InjectionMethod"
|
18
|
-
|
18
|
+
optional :code, :uint32, 6
|
19
19
|
repeated :codes, :message, 7, "nuva.Code"
|
20
20
|
repeated :valence_ids, :string, 8
|
21
21
|
repeated :other_names, :string, 9
|
22
|
-
|
22
|
+
optional :generic, :bool, 10
|
23
23
|
optional :replaced_by_id, :string, 11
|
24
|
-
|
25
|
-
|
24
|
+
optional :created_at, :message, 16, "google.protobuf.Timestamp"
|
25
|
+
optional :updated_at, :message, 17, "google.protobuf.Timestamp"
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
data/lib/nuva/Valence_pb.rb
CHANGED
@@ -6,19 +6,19 @@ require 'google/protobuf'
|
|
6
6
|
require 'google/protobuf/timestamp_pb'
|
7
7
|
|
8
8
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
9
|
-
add_file("Valence.proto", :syntax => :
|
9
|
+
add_file("Valence.proto", :syntax => :proto3) do
|
10
10
|
add_message "nuva.Valence" do
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
optional :id, :string, 1
|
12
|
+
optional :parent_id, :string, 2
|
13
|
+
optional :code, :uint32, 3
|
14
|
+
optional :name, :string, 4
|
15
|
+
optional :abbreviation, :string, 5
|
16
16
|
optional :translated_abbreviation, :string, 6
|
17
17
|
repeated :disease_ids, :string, 7
|
18
18
|
repeated :vaccine_ids, :string, 8
|
19
19
|
optional :antigene_type, :string, 9
|
20
|
-
|
21
|
-
|
20
|
+
optional :created_at, :message, 16, "google.protobuf.Timestamp"
|
21
|
+
optional :updated_at, :message, 17, "google.protobuf.Timestamp"
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
data/lib/nuva/VersionInfo_pb.rb
CHANGED
@@ -4,11 +4,11 @@
|
|
4
4
|
require 'google/protobuf'
|
5
5
|
|
6
6
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
|
-
add_file("VersionInfo.proto", :syntax => :
|
7
|
+
add_file("VersionInfo.proto", :syntax => :proto3) do
|
8
8
|
add_message "nuva.VersionInfo" do
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
optional :major, :uint32, 1
|
10
|
+
optional :minor, :uint32, 2
|
11
|
+
optional :patch, :uint32, 3
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
data/lib/nuva/repository.rb
CHANGED
@@ -6,10 +6,11 @@ module Nuva
|
|
6
6
|
|
7
7
|
def initialize(data)
|
8
8
|
@data = index_array_by_id(data)
|
9
|
+
@data_by_code = data.each_with_object({}) { |item, acc| acc[item.code] = item }
|
9
10
|
end
|
10
11
|
|
11
|
-
def find(
|
12
|
-
@data[
|
12
|
+
def find(id_or_code)
|
13
|
+
@data_by_code[id_or_code] || @data[id_or_code]
|
13
14
|
end
|
14
15
|
|
15
16
|
def all
|
@@ -20,10 +21,6 @@ module Nuva
|
|
20
21
|
ids.map { |x| find x }.compact
|
21
22
|
end
|
22
23
|
|
23
|
-
# def by_ids(ids)
|
24
|
-
# @data.select { |k, _v| ids.include?(k) }.values
|
25
|
-
# end
|
26
|
-
|
27
24
|
private
|
28
25
|
|
29
26
|
def index_array_by_id(array)
|
data/lib/nuva/version.rb
CHANGED
data/nuva.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
30
30
|
spec.require_paths = ["lib"]
|
31
31
|
|
32
|
-
spec.add_dependency 'google-protobuf', '~> 3.25', '>= 3.25.
|
32
|
+
spec.add_dependency 'google-protobuf', '~> 3.25', '>= 3.25.5'
|
33
33
|
spec.add_dependency 'fuzzy_match', '~> 2.1'
|
34
34
|
|
35
35
|
# For more information and examples about making a new gem, check out our
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nuva
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Syadem
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-protobuf
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '3.25'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 3.25.
|
22
|
+
version: 3.25.5
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '3.25'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 3.25.
|
32
|
+
version: 3.25.5
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: fuzzy_match
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,8 +52,10 @@ executables: []
|
|
52
52
|
extensions: []
|
53
53
|
extra_rdoc_files: []
|
54
54
|
files:
|
55
|
+
- ".devcontainer/devcontainer.json"
|
55
56
|
- ".rspec"
|
56
57
|
- ".rubocop.yml"
|
58
|
+
- Changelog.md
|
57
59
|
- Rakefile
|
58
60
|
- gen_proto.sh
|
59
61
|
- lib/nuva.rb
|