# Child and Pugh score: Automatic calculation

**URL:** <https://community.dhis2.org/t/child-and-pugh-score-automatic-calculation/48536>\
**Category:** Support - Assistance technique\
**Tags:** tracker\
**Created:** [9 July 2022 08:59 UTC](https://community.dhis2.org/t/child-and-pugh-score-automatic-calculation/48536 "2022-07-09T08:59:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![elmoujarrade](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/elmoujarrade/32/30611_2.png) [@elmoujarrade](https://community.dhis2.org/u/elmoujarrade)\
**Post date:** [9 July 2022 08:59 UTC](https://community.dhis2.org/t/child-and-pugh-score-automatic-calculation/48536/1 "2022-07-09T08:59:35Z")

</div>

Hi, Community  
Currently I am setting up a tracker program on DHIS2 2.37, to track hepatitis C cases.  
I want to be able to calculate the Child and Pugh score from the following 5 data element scoring:

 ![Score Child and Pugh](https://dhis2.b-cdn.net/uploads/default/original/3X/5/e/5e1d0e87a93dfd0b661223ed3ccde77f12d20217.png)

Each answer chosen has a score of 1 point and the sum gives us the Child and Pugh score.  
Here is the link to calculate this score on the web: [Medicalcul - Score de Child-Pugh ~ Hépato-Gastroentérologie](http://medicalcul.free.fr/childpugh.html)

Can someone guide me step by step to automatically calculate this score.  
Thanks.

---

<div class="post-metadata">

**Author:** ![Gassim](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/gassim/32/35347_2.png) [@Gassim](https://community.dhis2.org/u/Gassim)\
**Post date:** [11 July 2022 19:05 UTC](https://community.dhis2.org/t/child-and-pugh-score-automatic-calculation/48536/2 "2022-07-11T19:05:47Z")

</div>

> [@elmoujarrade](#):
>
> Each answer chosen has a score of 1 point and the sum gives us the Child and Pugh score

I think for this you could use a program rule which adds the value of 1 to a data element each time an answer is chosen.

---

<div class="post-metadata">

**Author:** ![elmoujarrade](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/elmoujarrade/32/30611_2.png) [@elmoujarrade](https://community.dhis2.org/u/elmoujarrade)\
**Post date:** [11 July 2022 21:01 UTC](https://community.dhis2.org/t/child-and-pugh-score-automatic-calculation/48536/3 "2022-07-11T21:01:09Z")

</div>

Hi, @Gassim  
Thank you for your support.

---

<div class="post-metadata">

**Author:** ![Gassim](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/gassim/32/35347_2.png) [@Gassim](https://community.dhis2.org/u/Gassim)\
**Post date:** [12 July 2022 15:38 UTC](https://community.dhis2.org/t/child-and-pugh-score-automatic-calculation/48536/4 "2022-07-12T15:38:19Z")

</div>

Hi @elmoujarrade,

I’m glad it worked! I was wondering what happens when a user changes the selection? 😁😅 Does it affect the sum or does it remain the same?

Thanks!

---

<div class="post-metadata">

**Author:** ![elmoujarrade](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/elmoujarrade/32/30611_2.png) [@elmoujarrade](https://community.dhis2.org/u/elmoujarrade)\
**Post date:** [13 July 2022 10:52 UTC](https://community.dhis2.org/t/child-and-pugh-score-automatic-calculation/48536/5 "2022-07-13T10:52:39Z")

</div>

> [@Gassim](#):
>
> I’m glad it worked! I was wondering what happens when a user changes the selection? 😁😅 Does it affect the sum or does it remain the same?
> 
> Thanks!

I found a practical and simple solution, I just inserted the link that calculates this score on the field of the data element, and it works very well for the moment.  
thank you for following
