All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ibm.fhir.ecqm.common.MeasureScoring Maven / Gradle / Ivy

/*
 * (C) Copyright IBM Corp. 2021
 *
 * SPDX-License-Identifier: Apache-2.0
 */
package com.ibm.fhir.ecqm.common;

import java.util.HashMap;
import java.util.Map;

/**
 * Enumeration of the standard FHIR Measure.scoring codes.
 */
public enum MeasureScoring {
    PROPORTION("proportion", "Proportion", "The measure score is defined using a proportion"),
    RATIO("ratio", "Ratio", "The measure score is defined using a ratio"),
    CONTINUOUSVARIABLE("continuous-variable", "Continuous Variable", "The score is defined by a calculation of some quantity"),
    COHORT("cohort", "Cohort", "The measure is a cohort definition");

    private String code;
    private String display;
    private String definition;

    MeasureScoring(String code, String display, String definition) {
        this.code = code;
        this.display = display;
        this.definition = definition;
    }

    private static final Map lookup = new HashMap<>();

    static {
        for (MeasureScoring ms : MeasureScoring.values()) {
            lookup.put(ms.toCode(), ms);
        }
    }

    public static MeasureScoring fromCode(String code) {
        if (code != null && !code.isEmpty()) {
            if (lookup.containsKey(code)) {
                return lookup.get(code);
            }
        }

        return null;
    }

    public String toCode() {
        return this.code;
    }

    public String getSystem() {
        return "http://hl7.org/fhir/measure-scoring";
    }

    public String getDefinition() {
        return this.definition;

    }

    public String getDisplay() {
        return this.display;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy