How do you use calculation in XForms for coded values?

The following example shows you how to write a function to generate sum and prepopulate a form in xforms

I am looking for an example that shows how to return a coded value as the value field for a concept if the conditions are met

eg say if value is 2-3 then answer is coded concept ‘cough’ which would be a value of ‘concept_id’^conceptname^99DC

(function () {
    var sum = 0;
    if (/form/bilirubin < 2 && /form/bilirubin > 0) {
         sum += 1;
    }
    else if (/form/bilirubin >= 2 && /form/bilirubin <= 3) {
        sum += 2;
    }
    else if (/form/bilirubin > 3) {
        sum += 3;
    }
     
    if (/form/albumin > 3.5) {
         sum += 1;
    }
    else if (/form/albumin >= 2.8 && /form/albumin <= 3.5) {
        sum += 2;
    }
    else if (/form/albumin < 2.8 && /form/albumin > 0) {
        sum += 3;
    }
     
    if (/form/inr < 1.7 && /form/inr > 0) {
         sum += 1;
    }
    else if (/form/inr >= 1.7 && /form/inr <= 2.2) {
        sum += 2;
    }
    else if (/form/inr > 2.2) {
        sum += 3;
    }
    if (/form/ascites > 0) {
         sum += parseInt(/form/ascites);
    }
    return sum;
} ) ()