Implement Laboratory and TimePoints.

This commit is contained in:
Daniel Kraus
2015-07-11 16:51:02 +02:00
parent 2cf31914dd
commit 07ee4fbf2a
10 changed files with 276 additions and 38 deletions

View File

@ -0,0 +1,49 @@
/* ZaaImporterTest.cs
* part of zaaReloaded2
*
* Copyright 2015 Daniel Kraus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using zaa = zaaReloaded2.Importer.ZaaImporter;
using NUnit.Framework;
namespace Tests.Importer.ZaaImporter
{
[TestFixture]
class ZaaImporterTest
{
/// <summary>
/// Parses the demo-output.txt file that is built into the assembly.
/// Note that this demo text contains seven time points, only six of
/// which are distinct. Thus, the two time points with identical time
/// stamps should be merged in the <see cref="Laboratory"/>.
/// </summary>
[Test]
public void ParseTimePoints()
{
Stream s = this.GetType().Assembly.GetManifestResourceStream("Tests.demo-output.txt");
StreamReader r = new StreamReader(s);
zaa.ZaaImporter importer = new zaa.ZaaImporter();
importer.Import(r.ReadToEnd());
// Only 6 distinct time points (see method documentation above).
Assert.AreEqual(6, importer.Laboratory.TimePoints.Count);
}
}
}

View File

@ -66,6 +66,7 @@
<Compile Include="Dictionaries\DictionaryTest.cs" />
<Compile Include="Importer\ZaaImporter\LaurisItemTest.cs" />
<Compile Include="Importer\ZaaImporter\LaurisParagraphTest.cs" />
<Compile Include="Importer\ZaaImporter\ZaaImporterTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="LineParserTest.cs" />
<Compile Include="Dictionaries\TestDictionary.cs" />

View File

@ -1,17 +1,27 @@
[22.10.2013 12:30:00]
Aerobe Kultur: Enterokokken ;  Wachstum: 10 ;
Auftragskommentare: Untersuchungsmaterial:: Mittelstrahlurin (nativ) ;  Befundstatus Auftrag: Endbefund ;
Urinproteine quantitativ: Gesamt-Eiweiss (PU): 135 [<= 120] mg/l;  Gesamt-Eiweiss/Creatinin (PU): 281 [<= 70] mg/g Crea;  Albumin (PU): 57 [<= 30] mg/l;  Albumin/Creatinin (PU): 118.8 [<= 30] mg/g Crea;
Urin - Klin. Chemie: Creatinin (PU): 48.0 [40 - 278] mg/dl;
Urinproteine quantitativ: Gesamt-Eiweiss (SU): 184 [<= 120] mg/l;  Gesamt-Eiweiss (SU)/die: 340 [<= 150] mg/d;  Albumin (SU): 81 mg/l;  Albumin (SU)/die: 149.9 [<= 30] mg/d;  a1-Microglobulin (SU): 35.3 mg/l;  a1-Microglobulin (SU)/die: 65.3 [<= 20] mg/d;  Immunglobulin G (SU): 8 mg/l;  Immunglobulin G (SU)/die: 14.8 [<= 15] mg/d;
Urin - Klin. Chemie: Sammelzeit (U): 24 h;  Sammelmenge (U): 1850 ml;
Klinische Chemie: Natrium: 139 [135 - 145] mmol/l;  Kalium: 5.2 [3.5 - 5] mmol/l;  Calcium: 2.4 [2.0 - 2.7] mmol/l;  anorg. Phosphat: 0.58 [0.87 - 1.45] mmol/l;  Calcium-Phosphat-Produkt: 1.39 [<= 4.4] mmol²/l²;  Glucose: 112 [74 - 106] mg/dl;  glomerul. Filtrationsr. CKD-EP: 42 ml/min /1,73qm;  glomerul. Filtrationsr. (MDRD): 42 ml/min /1,73qm;  Creatinin: 1.84 [0 - 1.17] mg/dl;  Harnstoff: 54.3 [10 - 50] mg/dl;  Harnsäure: 4.6 [3.4 - 7] mg/dl;  Gesamt-Bilirubin: 0.7 [0.1 - 1.2] mg/dl;  GOT (ASAT): 303.0 [<= 50] U/l;  GPT (ALAT): 508.0 [<= 50] U/l;  GGT: 489.0 [<= 60] U/l;  Alk. Phosphatase: 56 [40 - 130] U/l;  Lactat Dehydrogenase: 320 [<= 250] U/l;  CK gesamt: 52 [<= 190] U/l;  Amylase: 62 [<= 110] U/l;  Cholesterin: 120 [130 - 220] mg/dl;  Triglyceride: 94 [74 - 172] mg/dl;  LDL - Cholesterin: 56 [0 - 150] mg/dl;  HDL - Cholesterin: 45 [>= 35] mg/dl;  Eisen: 215 [59 - 158] µg/dl;  Gesamt-Eiweiss: 5.7 [6.6 - 8.7] g/dl;  Albumin: 4.0 [3.5 - 5.5] g/dl;
Gerinnung: Niedermol. Heparin (Anti-Xa): 0.99 U/ml;
Hämatologie: Leukozyten: 2.9 [5 - 10] n*1000/µl;  Erythrozyten: 3.23 [4 - 6] n*10E6/µl;  Hämoglobin: 10.1 [14 - 18] g/dl;  Hämatokrit: 30.8 [42 - 50] %;  MCV: 95.4 [82 - 94] fl;  MCH (HbE): 31.3 [27 - 33] pg;  MCHC: 32.8 [32 - 36] g/dl;  Thrombozyten: 112 [150 - 450] n*1000/µl;  Mittleres Plättchenvolumen: 11.1 [9.7 - 11.9] fl;  Neutrophile: 74.4 [41 - 70] %;  Lymphozyten: 13.0 [25 - 40] %;  Monozyten: 11.3 [2 - 8] %;  Eosinophile: 1.0 [0.8 - 6.2] %;  Basophile: 0.3 [0 - 1] %;  Neutrophile: 2.18 [1.8 - 7.2] n*1000/µl;  Lymphozyten: 0.38 [1 - 4.05] n*1000/µl;  Monozyten: 0.33 [0.08 - 0.8] n*1000/µl;  Eosinophile: 0.0 [0.04 - 0.36] n*1000/µl;  Basophile: 0.0 [0 - 0.08] n*1000/µl;  Unreife Granulozyten: 0.3 %;
Urinproteine quantitativ: Gesamt-Eiweiss (SU): 186 [<= 120] mg/l;  Gesamt-Eiweiss (SU)/die: 344 [<= 150] mg/d;  Albumin (SU): 79 mg/l;  Albumin (SU)/die: 146.2 [<= 30] mg/d;
Urin - Klin. Chemie: Sammelzeit (U): 24 h;  Sammelmenge (U): 1850 ml;  Creatinin-Clearance (SU)/min: 46 [98 - 156] ml/min;  Harnstoff-Clearance (SU)/min: 21 [60 - 80] ml/min;  glomeruläre Filtrationsrate: 34 ml/min;  Calcium (SU): 0.79 mmol/l;  Calcium (SU)/die: 1.46 [2.5 - 8] mmol/d;  Creatinin (SU): 65.5 mg/dl;  Harnstoff (SU): 904 [900 - 3000] mg/dl;  Harnstoff (SU)/die: 16.7 [<= 35] g/d;  Kalium (SU): 24.4 [20 - 80] mmol/l;  Kalium (SU)/die: 45.14 [25 - 125] mmol/d;  Natrium (SU): 133.2 [54 - 150] mmol/l;  Natrium (SU)/die: 246.4 [40 - 220] mmol/d;
Serumproteine und Tumormarker: Ferritin: 3754 [30 - 400] µg/l;  Transferrin: 217 [200 - 380] mg/dl;  Transferrinsättigung: 70.2 [16 - 45] %;  Haptoglobin: < 10 [34 - 200] mg/dl;  C-reaktives Protein: < 0.01 [0 - 0.5] mg/dl;  Cystatin C (N Latex): 2.37 [0.57 - 0.96] mg/l;
Akutbestimmungen / TDM / Drogen: Tacrolimus (FK506): 10.7 µg/l;
Klinische Chemie: Natrium: 140 [135 - 145] mmol/l;  Kalium: 5.2 [3.5 - 5] mmol/l;  Calcium: 2.3 [2.0 - 2.7] mmol/l;  anorg. Phosphat: 0.59 [0.87 - 1.45] mmol/l;  Chlorid: 109 [94 - 110] mmol/l;  Glucose: 114 [74 - 106] mg/dl;  glomerul. Filtrationsr. CKD-EP: 42 ml/min /1,73qm;  glomerul. Filtrationsr. (MDRD): 42 ml/min /1,73qm;  Creatinin: 1.85 [0 - 1.17] mg/dl;  Harnstoff: 56.1 [10 - 50] mg/dl;  Cholinesterase: 3387 [5320 - 12920] U/l;  Lactat Dehydrogenase: 318 [<= 250] U/l;  Gesamt-Eiweiss: 5.7 [6.6 - 8.7] g/dl;  Albumin: 3.9 [3.5 - 5.5] g/dl;
Serumproteine und Tumormarker: C-reaktives Protein: < 0.01 [0 - 0.5] mg/dl;
Akutbestimmungen / TDM / Drogen: PO2 (art.): 64.0 [70 - 100] mmHg;  PCO2 (art.): 36.3 [36 - 44] mmHg;  pH: 7.393 [7.36 - 7.44] ;  Basenabweichung: -2.4 [-2 - 2] mmol/l;  aktuelles Bicarbonat: 21.6 [22 - 26] mmol/l;  Standard Bicarbonat: 22.4 [22 - 26] mmol/l;  Sauerstoffsättigung (art.): 95.8 [95 - 99] %;
# This file contains 7 time points.
# This leading text should be ignored.
# DO NOT CHANGE THE FOLLOWING TEXT, LEST THE TESTS WILL FAIL!
(06.07.2015 15:16:00)
Urin - Klin. Chemie: Sammelzeit (U): 24 h; Sammelmenge (U): 1300 ml; Natrium (SU): 107.8 [54 - 150] mmol/l; Natrium (SU)/die: 140.1 [40 - 220] mmol/d;
(06.07.2015 13:39:00)
Urin - Klin. Chemie: Creatinin (PU): 153.7 [40 - 278] mg/dl;
(06.07.2015 12:31:00)
Klinische Chemie: Natrium: 144 [135 - 145] mmol/l; Kalium: 4.3 [3.5 - 5] mmol/l; Calcium: 2.3 [2.0 - 2.7] mmol/l; Korrigiertes Calcium: 2.3 [2.0 - 2.7] mmol/l; Magnesium: 0.87 [0.7 - 1.05] mmol/l; anorg. Phosphat: 0.98 [0.87 - 1.45] mmol/l; Calcium-Phosphat-Produkt: 2.25 [<= 4.4] mmol²/l²; Glucose: 93 [74 - 106] mg/dl; glomerul. Filtrationsr. CKD-EP: 56 ml/min /1,73qm; glomerul. Filtrationsr. (MDRD): 54 ml/min /1,73qm; Creatinin: 1.52 [0 - 1.17] mg/dl; Harnstoff: 41.1 [10 - 50] mg/dl; Harnsäure: 7.7 [3.4 - 7] mg/dl; Gesamt-Bilirubin: 0.2 [0.1 - 1.2] mg/dl; GOT (ASAT): 22.2 [<= 50] U/l; GPT (ALAT): 28.0 [<= 50] U/l; GGT: 49.0 [<= 60] U/l; Alk. Phosphatase: 70 [40 - 130] U/l; Lactat Dehydrogenase: 205 [<= 250] U/l; Cholesterin: 219 [130 - 220] mg/dl; Triglyceride: 195 [74 - 172] mg/dl; LDL - Cholesterin: 141 [0 - 150] mg/dl; HDL - Cholesterin: 39 [>= 35] mg/dl; Albumin: 4.1 [3.5 - 5.5] g/dl;
Hämatologie: Leukozyten: 7.2 [5 - 10] n*1000/µl; Erythrozyten: 4.79 [4 - 6] n*10E6/µl; Hämoglobin: 14.0 [14 - 18] g/dl; Hämatokrit: 41.0 [42 - 50] %; MCV: 85.6 [82 - 94] fl; MCH (HbE): 29.2 [27 - 33] pg; MCHC: 34.1 [32 - 36] g/dl; Thrombozyten: 269 [150 - 450] n*1000/µl; Mittleres Plättchenvolumen: 10.3 [9.7 - 11.9] fl;
Urin - Klin. Chemie: Sammelzeit (U): 24 h; Sammelmenge (U): 1300 ml; Creatinin-Clearance (SU)/min: 90 [98 - 156] ml/min; Harnstoff-Clearance (SU)/min: 40 [60 - 80] ml/min; glomeruläre Filtrationsrate: 65 ml/min; Calcium (SU): 0.64 mmol/l; Calcium (SU)/die: 0.83 [2.5 - 8] mmol/d; Creatinin (SU): 151.5 mg/dl; Harnstoff (SU): 1831 [900 - 3000] mg/dl; Harnstoff (SU)/die: 23.8 [<= 35] g/d; Kalium (SU): 39.2 [20 - 80] mmol/l; Kalium (SU)/die: 50.96 [25 - 125] mmol/d; Natrium (SU): 108.1 [54 - 150] mmol/l; Natrium (SU)/die: 140.5 [40 - 220] mmol/d;
Serumproteine und Tumormarker: C-reaktives Protein: 0.71 [0 - 0.5] mg/dl;
(06.07.2015 13:29:00)
Hepatitis Serologie: HBs-Antikörper: neg. ;
(06.07.2015 12:20:00)
Schilddrüse: TSH: 1.30 [0.3 - 4.0] mIU/l;
Ca-Phosphat-Stoffwechsel: PTH intakt: 56.1 [12 - 65] ng/l;
(06.07.2015 10:28:00)
Urinproteine quantitativ: Gesamt-Eiweiss (SU): < 40 [<= 120] mg/l; Albumin (SU): < 12 mg/l; a1-Microglobulin (SU): < 6 mg/l;
Urin - Klin. Chemie: Sammelzeit (U): 24 h; Sammelmenge (U): 2900 ml; Natrium (SU): < 20 [54 - 150] mmol/l;
(06.07.2015 10:28:00)
Klinische Chemie: Natrium: 138 [135 - 145] mmol/l; Kalium: 4.6 [3.5 - 5] mmol/l; Calcium: 2.5 [2.0 - 2.7] mmol/l; Korrigiertes Calcium: 2.3 [2.0 - 2.7] mmol/l; Magnesium: 0.78 [0.7 - 1.05] mmol/l; anorg. Phosphat: 0.82 [0.87 - 1.45] mmol/l; Calcium-Phosphat-Produkt: 2.05 [<= 4.4] mmol²/l²; Glucose: 96 [82 - 115] mg/dl; glomerul. Filtrationsr. CKD-EP: 92 ml/min /1,73qm; glomerul. Filtrationsr. (MDRD): 97 ml/min /1,73qm; Creatinin: 0.84 [0 - 1.17] mg/dl; Harnstoff: 17.5 [10 - 50] mg/dl; Harnsäure: 7.0 [3.4 - 7] mg/dl; Gesamt-Bilirubin: 0.9 [0.1 - 1.2] mg/dl; GOT (ASAT): 34.1 [<= 50] U/l; GPT (ALAT): 39.0 [<= 50] U/l; GGT: 24.7 [<= 60] U/l; Alk. Phosphatase: 58 [40 - 130] U/l; Lactat Dehydrogenase: 180 [<= 250] U/l; Cholesterin: 156 [130 - 220] mg/dl; Triglyceride: 113 [74 - 172] mg/dl; LDL - Cholesterin: 84 [0 - 150] mg/dl; HDL - Cholesterin: 49 [>= 35] mg/dl; Albumin: 4.7 [3.5 - 5.5] g/dl;
Hämatologie: Leukozyten: 8.3 [5 - 10] n*1000/µl; Erythrozyten: 5.51 [4 - 6] n*10E6/µl; Hämoglobin: 16.0 [14 - 18] g/dl; Hämatokrit: 45.6 [42 - 50] %; MCV: 82.8 [82 - 94] fl; MCH (HbE): 29.0 [27 - 33] pg; MCHC: 35.1 [32 - 36] g/dl; Thrombozyten: 154 [150 - 450] n*1000/µl; Mittleres Plättchenvolumen: 9.5 [9.7 - 11.9] fl; Neutrophile abs.: 3.32 n*1000/µl; Lymphozyten abs.: 4.23 n*1000/µl; Segmentkernige: 40 [50 - 70] %; Eosinophile: 2 [0 - 6] %; Basophile: 1 [0 - 1.0] %; Lymphozyten: 51 [25 - 40] %; Monozyten: 6 [2 - 8] %; Neutrophile: 50.9 [41 - 70] %; Lymphozyten: 32.1 [25 - 40] %; Monozyten: 15.6 [2 - 8] %; Eosinophile: 1.2 [0.8 - 6.2] %; Basophile: 0.2 [0 - 1] %; Neutrophile: 4.23 [1.8 - 7.2] n*1000/µl; Lymphozyten: 2.67 [1 - 4.05] n*1000/µl; Monozyten: 1.30 [0.08 - 0.8] n*1000/µl; Eosinophile: 0.1 [0.04 - 0.36] n*1000/µl; Basophile: 0.0 [0 - 0.08] n*1000/µl; Unreife Granulozyten: 0.2 %;
Urinproteine quantitativ: Gesamt-Eiweiss (SU): < 40 [<= 120] mg/l; Albumin (SU): < 12 mg/l;
Urin - Klin. Chemie: Sammelzeit (U): 24 h; Sammelmenge (U): 2900 ml; Creatinin-Clearance (SU)/min: 84 [98 - 156] ml/min; Harnstoff-Clearance (SU)/min: 52 [60 - 80] ml/min; glomeruläre Filtrationsrate: 68 ml/min; Calcium (SU): 0.71 mmol/l; Calcium (SU)/die: 2.06 [2.5 - 8] mmol/d; Creatinin (SU): 35.2 mg/dl; Harnstoff (SU): 454 [900 - 3000] mg/dl; Harnstoff (SU)/die: 13.2 [<= 35] g/d; Kalium (SU): 14.5 [20 - 80] mmol/l; Kalium (SU)/die: 42.05 [25 - 125] mmol/d; Natrium (SU): < 20 [54 - 150] mmol/l;
Serumproteine und Tumormarker: C-reaktives Protein: 0.13 [0 - 0.5] mg/dl;
Akutbestimmungen / TDM / Drogen: Tacrolimus (FK506): 6.2 µg/l;