Module: Kimaya::KimayaCore

Included in:
TPNCalc
Defined in:
lib/kimaya/kimaya_core.rb

Constant Summary collapse

ERROR_CODES =
{
  percent_dextrose_conc: "1002", current_weight: "1003", total_fluid_intake: "1004", total_fluid_intake_vol: "1005",
  feed_vol: "1006", losses: "1007", tpn_vol: "1008", fat_intake: "1009", fat_vol: "1011", lipid_conc: "1010", 
  hav_vol: "1012", overfill_factor: "1013", prepared_overfill: "1014", amino_acid_intake: "1015", amino_acid_conc: "1016",
  amino_acid_vol: "1017", sodium_chloride_intake: "1018", sodium_chloride_conc: "1019", sodium_chloride_vol: "1020",
  potassium_chloride_intake: "1021", potassium_chloride_conc: "1022", potassium_chloride_vol: "1023", calcium_intake: "1024",
  calcium_conc: "1025", calcium_vol: "1026", magnesium_intake: "1027", magnesium_conc: "1028", magnesium_vol: "1029",
  mvi: "1032", remaining_dextrose_vol: "1033", achieved_dextrose_conc: "1034", fat_calories: "1035", cho_calories: "1036",
  cnr_rate: "1037", calories: "1039", dir_rate: "1040", dextrose_10: "1041", dextrose_50: "1042", heparin: "1044"
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#achieved_dextrose_concObject

Returns the value of attribute achieved_dextrose_conc.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def achieved_dextrose_conc
  @achieved_dextrose_conc
end

#administrationObject

Returns the value of attribute administration.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def administration
  @administration
end

#amino_acid_concObject

Returns the value of attribute amino_acid_conc.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def amino_acid_conc
  @amino_acid_conc
end

#amino_acid_intakeObject

Returns the value of attribute amino_acid_intake.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def amino_acid_intake
  @amino_acid_intake
end

#amino_acid_volObject

Returns the value of attribute amino_acid_vol.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def amino_acid_vol
  @amino_acid_vol
end

#available_dextrose_concentrationsObject

Returns the value of attribute available_dextrose_concentrations.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def available_dextrose_concentrations
  @available_dextrose_concentrations
end

#calcium_concObject

Returns the value of attribute calcium_conc.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def calcium_conc
  @calcium_conc
end

#calcium_intakeObject

Returns the value of attribute calcium_intake.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def calcium_intake
  @calcium_intake
end

#calcium_volObject

Returns the value of attribute calcium_vol.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def calcium_vol
  @calcium_vol
end

#caloriesObject

Returns the value of attribute calories.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def calories
  @calories
end

#cho_caloriesObject

Returns the value of attribute cho_calories.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def cho_calories
  @cho_calories
end

#cnr_rateObject

Returns the value of attribute cnr_rate.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def cnr_rate
  @cnr_rate
end

#current_weightObject

Returns the value of attribute current_weight.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def current_weight
  @current_weight
end

#day_of_tpnObject

Returns the value of attribute day_of_tpn.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def day_of_tpn
  @day_of_tpn
end

#dextrose_concentrationsObject

Returns the value of attribute dextrose_concentrations.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def dextrose_concentrations
  @dextrose_concentrations
end

#dir_rateObject

Returns the value of attribute dir_rate.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def dir_rate
  @dir_rate
end

#errorsObject

Returns the value of attribute errors.



15
16
17
# File 'lib/kimaya/kimaya_core.rb', line 15

def errors
  @errors
end

#exceptionsObject

Returns the value of attribute exceptions.



15
16
17
# File 'lib/kimaya/kimaya_core.rb', line 15

def exceptions
  @exceptions
end

#expected_dirObject

Returns the value of attribute expected_dir.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def expected_dir
  @expected_dir
end

#fat_caloriesObject

Returns the value of attribute fat_calories.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def fat_calories
  @fat_calories
end

#fat_intakeObject

Returns the value of attribute fat_intake.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def fat_intake
  @fat_intake
end

#fat_volObject

Returns the value of attribute fat_vol.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def fat_vol
  @fat_vol
end

#feed_volObject

Returns the value of attribute feed_vol.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def feed_vol
  @feed_vol
end

#hav_volObject

Returns the value of attribute hav_vol.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def hav_vol
  @hav_vol
end

#heparinObject

Returns the value of attribute heparin.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def heparin
  @heparin
end

#lipid_concObject

Returns the value of attribute lipid_conc.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def lipid_conc
  @lipid_conc
end

#lossesObject

Returns the value of attribute losses.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def losses
  @losses
end

#magnesium_concObject

Returns the value of attribute magnesium_conc.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def magnesium_conc
  @magnesium_conc
end

#magnesium_intakeObject

Returns the value of attribute magnesium_intake.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def magnesium_intake
  @magnesium_intake
end

#magnesium_volObject

Returns the value of attribute magnesium_vol.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def magnesium_vol
  @magnesium_vol
end

#mviObject

Returns the value of attribute mvi.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def mvi
  @mvi
end

#non_proteinObject

Returns the value of attribute non_protein.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def non_protein
  @non_protein
end

#other_infusionsObject

Returns the value of attribute other_infusions.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def other_infusions
  @other_infusions
end

#overfill_factorObject

Returns the value of attribute overfill_factor.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def overfill_factor
  @overfill_factor
end

#percent_dextrose_concObject

Returns the value of attribute percent_dextrose_conc.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def percent_dextrose_conc
  @percent_dextrose_conc
end

#potassium_chloride_concObject

Returns the value of attribute potassium_chloride_conc.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def potassium_chloride_conc
  @potassium_chloride_conc
end

#potassium_chloride_intakeObject

Returns the value of attribute potassium_chloride_intake.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def potassium_chloride_intake
  @potassium_chloride_intake
end

#potassium_chloride_volObject

Returns the value of attribute potassium_chloride_vol.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def potassium_chloride_vol
  @potassium_chloride_vol
end

#prepared_overfillObject

Returns the value of attribute prepared_overfill.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def prepared_overfill
  @prepared_overfill
end

#remaining_dextrose_volObject

Returns the value of attribute remaining_dextrose_vol.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def remaining_dextrose_vol
  @remaining_dextrose_vol
end

#sodium_chloride_concObject

Returns the value of attribute sodium_chloride_conc.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def sodium_chloride_conc
  @sodium_chloride_conc
end

#sodium_chloride_intakeObject

Returns the value of attribute sodium_chloride_intake.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def sodium_chloride_intake
  @sodium_chloride_intake
end

#sodium_chloride_volObject

Returns the value of attribute sodium_chloride_vol.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def sodium_chloride_vol
  @sodium_chloride_vol
end

#total_fluid_intakeObject

Returns the value of attribute total_fluid_intake.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def total_fluid_intake
  @total_fluid_intake
end

#total_fluid_intake_volObject

Returns the value of attribute total_fluid_intake_vol.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def total_fluid_intake_vol
  @total_fluid_intake_vol
end

#total_proteinObject

Returns the value of attribute total_protein.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def total_protein
  @total_protein
end

#tpn_volObject

Returns the value of attribute tpn_vol.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def tpn_vol
  @tpn_vol
end

#warningsObject

Returns the value of attribute warnings.



15
16
17
# File 'lib/kimaya/kimaya_core.rb', line 15

def warnings
  @warnings
end

#waterObject

Returns the value of attribute water.



3
4
5
# File 'lib/kimaya/kimaya_core.rb', line 3

def water
  @water
end

Instance Method Details

#round(value, scale) ⇒ Object



16
17
18
# File 'lib/kimaya/kimaya_core.rb', line 16

def round(value, scale)
  ("%.#{scale}f" % value).to_f
end