Class: Openphar::Models::JP::KampoFormula
- Inherits:
-
FormulationMonograph
- Object
- Lutaml::Model::Serializable
- BaseEntity
- Monograph
- FormulationMonograph
- Openphar::Models::JP::KampoFormula
- Defined in:
- lib/openphar/models/jp/kampo_formula.rb
Overview
Represents a Kampo formula monograph from the Japan Pharmacopoeia.
Kampo is the Japanese study and adaptation of traditional Chinese medicine. Kampo formulas are standardized herbal preparations with specific ingredient ratios and preparation methods defined in the JP.
Class Method Summary collapse
-
.jsonld_type ⇒ String
JSON-LD @type value.
-
.neo4j_labels ⇒ Array<String>
Neo4j node labels for graph database export.
Instance Method Summary collapse
-
#ingredient_count ⇒ Integer
Returns the total number of crude drug ingredients.
-
#total_parts ⇒ Float
Returns the total ratio sum (total parts).
Methods inherited from Monograph
harmonized_type, #iri, jsonld_types, #label, wire_key
Methods inherited from BaseEntity
jsonld_context, neo4j_label, neo4j_labels_string, #to_cypher, #to_cypher_match, #to_jsonld, #to_neo4j_node, #to_neo4j_properties
Class Method Details
.jsonld_type ⇒ String
JSON-LD @type value
73 74 75 |
# File 'lib/openphar/models/jp/kampo_formula.rb', line 73 def jsonld_type 'KampoFormula' end |
.neo4j_labels ⇒ Array<String>
Neo4j node labels for graph database export
66 67 68 |
# File 'lib/openphar/models/jp/kampo_formula.rb', line 66 def neo4j_labels %w[Monograph Formulation KampoFormula] end |
Instance Method Details
#ingredient_count ⇒ Integer
Returns the total number of crude drug ingredients
81 82 83 |
# File 'lib/openphar/models/jp/kampo_formula.rb', line 81 def ingredient_count crude_drug_ingredients.size end |
#total_parts ⇒ Float
Returns the total ratio sum (total parts)
88 89 90 |
# File 'lib/openphar/models/jp/kampo_formula.rb', line 88 def total_parts crude_drug_ingredients.sum { |i| i[:ratio].to_f } end |