示例#1
0
        private void butMapToSnomed_Click(object sender, EventArgs e)
        {
            if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Will add SNOMED CT code to existing problems list only if the ICD9 code correlates to exactly one SNOMED CT code. If there is any ambiguity at all the code will not be added."))
            {
                return;
            }
            int changeCount = 0;
            Dictionary <string, string> dictionaryIcd9ToSnomed = Snomeds.GetICD9toSNOMEDDictionary();

            DiseaseDefs.RefreshCache();
            for (int i = 0; i < DiseaseDefs.ListLong.Length; i++)
            {
                if (!dictionaryIcd9ToSnomed.ContainsKey(DiseaseDefs.ListLong[i].ICD9Code))
                {
                    continue;
                }
                DiseaseDef def = DiseaseDefs.ListLong[i];
                if (def.SnomedCode != "")
                {
                    continue;
                }
                def.SnomedCode = dictionaryIcd9ToSnomed[def.ICD9Code];
                DiseaseDefs.Update(def);
                changeCount++;
            }
            MessageBox.Show(Lan.g(this, "SNOMED CT codes added: ") + changeCount);
        }