/// <summary> /// Returns a text description for an Allergy Certainty level /// </summary> /// <param name="certainty">An Allergy Certainty level</param> /// <returns>A string description for an Allergy Certainty level</returns> public static string AllergyCertaintyDescriptionFromID(AllergyCertainty certainty) { string description = "Not Known"; switch ((AllergyCertainty)certainty) { case AllergyCertainty.NotKnown: description = "Not Known"; break; case AllergyCertainty.Tentative: description = "Tentative"; break; case AllergyCertainty.Unlikely: description = "Unlikely"; break; case AllergyCertainty.Possible: description = "Possible"; break; case AllergyCertainty.Likely: description = "Likely"; break; case AllergyCertainty.Certain: description = "Certain"; break; case AllergyCertainty.Absolute: description = "Absolute"; break; } return(description); }
/// <summary> /// Returns an Allergy Certainty level from a text description for /// </summary> /// <param name="certainty">An Allergy Certainty description</param> /// <returns>An Allergy Certainty level</returns> public static AllergyCertainty AllergyCertaintyIDFromDescription(string certainty) { AllergyCertainty level = AllergyCertainty.NotKnown; switch (certainty.ToLower()) { case "not known": level = AllergyCertainty.NotKnown; break; case "tentative": level = AllergyCertainty.Tentative; break; case "unlikely": level = AllergyCertainty.Unlikely; break; case "possible": level = AllergyCertainty.Possible; break; case "likely": level = AllergyCertainty.Likely; break; case "certain": level = AllergyCertainty.Certain; break; case "absolute": level = AllergyCertainty.Absolute; break; } return(level); }