Я начинаю изучать asp.net и c # на работе, и мне дали проект для создания и исправления веб-страниц в asp.net.
У меня проблемы с одной из функцийдля отображения данных из xml на веб-страницу.
Цель кода - получить самую последнюю запись (дату и время) вверху, а остальные записи с одинаковым общим именем для того же узла перейдутниже.
Проблема заключается в том, что в настоящий момент, если имеется более двух узлов с одинаковыми значениями и одинаковыми датами, он будет разделяться и обрабатываться как разные элементы и создавать две группы с двумя разными верхними элементами.
Код:
var xd = XDocument.Parse(element.OuterXml);
if (xd != null)
{
var results =
(from el1 in xd.Descendants("Microbiology")
from el2 in el1.Descendants("Test")
orderby el2.Element("Date").Value descending
//orderby el2.Element("Rubric").Value
// I tried using distinct here but does not work.
where el2.Element("Date").Value ==
(el1.Descendants("Test").Where(
e => e.Element("ReadCode").Value ==
el2.Element("ReadCode").Value).First().Element("Date").Value)
select new Microbiology
{
Date = el2.Element("Date") != null ? el2.Element("Date").Value : "",
ReadCode = el2.Element("ReadCode") != null
? el2.Element("ReadCode").Value
: "",
Rubric = el2.Element("Rubric") != null
? el2.Element("Rubric").Value
: "",
SubMicro = (from subMicroEl1 in xd.Descendants("Microbiology")
from subMicroEl2 in subMicroEl1.Descendants("Test")
orderby subMicroEl2.Element("Date").Value descending
orderby subMicroEl2.Element("Rubric").Value
where subMicroEl2.Element("Rubric").Value ==
el2.Element("Rubric").Value &&
subMicroEl2.Element("Date").Value !=
el2.Element("Date").Value
select new Microbiology
{
Date = subMicroEl2.Element("Date") != null
? subMicroEl2.Element("Date").Value
: "",
ReadCode = subMicroEl2.Element("ReadCode") != null
? subMicroEl2.Element("ReadCode").Value
: "",
Rubric = subMicroEl2.Element("Rubric") != null
? subMicroEl2.Element("Rubric").Value
: "",
}).ToList<Microbiology>()
});
XML:
<Microbiology>
<Test>
<Date>2008-10-23</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value>123</Value>
<Units/>
</Test>
<Test>
<Date>2008-10-23</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-10-23</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-10-23</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-10-23</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-10-23</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value>123123</Value>
<Units/>
</Test>
<Test>
<Date>2008-10-23</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-10-23</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-07-30</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-07-30</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-07-30</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-07-30</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-07-09</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-07-09</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-07-09</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-07-09</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-07-09</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-07-09</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-07-09</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-07-09</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-05-12</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-05-12</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-05-12</Date>
<ReadCode>4JRA.</ReadCode>
<Rubric>Methicillin resistant staphylococcus aureus screening test</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-05-12</Date>
<ReadCode>4JRA.</ReadCode>
<Rubric>Methicillin resistant staphylococcus aureus screening test</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-03-07</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-03-07</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-03-07</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-03-07</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-01-15</Date>
<ReadCode>4JRA.</ReadCode>
<Rubric>Methicillin resistant staphylococcus aureus screening test</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-01-15</Date>
<ReadCode>4JRA.</ReadCode>
<Rubric>Methicillin resistant staphylococcus aureus screening test</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-01-15</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-01-15</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-01-15</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2008-01-15</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2007-11-07</Date>
<ReadCode>4JRA.</ReadCode>
<Rubric>Methicillin resistant staphylococcus aureus screening test</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2007-11-07</Date>
<ReadCode>4JRA.</ReadCode>
<Rubric>Methicillin resistant staphylococcus aureus screening test</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2007-11-07</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2007-11-07</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2007-10-08</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2007-10-08</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2007-10-08</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2007-10-08</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2007-10-08</Date>
<ReadCode>4JRA.</ReadCode>
<Rubric>Methicillin resistant staphylococcus aureus screening test</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2007-10-08</Date>
<ReadCode>4JRA.</ReadCode>
<Rubric>Methicillin resistant staphylococcus aureus screening test</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2007-08-13</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2007-08-13</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2007-06-13</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2007-06-13</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2007-06-13</Date>
<ReadCode>4JRA.</ReadCode>
<Rubric>Methicillin resistant staphylococcus aureus screening test</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2007-06-13</Date>
<ReadCode>4JRA.</ReadCode>
<Rubric>Methicillin resistant staphylococcus aureus screening test</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2007-05-04</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2007-05-04</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2007-05-04</Date>
<ReadCode>4JRA.</ReadCode>
<Rubric>Methicillin resistant staphylococcus aureus screening test</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2007-05-04</Date>
<ReadCode>4JRA.</ReadCode>
<Rubric>Methicillin resistant staphylococcus aureus screening test</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2007-01-26</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2007-01-26</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2006-09-29</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2006-09-29</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2006-08-31</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2006-08-31</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2006-08-31</Date>
<ReadCode>4JRA.</ReadCode>
<Rubric>Methicillin resistant staphylococcus aureus screening test</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2006-08-31</Date>
<ReadCode>4JRA.</ReadCode>
<Rubric>Methicillin resistant staphylococcus aureus screening test</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2006-08-16</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2006-08-16</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2006-08-16</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2006-08-16</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2006-06-02</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2006-06-02</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2006-06-02</Date>
<ReadCode>4JRA.</ReadCode>
<Rubric>Methicillin resistant staphylococcus aureus screening test</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2006-06-02</Date>
<ReadCode>4JRA.</ReadCode>
<Rubric>Methicillin resistant staphylococcus aureus screening test</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2006-05-09</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2006-05-09</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2006-05-09</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2006-05-09</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2006-01-17</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2006-01-17</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2005-11-22</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2005-11-22</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2005-10-18</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2005-10-18</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2005-10-18</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2005-10-18</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2005-09-13</Date>
<ReadCode>4JRA.</ReadCode>
<Rubric>Methicillin resistant staphylococcus aureus screening test</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2005-09-13</Date>
<ReadCode>4JRA.</ReadCode>
<Rubric>Methicillin resistant staphylococcus aureus screening test</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2005-09-13</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2005-09-13</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2005-09-13</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2005-09-13</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2005-07-19</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2005-07-19</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2005-07-19</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2005-07-19</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2005-03-15</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2005-03-15</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2005-03-15</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2005-03-15</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2004-04-05</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2004-04-05</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2004-04-05</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2004-04-05</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2004-04-05</Date>
<ReadCode>4J17.</ReadCode>
<Rubric>Sample culture</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2004-04-05</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2003-10-06</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2003-10-06</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2003-01-20</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2003-01-20</Date>
<ReadCode>4J15.</ReadCode>
<Rubric>Sample: organism sensitivity</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2002-06-17</Date>
<ReadCode>4I16.</ReadCode>
<Rubric>Microscopy, culture and sensitivities</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2002-06-17</Date>
<ReadCode>4I16.</ReadCode>
<Rubric>Microscopy, culture and sensitivities</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>1998-04-02</Date>
<ReadCode>4JG3.</ReadCode>
<Rubric>Skin ulcer swab taken</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2002-04-02</Date>
<ReadCode>4JG3.</ReadCode>
<Rubric>Skin ulcer swab taken</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2002-01-09</Date>
<ReadCode>4JG6.</ReadCode>
<Rubric>Skin swab culture positive</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2001-01-08</Date>
<ReadCode>4JG6.</ReadCode>
<Rubric>Skin swab culture positive</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2005-12-05</Date>
<ReadCode>4JG3.</ReadCode>
<Rubric>Skin ulcer swab taken</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2001-12-03</Date>
<ReadCode>4I16.</ReadCode>
<Rubric>Microscopy, culture and sensitivities</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2001-12-03</Date>
<ReadCode>4I16.</ReadCode>
<Rubric>Microscopy, culture and sensitivities</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2001-12-03</Date>
<ReadCode>4I16.</ReadCode>
<Rubric>Microscopy, culture and sensitivities</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2001-10-01</Date>
<ReadCode>4I16.</ReadCode>
<Rubric>Microscopy, culture and sensitivities</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2001-10-01</Date>
<ReadCode>4I16.</ReadCode>
<Rubric>Microscopy, culture and sensitivities</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2001-07-06</Date>
<ReadCode>4JG3.</ReadCode>
<Rubric>Skin ulcer swab taken</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2001-06-12</Date>
<ReadCode>4JG3.</ReadCode>
<Rubric>Skin ulcer swab taken</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2001-06-12</Date>
<ReadCode>4JG5.</ReadCode>
<Rubric>Skin swab culture negative</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2001-05-22</Date>
<ReadCode>4JG6.</ReadCode>
<Rubric>Skin swab culture positive</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2000-11-10</Date>
<ReadCode>4JG3.</ReadCode>
<Rubric>Skin ulcer swab taken</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2000-09-19</Date>
<ReadCode>4JG3.</ReadCode>
<Rubric>Skin ulcer swab taken</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2000-06-07</Date>
<ReadCode>4JP..</ReadCode>
<Rubric>Methicillin resistant staphylococcus aureus positive</Rubric>
<Value/>
<Units/>
</Test>
<Test>
<Date>2000-01-31</Date>
<ReadCode>4JG6.</ReadCode>
<Rubric>Skin swab culture positive</Rubric>
<Value/>
<Units/>
</Test>
</Microbiology>
Я вроде понимаю, что делает код, но я не знаю, как его изменить.
Обновление Мне нужно сгруппировать их по рубрике или коду чтения и упорядочить по дате, даже если даты повторяются, мне просто нужна одна группа и все элементы внутри, причем одна из них с самой последней датой находится вверху.
Любая помощь собудет признателен.
Дайте мне знать, если вам нужна дополнительная информация, я буду продолжать проверять вопрос.
Заранее спасибо.