Analysis of direct medical costs (CP) during treatment on a sample of 111, 926 heart failure patients based on data of Vietnam Social Security in the period 2017 - 2018, the study noted with the middle age 69.71 ± 15.18; the male: female ratio is 1: 1.30; average number of days in hospital 11.99 ± 13.64 days, factors related to total cost include using technical algorithm, patient age, male gender, number of days value, level up, library of the content, have a small path, extructs.