package tutorial.rest.resources.asm;


import org.springframework.hateoas.mvc.ResourceAssemblerSupport;
import tutorial.core.models.entities.ActiveIngredientRecomendation;
import tutorial.rest.mvc.ActiveIngredientRecomendationController;
import tutorial.rest.resources.ActiveIngredientRecomendationResource;

/**
 * 
 * @author Xavier
 */
public class ActiveIngredientRecomendationResourceAsm extends ResourceAssemblerSupport<ActiveIngredientRecomendation, ActiveIngredientRecomendationResource> {

    /**
     *
     */
    public ActiveIngredientRecomendationResourceAsm()
    {
        super(ActiveIngredientRecomendationController.class, ActiveIngredientRecomendationResource.class);
    }

    /**
     *
     * @param activeIngredientRecomendation
     * @return
     */
    @Override
    public ActiveIngredientRecomendationResource toResource(ActiveIngredientRecomendation activeIngredientRecomendation) {
        ActiveIngredientRecomendationResource res = new ActiveIngredientRecomendationResource();
        res.setClinicalCare(activeIngredientRecomendation.getClinicalCare());
        res.setAdjustDose(activeIngredientRecomendation.getAdjustDose());
        res.setGlomerularFiltrationRateRange(activeIngredientRecomendation.getGlomerularFiltrationRateRange());
        res.setMaxGlomerularFiltrationRate(activeIngredientRecomendation.getMaxGlomerularFiltrationRate());
        res.setMinGlomerularFiltrationRate(activeIngredientRecomendation.getMinGlomerularFiltrationRate());
        res.setRisk(activeIngredientRecomendation.getRisk());

        return res;
    }
}
