public static string ChangeResultCode(string resultCode, SpecimenAdequacy specimenAdequacy) { StringBuilder result = new StringBuilder(resultCode); if (specimenAdequacy != null) { if (resultCode.Substring(0, 1) == "5") { if (resultCode.Length == 5) { string stringToReplace = resultCode.Substring(1, 2); result.Replace(stringToReplace, specimenAdequacy.ResultCode, 1, 2); } else { throw new Exception("Cytology Result Codes must be 5 characters long"); } } else { throw new Exception("This is not a Cytology Result Code."); } } return(result.ToString()); }
public static string ChangeResultCode(string resultCode, SpecimenAdequacy specimenAdequacy) { StringBuilder result = new StringBuilder(resultCode); if (specimenAdequacy != null) { if (resultCode.Substring(0, 1) == "5") { if (resultCode.Length == 5) { string stringToReplace = resultCode.Substring(1, 2); result.Replace(stringToReplace, specimenAdequacy.ResultCode, 1, 2); } else { throw new Exception("Cytology Result Codes must be 5 characters long"); } } else { throw new Exception("This is not a Cytology Result Code."); } } return result.ToString(); }