<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Annotation\SerializedName;
use App\Helper\Enums\BaseEnum;
use App\Helper\ConvertUnitMeasures;
/**
* CardiometabolicProfiles
*
* @ORM\Table(name="cardiometabolic_profiles")
* @ORM\Entity(repositoryClass="App\Repository\CardiometabolicProfilesRepository")
*/
class CardiometabolicProfiles
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @Groups({"profile", "data_export"})
*/
private $id;
/**
* @var int
*
* @ORM\Column(name="user_id", type="integer")
* @ORM\ManyToOne(targetEntity=Users::class)
* @ORM\JoinColumn(onDelete="CASCADE")
*/
private $userId;
/**
* @var int
*
* @ORM\Column(name="country_id", type="integer")
* @Groups({"profile", "data_export"})
*/
private $countryId;
/**
* @var int
*
* @ORM\Column(name="gender", type="smallint")
* @Groups({"profile", "data_export"})
*/
private $gender;
/**
* @var int
*
* @ORM\Column(name="age", type="smallint")
* @Groups({"profile", "data_export"})
*/
private $age;
/**
* @var float
*
* @ORM\Column(name="weight", type="float")
* @Groups({"profile", "data_export"})
*/
private $weight;
/**
* @var float
*
* @ORM\Column(name="height", type="float")
* @Groups({"profile", "data_export"})
*/
private $height;
/**
* @var int
*
* @ORM\Column(name="physical_activity_level", type="smallint")
* @Groups({"profile", "data_export"})
*/
private $physicalActivityLevel;
/**
* @var bool
*
* @ORM\Column(name="smoker", type="boolean")
* @Groups({"profile", "data_export"})
*/
private $smoker;
/**
* @var bool
*
* @ORM\Column(name="systolic_blood_pressure", type="smallint")
* @Groups({"profile", "data_export"})
*/
private $systolicBloodPressure;
/**
* @var bool
*
* @ORM\Column(name="hypertension_treatment", type="boolean")
* @Groups({"profile", "data_export"})
*/
private $hypertensionTreatment;
/**
* @var int
*
* total cholesterol value in mg/dL
*
* @ORM\Column(name="total_cholesterol", type="float")
* @Groups({"profile", "data_export"})
*/
private $totalCholesterol;
/**
* @var int
*
* hdl cholesterol value in mg/dL
*
* @ORM\Column(name="hdl_cholesterol", type="float")
* @Groups({"profile", "data_export"})
*/
private $hdlCholesterol;
/**
* @var int
*
* non hdl cholesterol value in mg/dL
*
* @ORM\Column(name="non_hdl_cholesterol", type="float")
* @Groups({"profile", "data_export"})
*/
private $nonHdlCholesterol;
/**
* @var bool
*
* @ORM\Column(name="myocardial_infarction", type="boolean")
* @Groups({"profile", "data_export"})
*/
private $myocardialInfarction;
/**
* @var bool
*
* @ORM\Column(name="angina_pectoris", type="boolean")
* @Groups({"profile", "data_export"})
*/
private $anginaPectoris;
/**
* @var bool
*
* @ORM\Column(name="coronary_artery_bypass", type="boolean")
* @Groups({"profile", "data_export"})
*/
private $coronaryArteryBypass;
/**
* @var bool
*
* @ORM\Column(name="arthritis", type="boolean")
* @Groups({"profile", "data_export"})
*/
private $arthritis;
/**
* @var bool
*
* @ORM\Column(name="stroke", type="boolean")
* @Groups({"profile", "data_export"})
*/
private $stroke;
/**
* @var bool
*
* @ORM\Column(name="angioplasty", type="boolean")
* @Groups({"profile", "data_export"})
*/
private $angioplasty;
/**
* @var bool
*
* @ORM\Column(name="diabetes", type="boolean")
* @Groups({"profile", "data_export"})
*/
private $diabetes;
/**
* @var float
*
* @ORM\Column(name="water", type="float")
* @Groups({"profile", "data_export"})
*/
private $water;
/**
* @var float
*
* @ORM\Column(name="imc", type="float")
* @Groups({"profile", "data_export"})
*/
private $imc;
/**
* @var float
*
* @ORM\Column(name="calories", type="float")
* @Groups({"profile", "data_export"})
*/
private $calories;
/**
* @var int
*
* hba1c value in %
*
* @ORM\Column(name="hba1c", type="decimal", precision=20, scale=2)
* @Groups({"profile", "data_export"})
*/
private $hba1c;
/**
* @var unitMeasureHba1cType
* @SerializedName("unit_measure_hba1c")
*
* unit measure the hba1c value will be displayed in (doesn't affect the value of hba1c in the database)
*
* @ORM\Column(name="unit_measure_hba1c", type="unit_measure_hba1c_enum_type", options={"default" : UnitMeasureHba1cType::PERCENT})
* @Groups({"profile", "data_export"})
*/
private $unitMeasureHba1c;
/**
* @var float
*
* fasting blood sugar value in mg/dL
*
* @ORM\Column(name="fasting_blood_sugar", type="decimal", precision=20, scale=2)
* @Groups({"profile", "data_export"})
*/
private $fasting_blood_sugar;
/**
* @var float
*
* @ORM\Column(name="creatinine", type="float", nullable="true")
* @Groups({"profile", "data_export"})
*/
private $creatinine;
/**
* @var float
*
* @ORM\Column(name="urea", type="float", nullable="true")
* @Groups({"profile", "data_export"})
*/
private $urea;
/**
* @var float
* @SerializedName("egfr")
*
* @ORM\Column(name="egfr", type="float", nullable="true")
* @Groups({"profile", "data_export"})
*/
private $eGFR;
/**
* @var UnitMeasureConcentrationType
* @SerializedName("unit_measure_concentration")
*
* unit measure the fasting blood sugar and cholesterol values will be displayed in
* (doesn't affect the values of fasting blood sugar and cholesterol in the database)
*
* @ORM\Column(name="unit_measure_concentration", type="unit_measure_concentration_enum_type", options={"default" : UnitMeasureConcentrationType::MG_PER_DL})
* @Groups({"profile", "data_export"})
*/
private $unitMeasureConcentration;
/**
* @var int
*
* @ORM\Column(name="cvd_score_id", type="integer")
* @Groups({"profile", "data_export"})
*/
private $cvdScoreId;
/**
* @var bool
*
* @ORM\Column(name="master_profile", type="boolean")
* @Groups({"profile"})
*/
private $masterProfile;
/**
* @var \DateTime
*
* @ORM\Column(name="created_at", type="datetime")
* @Groups({"profile", "data_export"})
*/
private $createdAt;
/**
* @ORM\Column(type="integer")
* @Groups({"profile", "data_export"})
*/
private $favourite_menus;
/**
* @ORM\Column(type="integer")
* @Groups({"profile", "data_export"})
*/
private $diabetes_status;
/**
* @var int
* @SerializedName("diabetes_diagnosis_year")
*
* @ORM\Column(name="diabetes_diagnosis_year", type="integer", options={"default" : 0})
* @Groups({"profile", "data_export"})
*/
private $diabetesDiagnosisYear;
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set userId
*
* @param integer $userId
*
* @return CardiometabolicProfiles
*/
public function setUserId($userId)
{
$this->userId = $userId;
return $this;
}
/**
* Get userId
*
* @return int
*/
public function getUserId()
{
return $this->userId;
}
/**
* Set countryId
*
* @param integer $countryId
*
* @return CardiometabolicProfiles
*/
public function setCountryId($countryId)
{
$this->countryId = $countryId;
return $this;
}
/**
* Get countryId
*
* @return int
*/
public function getCountryId()
{
return $this->countryId;
}
/**
* Set gender
*
* @param integer $gender
*
* @return CardiometabolicProfiles
*/
public function setGender($gender)
{
$this->gender = $gender;
return $this;
}
/**
* Get gender
*
* @return int
*/
public function getGender()
{
return $this->gender;
}
/**
* Set age
*
* @param integer $age
*
* @return CardiometabolicProfiles
*/
public function setAge($age)
{
$this->age = $age;
return $this;
}
/**
* Get age
*
* @return int
*/
public function getAge()
{
return $this->age;
}
/**
* Set weight
*
* @param float $weight
*
* @return CardiometabolicProfiles
*/
public function setWeight($weight)
{
$this->weight = $weight;
return $this;
}
/**
* Get weight
*
* @return float
*/
public function getWeight()
{
return $this->weight;
}
/**
* Set height
*
* @param float $height
*
* @return CardiometabolicProfiles
*/
public function setHeight($height)
{
$this->height = $height;
return $this;
}
/**
* Get height
*
* @return float
*/
public function getHeight()
{
return $this->height;
}
/**
* Set physicalActivityLevel
*
* @param integer $physicalActivityLevel
*
* @return CardiometabolicProfiles
*/
public function setPhysicalActivityLevel($physicalActivityLevel)
{
$this->physicalActivityLevel = $physicalActivityLevel;
return $this;
}
/**
* Get physicalActivityLevel
*
* @return int
*/
public function getPhysicalActivityLevel()
{
return $this->physicalActivityLevel;
}
/**
* Set smoker
*
* @param boolean $smoker
*
* @return CardiometabolicProfiles
*/
public function setSmoker($smoker)
{
$this->smoker = $smoker;
return $this;
}
/**
* Get smoker
*
* @return bool
*/
public function getSmoker()
{
return $this->smoker;
}
/**
* Set systolicBloodPressure
*
* @param integer $systolicBloodPressure
*
* @return CardiometabolicProfiles
*/
public function setSystolicBloodPressure($systolicBloodPressure)
{
$this->systolicBloodPressure = $systolicBloodPressure;
return $this;
}
/**
* Get systolicBloodPressure
*
* @return int
*/
public function getSystolicBloodPressure()
{
return $this->systolicBloodPressure;
}
/**
* Set hypertensionTreatment
*
* @param boolean $hypertensionTreatment
*
* @return CardiometabolicProfiles
*/
public function setHypertensionTreatment($hypertensionTreatment)
{
$this->hypertensionTreatment = (int)$hypertensionTreatment;
return $this;
}
/**
* Get hypertensionTreatment
*
* @return bool
*/
public function getHypertensionTreatment()
{
return $this->hypertensionTreatment;
}
/**
* Set totalCholesterol
*
* @param float $totalCholesterol
*
* @return CardiometabolicProfiles
*/
public function setTotalCholesterol($totalCholesterol)
{
$this->totalCholesterol = $totalCholesterol;
return $this;
}
/**
* Get totalCholesterol
*
* @return float
*/
public function getTotalCholesterol($convert=false)
{
if ($convert)
return ConvertUnitMeasures::convertCholesterol(
$this->totalCholesterol, $this->unitMeasureConcentration);
return $this->totalCholesterol;
}
/**
* Set hdlCholesterol
*
* @param float $hdlCholesterol
*
* @return CardiometabolicProfiles
*/
public function setHdlCholesterol($hdlCholesterol)
{
$this->hdlCholesterol = $hdlCholesterol;
return $this;
}
/**
* Get hdlCholesterol
*
* @return float
*/
public function getHdlCholesterol($convert=false)
{
if ($convert)
return ConvertUnitMeasures::convertCholesterol(
$this->hdlCholesterol, $this->unitMeasureConcentration);
return $this->hdlCholesterol;
}
/**
* Set nonHdlCholesterol
*
* @param float $nonHdlCholesterol
*
* @return CardiometabolicProfiles
*/
public function setNonHdlCholesterol($nonHdlCholesterol)
{
$this->nonHdlCholesterol = $nonHdlCholesterol;
return $this;
}
/**
* Get nonHdlCholesterol
*
* @return float
*/
public function getNonHdlCholesterol($convert=false)
{
if ($convert)
return ConvertUnitMeasures::convertCholesterol(
$this->nonHdlCholesterol, $this->unitMeasureConcentration);
return $this->nonHdlCholesterol;
}
/**
* Set myocardialInfarction
*
* @param boolean $myocardialInfarction
*
* @return CardiometabolicProfiles
*/
public function setMyocardialInfarction($myocardialInfarction)
{
$this->myocardialInfarction = (int)$myocardialInfarction;
return $this;
}
/**
* Get myocardialInfarction
*
* @return bool
*/
public function getMyocardialInfarction()
{
return $this->myocardialInfarction;
}
/**
* Set anginaPectoris
*
* @param boolean $anginaPectoris
*
* @return CardiometabolicProfiles
*/
public function setAnginaPectoris($anginaPectoris)
{
$this->anginaPectoris = (int)$anginaPectoris;
return $this;
}
/**
* Get anginaPectoris
*
* @return bool
*/
public function getAnginaPectoris()
{
return $this->anginaPectoris;
}
/**
* Set coronaryArteryBypass
*
* @param boolean $coronaryArteryBypass
*
* @return CardiometabolicProfiles
*/
public function setCoronaryArteryBypass($coronaryArteryBypass)
{
$this->coronaryArteryBypass = (int)$coronaryArteryBypass;
return $this;
}
/**
* Get coronaryArteryBypass
*
* @return bool
*/
public function getCoronaryArteryBypass()
{
return $this->coronaryArteryBypass;
}
/**
* Set arthritis
*
* @param boolean $arthritis
*
* @return CardiometabolicProfiles
*/
public function setArthritis($arthritis)
{
$this->arthritis = (int)$arthritis;
return $this;
}
/**
* Get arthritis
*
* @return bool
*/
public function getArthritis()
{
return $this->arthritis;
}
/**
* Set stroke
*
* @param boolean $stroke
*
* @return CardiometabolicProfiles
*/
public function setStroke($stroke)
{
$this->stroke = (int)$stroke;
return $this;
}
/**
* Get stroke
*
* @return bool
*/
public function getStroke()
{
return $this->stroke;
}
/**
* Set angioplasty
*
* @param boolean $angioplasty
*
* @return CardiometabolicProfiles
*/
public function setAngioplasty($angioplasty)
{
$this->angioplasty = $angioplasty;
return $this;
}
/**
* Get angioplasty
*
* @return bool
*/
public function getAngioplasty()
{
return $this->angioplasty;
}
/**
* Set cvdScoreId
*
* @param integer $cvdScoreId
*
* @return CardiometabolicProfiles
*/
public function setCvdScoreId($cvdScoreId)
{
$this->cvdScoreId = $cvdScoreId;
return $this;
}
/**
* Get cvdScoreId
*
* @return int
*/
public function getCvdScoreId()
{
return $this->cvdScoreId;
}
/**
* Set createdAt
*
* @param \DateTime $createdAt
*
* @return CardiometabolicProfiles
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return \DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set water
*
* @param float $water
*
* @return CardiometabolicProfiles
*/
public function setWater($water)
{
$this->water = $water;
return $this;
}
/**
* Get water
*
* @return float
*/
public function getWater()
{
return $this->water;
}
/**
* Set imc
*
* @param float $imc
*
* @return CardiometabolicProfiles
*/
public function setImc($imc)
{
$this->imc = $imc;
return $this;
}
/**
* Get imc
*
* @return float
*/
public function getImc()
{
return $this->imc;
}
/**
* Set calories
*
* @param float $calories
*
* @return CardiometabolicProfiles
*/
public function setCalories($calories)
{
$this->calories = $calories;
return $this;
}
/**
* Get calories
*
* @return float
*/
public function getCalories()
{
return $this->calories;
}
/**
* @return bool
*/
public function getDiabetes(): bool
{
return $this->diabetes;
}
/**
* @param bool $diabetes
*/
public function setDiabetes(bool $diabetes): void
{
$this->diabetes = $diabetes;
}
/**
* @return bool
*/
public function getMasterProfile(): bool
{
return $this->masterProfile;
}
/**
* @param bool $masterProfile
*/
public function setMasterProfile(bool $masterProfile): void
{
$this->masterProfile = $masterProfile;
}
/**
* @return float
*/
public function getHba1c($convert = false): float
{
if ($convert)
return ConvertUnitMeasures::convertHba1c(
$this->hba1c, $this->unitMeasureHba1c);
return $this->hba1c;
}
/**
* @param float $hba1c
*/
public function setHba1c(float $hba1c): void
{
$this->hba1c = $hba1c;
}
/**
* @return int
*/
public function getFastingBloodSugar($convert=false): float
{
if ($convert)
return ConvertUnitMeasures::convertFastingBloodSugar(
$this->fasting_blood_sugar, $this->unitMeasureConcentration);
return $this->fasting_blood_sugar;
}
/**
* @param int $fasting_blood_sugar
*/
public function setFastingBloodSugar(float $fasting_blood_sugar): void
{
$this->fasting_blood_sugar = $fasting_blood_sugar;
}
public function getFavouriteMenus(): ?int
{
return $this->favourite_menus;
}
public function setFavouriteMenus(int $favourite_menus): self
{
$this->favourite_menus = $favourite_menus;
return $this;
}
public function addFavouriteMenus(int $favourite_menus): self
{
$this->favourite_menus += $favourite_menus;
return $this;
}
public function getDiabetesStatus(): ?int
{
return $this->diabetes_status;
}
public function setDiabetesStatus(int $diabetes_status): self
{
$this->diabetes_status = $diabetes_status;
return $this;
}
/**
* Get the value of urea
*/
public function getUrea($convert=false)
{
if ($convert)
return ConvertUnitMeasures::convertUrea(
$this->urea, $this->unitMeasureConcentration);
return $this->urea;
}
/**
* Set the value of urea
*/
public function setUrea($urea): self
{
$this->urea = $urea;
return $this;
}
/**
* Get the value of unitMeasureHba1c
*/
public function getUnitMeasureHba1c()
{
return $this->unitMeasureHba1c;
}
/**
* Set the value of unitMeasureHba1c
*/
public function setUnitMeasureHba1c($unitMeasureHba1c): self
{
$this->unitMeasureHba1c = UnitMeasureHba1cType::validate(
$unitMeasureHba1c ?? UnitMeasureHba1cType::MMOL_PER_MOL->value);
return $this;
}
/**
* Get the value of creatinine
*/
public function getCreatinine($convert=false)
{
if ($convert)
return ConvertUnitMeasures::convertCreatinine(
$this->creatinine, $this->unitMeasureConcentration);
return $this->creatinine;
}
/**
* Set the value of creatinine
*/
public function setCreatinine($creatinine): self
{
$this->creatinine = $creatinine;
return $this;
}
/**
* Get the value of eGFR
*/
public function getEGFR()
{
return $this->eGFR;
}
/**
* Set the value of eGFR
*/
public function setEGFR($eGFR): self
{
$this->eGFR = $eGFR;
return $this;
}
/**
* Get the value of unitMeasureConcentration
*/
public function getUnitMeasureConcentration()
{
return $this->unitMeasureConcentration;
}
/**
* Set the value of unitMeasureConcentration
*/
public function setUnitMeasureConcentration($unitMeasureConcentration): self
{
$this->unitMeasureConcentration =
UnitMeasureConcentrationType::validate(
$unitMeasureConcentration ??
UnitMeasureConcentrationType::MG_PER_DL->value);
return $this;
}
public function hasOneOrMoreSevereRiskConditions() : bool
{
return $this->diabetes ||
$this->myocardialInfarction ||
$this->anginaPectoris ||
$this->coronaryArteryBypass ||
$this->arthritis ||
$this->angioplasty ||
$this->stroke;
}
/**
* Get the value of diabetesDiagnosisYear
*/
public function getDiabetesDiagnosisYear()
{
return $this->diabetesDiagnosisYear;
}
/**
* Set the value of diabetesDiagnosisYear
*/
public function setDiabetesDiagnosisYear($diabetesDiagnosisYear): self
{
$this->diabetesDiagnosisYear = $diabetesDiagnosisYear;
return $this;
}
}
enum UnitMeasureHba1cType: string
{
use BaseEnum;
case PERCENT = '%';
case MMOL_PER_MOL = 'mmol/mol';
}
enum UnitMeasureConcentrationType: string
{
use BaseEnum;
case MG_PER_DL = 'mg/dL';
case MMOL_PER_L = 'mmol/L';
}