string GetTextAnestesy(List <GroupOfTooth> groups) { string text = ""; foreach (GroupOfTooth group in groups) { if (((Anestesy)group.comparer).applica || ((Anestesy)group.comparer).carpul) { text += KlisheParams.GetBlock("treatment_local_anest"); } if (((Anestesy)group.comparer).applica) { text += KlisheParams.GetBlock("treatment_application_anest") + " " + KlisheParams.GetBlock("treatment_anest") + ((Anestesy)group.comparer).usingApplication.Name + ", "; } if (((Anestesy)group.comparer).carpul) { foreach (Anestesy.KindOfAnestesy koa in ((Anestesy)group.comparer).kindOfAnest) { text += " " + KlisheParams.GetBlock("treatment_" + koa.ToString() + "_anest") + " и"; } text = text.Remove(text.Length - 1); text += " " + KlisheParams.GetBlock("treatment_anest") + " раствором " + ((Anestesy)group.comparer).usingAnestetic.Name + " - " + ((Anestesy)group.comparer).mlOfAnest + "мл, "; } } return(text); }
string GetToothObjective(Tooth tooth) { string text = ""; if (tooth.ruin > 0) { text += KlisheParams.GetBlock("objectivno_ruin_" + tooth.ruin); } if (tooth.distpapil) { text += KlisheParams.GetBlock("objectivno_mukosapapil") + KlisheParams.GetBlock("objectivno_distpapil"); if (tooth.medpapil) { text += "и" + KlisheParams.GetBlock("objectivno_medpapil"); text += KlisheParams.MultiplyText(KlisheParams.GetBlock("objectivno_textpapil"), KlisheParams.GetBlock("objectivno_papil_multi")); } else { text += KlisheParams.GetBlock("objectivno_textpapil"); } } else if (tooth.medpapil) { text += KlisheParams.GetBlock("objectivno_mukosapapil") + KlisheParams.GetBlock("objectivno_medpapil") + KlisheParams.GetBlock("objectivno_textpapil"); } if (tooth.percus > 0) { text += KlisheParams.GetBlock("objectivno_percus_" + tooth.percus); } text += KlisheParams.GetBlock("objectivno_termotest_" + tooth.termotest); text += " ЭОД- " + tooth.eod + " мкА." + "\n"; return(text); }
string GetTextFromTooths(List <GroupOfTooth> groupsOfPretreat, List <GroupOfTooth> groupsOfDiag) { string text = ""; string textPretreat = ""; string textHealedEasy = ""; string textHealedHard = ""; string textNotHealed = ""; foreach (GroupOfTooth group in groupsOfPretreat) //сборка блоков текста лечен или не лечен { text_block curBlock = new text_block(); foreach (Tooth tooth in group.ToothsInGroup) { curBlock.analogObjects += tooth.number + ", "; } curBlock.analogObjects = curBlock.analogObjects.Remove(curBlock.analogObjects.Length - 2); curBlock.analogObjects += " зуб"; string key = "anamnes_pretreat_" + group.pretreat; curBlock.textOfBlock = KlisheParams.GetBlock(key); if (group.ToothsInGroup.Count > 1) { curBlock.multi = true; curBlock.analogObjects += "ы"; curBlock.textOfBlock = curBlock.textOfBlock.Replace("лечен", "лечены"); } curBlock.allText = curBlock.analogObjects + curBlock.textOfBlock; switch (group.pretreat) { case 0: textNotHealed = curBlock.allText; break; case 1: textHealedEasy = curBlock.allText; break; case 2: textHealedHard = curBlock.allText; break; } textPretreat = textNotHealed + textHealedEasy + textHealedHard; }//end of foreach state //List<byte> tooths = new List<byte>(); string textTrouble = ""; string textOfGroup = ""; string toothsNumbers = ""; List <text_block> text_blocks = new List <text_block>(); foreach (GroupOfTooth group in groupsOfDiag)//создание блоков текста сколько и как беспокоит { textOfGroup = KlisheParams.GetBlock("anamnes_trouble_" + group.MainDs.identityString); if (textOfGroup == "ERROR") { textOfGroup = KlisheParams.GetBlock("anamnes_trouble_" + group.MainDs.layer); } toothsNumbers = group.GetToothsText(false); bool alreadyHaveOne = false; foreach (text_block block in text_blocks) { if (block.textOfBlock == textOfGroup) { block.analogObjects = toothsNumbers + ", " + block.analogObjects; block.multi = true; alreadyHaveOne = true; break; } } if (!alreadyHaveOne) { text_block newBlock = new text_block(); newBlock.textOfBlock = textOfGroup; newBlock.analogObjects = toothsNumbers; try { newBlock.changerText = KlisheParams.GetBlock("anamnes_trouble_multi_" + group.MainDs.identityString); } catch { } try { if (newBlock.changerText == " _ " || newBlock.changerText == "") { newBlock.changerText = KlisheParams.GetBlock("anamnes_trouble_multi_" + group.MainDs.layer); } } catch { } if (group.ToothsInGroup.Count > 1) { newBlock.multi = true; } text_blocks.Add(newBlock); } }//end of foreach for groups foreach (text_block block in text_blocks)// теперь все блоки собираем вместе { if (text_blocks.Count > 1) { block.allText += block.analogObjects; if (block.multi) { block.allText += " зубы - "; } else { block.allText += " зуб - "; } } block.allText += block.textOfBlock; if (block.multi) { if (!ClisheTextManipulations.MultiplyText(block.allText, block.changerText, out block.allText)) { block.allText = block.allText.Replace("оит", "оят"); } } textTrouble += block.allText; if (text_blocks.IndexOf(block) + 1 == text_blocks.Count) { textTrouble += ". "; } else { textTrouble += ", "; } }//end of foreach for blocks text = textPretreat + textTrouble; return(text); } //end of GetText method
string GetTextFromGroups(List <GroupOfTooth> groups) { string text = ""; string textOfGroup = ""; string toothsNumbers = ""; List <text_block> text_blocks = new List <text_block>(); foreach (GroupOfTooth group in groups) //создание блоков текста сколько и как беспокоит { textOfGroup = KlisheParams.GetBlock("jaloby_" + group.MainCondition.Name + "_" + group.MainCondition.Depth.ToString()); if (textOfGroup == "ERROR") { textOfGroup = KlisheParams.GetBlock("jaloby_" + group.MainCondition.Name); } toothsNumbers = group.GetToothsText(false); bool alreadyHaveOne = false; foreach (text_block block in text_blocks) { if (block.textOfBlock == textOfGroup) { block.analogObjects = toothsNumbers + ", " + block.analogObjects; block.multi = true; alreadyHaveOne = true; break; } } if (!alreadyHaveOne) { text_block newBlock = new text_block(); newBlock.textOfBlock = textOfGroup; newBlock.analogObjects = toothsNumbers; if (group.ToothsInGroup.Count > 1) { newBlock.multi = true; } text_blocks.Add(newBlock); } }//end of foreach for groups foreach (text_block tblock in text_blocks) // теперь все блоки собираем вместе { tblock.allText += tblock.textOfBlock; if (tblock.multi) { tblock.allText += KlisheParams.GetBlock("jaloby_zubMany"); } else { tblock.allText += KlisheParams.GetBlock("jaloby_zubOne"); } tblock.allText += tblock.analogObjects + "."; text += tblock.allText; if (text_blocks.IndexOf(tblock) + 1 != text_blocks.Count) { text += "\n"; } } //end of foreach for blocks return(text); // string text = "Жалобы: "; // string textOfGroup = ""; // string numbersOfTeeth = ""; //int first = 0; //List<int> analogIndicies = new List<int>(); // foreach (GroupOfTooth group in groups) // { // //if (textOfGroup == "") // //{ // // textOfGroup = blocks.GetBlock("jaloby_" + group.MainDs.ToString()); // // numbersOfTeeth = group.GetToothsText(false); // // if (group.ToothsInGroup.Count == 1) // // { // // text += textOfGroup + blocks.GetBlock("jaloby_zubOne") + numbersOfTeeth + ". \n"; // // } // // else // // { // // text += textOfGroup + blocks.GetBlock("jaloby_zubMany") + numbersOfTeeth + ". \n"; // // } // //} // //else // if (!analogIndicies.Contains(first)) // { // textOfGroup = blocks.GetBlock("jaloby_" + group.MainDs.ToString()); // numbersOfTeeth = group.GetToothsText(false); // if (group.ToothsInGroup.Count == 1) // { // text += textOfGroup + blocks.GetBlock("jaloby_zubOne") + numbersOfTeeth + ". \n"; // } // else // { // text += textOfGroup + blocks.GetBlock("jaloby_zubMany") + numbersOfTeeth + ". \n"; // } // } // if (textOfGroup != "null"&&!analogIndicies.Contains(first)) // { // int second = 0; // foreach (GroupOfTooth insideGroup in groups) // { // if (second > first && textOfGroup == blocks.GetBlock("jaloby_" + insideGroup.MainDs.ToString())) // { // text = text.Replace("зуба " + numbersOfTeeth, "зубов " + insideGroup.GetToothsText(false) + ", " + numbersOfTeeth); // text = text.Replace("зубов " + numbersOfTeeth, "зубов " + insideGroup.GetToothsText(false) + ", " + numbersOfTeeth); // numbersOfTeeth = insideGroup.GetToothsText(false); // analogIndicies.Add(second); // } // second++; // } // textOfGroup = "null"; // } // first++; // } // return text; }
string GetFacesObjective(Tooth tooth) { string text = ""; List <text_block> text_blocks = new List <text_block>(); bool haveOne = false; foreach (Face face in tooth.GetAllFaces()) { foreach (Condition cond in face.GetConditionsOfFace()) { foreach (text_block tb in text_blocks) { if (((Condition)tb.comparer).Name == cond.Name) { haveOne = true; bool alreadyConnected = false; foreach (Face fc in tb.analogObjectsList)//проверяем нет ли среди поверхностей с таким же диагнозом, таких с которым эта поверхность уже соединена { if (face.GetConnections().Contains(fc)) { if (((Condition)tb.comparer).Depth < cond.Depth) { tb.comparer = cond; } alreadyConnected = true; break; } } if (!alreadyConnected)//если присоединенных поверхностей нет тогда она будет описываться отдельно. { tb.analogObjectsList.Add(face); tb.multi = true; } break; } } if (!haveOne) { text_block tb = new text_block(); tb.analogObjectsList.Add(face); tb.layer = cond.layerForDiscription; tb.comparer = cond; tb.textOfBlock = cond.rvgDescription; tb.changerText = cond.multiDiscription; text_blocks.Add(tb); } haveOne = false; } } text_blocks = text_blocks.OrderBy(t => t.layer).ToList();//упорядочиваем список блоков текста по слоям (первые слои наиболее важные - кариес и тому подобное, потом уже идет описание остальных слоев) foreach (text_block tb in text_blocks) { bool edge = false; bool onlyEdge = false; foreach (Face fc in tb.analogObjectsList) { if (fc.faceName != Face.faceSide.edge) //если это не режущий край тогда { tb.allText += "на " + KlisheParams.GetBlock("face_name_" + fc.faceName.ToString()) + "о"; //записываем в текст имя поверхности if (fc.GetConnections().Length > 0)//если есть присоединенные поверхности тогда добавляем их { foreach (Face connectedFace in fc.GetConnections()) { if (connectedFace.faceName != Face.faceSide.edge) { tb.allText += "-" + KlisheParams.GetBlock("face_name_" + connectedFace.faceName.ToString()) + "о"; } else { edge = true; } } } tb.allText += "й и "; } // // if (tb.allText == "") tb.allText += "на " + KlisheParams.GetBlock("face_name_" + fc.faceName.ToString()) + "о"; // else tb.allText += "-" + KlisheParams.GetBlock("face_name_" + fc.faceName.ToString()) + "о"; // } else { if (tb.allText == "" && tb.analogObjectsList.Count == 1) { onlyEdge = true; tb.allText += "по " + KlisheParams.GetBlock("face_name_" + fc.faceName.ToString() + "_onthe") + " "; } else { edge = true; } } } if (!onlyEdge) { tb.allText = tb.allText.Remove(tb.allText.Length - 2) + " поверхности "; } if (edge) { tb.allText += " с выходом на режущий край "; } if (tb.multi) { tb.allText += tb.MultiplyText(); } else { tb.allText += tb.textOfBlock; } tb.ToUpperFirstChar(text); text += tb.allText; }//end of foreach text_block return(text); }
string GetToothObjective(Tooth tooth) { string text = KlisheParams.GetBlock("rvg_clean"); return(text); }