def _fix_mimic_icd(icd):
    """ Add the decimal to the correct location for the ICD code
    
    From the mimic documentation (https://mimic.physionet.org/mimictables/diagnoses_icd/):
    
        > The code field for the ICD-9-CM Principal and Other Diagnosis Codes
        > is six characters in length, with the decimal point implied between
        > the third and fourth digit for all diagnosis codes other than the V
        > codes. The decimal is implied for V codes between the second and third
        > digit.

    """
    
    icd = str(icd)
    
    if len(icd) == 3:
        # then we just have the major chapter
        icd = icd
    else:
        icd = [
            icd[:3],
            ".",
            icd[3:]
        ]
        icd = "".join(icd)
        
    return icd