Exemplo n.º 1
0
        public List <SymptomModel> Process(PatientListParameter parameter)
        {
            List <SymptomModel> symptomList = new List <SymptomModel>();

            List <SymptomModel> symptomList_VS = _restData.AQLQuery <SymptomModel>(AQLCatalog.PatientSymptom_VS(parameter));

            if (symptomList_VS != null)
            {
                symptomList = symptomList_VS;
            }

            List <SymptomModel> symptomList_AS = _restData.AQLQuery <SymptomModel>(AQLCatalog.PatientSymptom_AS(parameter));

            if (symptomList_AS != null)
            {
                symptomList = symptomList.Concat(symptomList_AS).ToList();
            }

            List <SymptomModel> symptomList_US = _restData.AQLQuery <SymptomModel>(AQLCatalog.PatientSymptom_US(parameter));

            if (symptomList_US != null)
            {
                symptomList = symptomList.Concat(symptomList_US).ToList();
            }

            return(symptomList);
        }
Exemplo n.º 2
0
 public static AQLQuery PatientLaborData(PatientListParameter patientList)
 {
     return(new AQLQuery("PatientLaborData", $@"SELECT e/ehr_id/value as PatientID,
                             c/context/start_time/value as Befunddatum,
                             y/items[at0001]/value/value as FallID,
                             a/items[at0001]/value/id as LabordatenID,
                             a/items[at0029]/value/defining_code/code_string as MaterialID,
                             a/items[at0029]/value/value as Material_l,
                             a/items[at0015]/value/value as ZeitpunktProbenentnahme,
                             a/items[at0034]/value/value as ZeitpunktProbeneingang,
                             d/items[at0024]/value/value as Keim_l,
                             d/items[at0024]/value/defining_code/code_string as KeimID,
                             d/items[at0001,'Nachweis']/value/value as Befund,
                             d/items[at0001,'Nachweis']/value/defining_code/code_string as BefundCode,
                             d/items[at0001,'Quantitatives Ergebnis']/value/magnitude as Viruslast,
                             l/data[at0001]/events[at0002]/data[at0003]/items[at0101]/value/value as Befundkommentar
                             FROM EHR e
                             CONTAINS COMPOSITION c 
                                 CONTAINS (CLUSTER y[openEHR-EHR-CLUSTER.case_identification.v0] 
                                 and OBSERVATION l[openEHR-EHR-OBSERVATION.laboratory_test_result.v1]
                                     CONTAINS (CLUSTER a[openEHR-EHR-CLUSTER.specimen.v1]
                                     and CLUSTER b[openEHR-EHR-CLUSTER.laboratory_test_panel.v0]
                                         CONTAINS (CLUSTER d[openEHR-EHR-CLUSTER.laboratory_test_analyte.v1])))
                             WHERE c/name/value = 'Virologischer Befund'
                             AND e/ehr_id/value MATCHES { patientList.ToAQLMatchString() }
                             ORDER BY a/items[at0015]/value/value ASC"));
 }
Exemplo n.º 3
0
        public void ProcessorTest(string ehrID, int expectedResultSet)
        {
            RestDataAccess _data = TestConnection.Initialize();

            PatientListParameter patientParams = new PatientListParameter()
            {
                patientList = new List <string>()
                {
                    ehrID
                }
            };

            PatientLabordataFactory factory  = new PatientLabordataFactory(_data, NullLogger <PatientLabordataFactory> .Instance);
            List <LabDataModel>     actual   = factory.Process(patientParams);
            List <LabDataModel>     expected = GetExpectedLabDataModels(expectedResultSet);

            Assert.Equal(expected.Count, actual.Count);

            for (int i = 0; i < actual.Count; i++)
            {
                Assert.Equal(expected[i].PatientID, actual[i].PatientID);
                Assert.Equal(expected[i].FallID, actual[i].FallID);
                Assert.Equal(expected[i].Befund, actual[i].Befund);
                Assert.Equal(expected[i].Befunddatum.ToString("s"), actual[i].Befunddatum.ToUniversalTime().ToString("s"));
                Assert.Equal(expected[i].Befundkommentar, actual[i].Befundkommentar);
                Assert.Equal(expected[i].KeimID, actual[i].KeimID);
                Assert.Equal(expected[i].LabordatenID, actual[i].LabordatenID);
                Assert.Equal(expected[i].MaterialID, actual[i].MaterialID);
                Assert.Equal(expected[i].Material_l, actual[i].Material_l);
                Assert.Equal(expected[i].ProbeID, actual[i].ProbeID);
                Assert.Equal(expected[i].ZeitpunktProbeneingang.ToString("s"), actual[i].ZeitpunktProbeneingang.ToUniversalTime().ToString("s"));
                Assert.Equal(expected[i].ZeitpunktProbenentnahme.ToString("s"), actual[i].ZeitpunktProbenentnahme.ToUniversalTime().ToString("s"));
                //Assert.Equal(expected[i].Fachabteilung, actual[i].Fachabteilung); --> Exisitiert noch nicht, muss aber eingebunden werden
            }
        }
Exemplo n.º 4
0
        public void ProcessorTest(string ehrID, int ResultSetID)
        {
            RestDataAccess _data = TestConnection.Initialize();

            PatientListParameter patientParams = new PatientListParameter()
            {
                patientList = new List <string>()
                {
                    ehrID
                }
            };

            PatientMovementFactory      factory  = new PatientMovementFactory(_data, NullLogger <PatientMovementFactory> .Instance);
            List <PatientMovementModel> actual   = factory.Process(patientParams);
            List <PatientMovementModel> expected = GetExpectedPatientMovementModels(ResultSetID);

            Assert.Equal(expected.Count, actual.Count);

            for (int i = 0; i < actual.Count; i++)
            {
                Assert.Equal(expected[i].PatientID, actual[i].PatientID);
                Assert.Equal(expected[i].FallID, actual[i].FallID);
                Assert.Equal(expected[i].Bewegungsart_l, actual[i].Bewegungsart_l);
                Assert.Equal(expected[i].Bewegungstyp, actual[i].Bewegungstyp);
                Assert.Equal(expected[i].BewegungstypID, actual[i].BewegungstypID);
                Assert.Equal(expected[i].Beginn.ToString("s"), actual[i].Beginn.ToString("s"));
                Assert.Equal(expected[i].Ende.ToString("g"), actual[i].Ende.ToString("g"));
                Assert.Equal(expected[i].StationID, actual[i].StationID);
                Assert.Equal(expected[i].Raum, actual[i].Raum);
                //Assert.Equal(expected[i].Fachabteilung, actual[i].Fachabteilung);
            }
        }
Exemplo n.º 5
0
        public List <LabDataModel> Process(PatientListParameter parameter)
        {
            List <LabDataReceiveModel> receiveLabDataList = _restData.AQLQuery <LabDataReceiveModel>(AQLCatalog.PatientLaborData(parameter));

            if (receiveLabDataList is null)
            {
                return(new List <LabDataModel>());
            }

            return(LabDataConstructor(receiveLabDataList));
        }
Exemplo n.º 6
0
        private PatientListParameter PatientModelListToPatientListParameter(List <PatientModel> currentPatients)
        {
            PatientListParameter patientList = new PatientListParameter();

            patientList.patientList = new List <string>();
            foreach (PatientModel patient in currentPatients)
            {
                patientList.patientList.Add(patient.PatientID);
            }
            return(patientList);
        }
Exemplo n.º 7
0
        public List <PatientMovementModel> Process(PatientListParameter parameter)
        {
            List <PatientStayModel> patientStayList = _restData.AQLQuery <PatientStayModel>(AQLCatalog.PatientStay(parameter));

            if (patientStayList is null)
            {
                return(new List <PatientMovementModel>());
            }

            return(ReturValueConstrutor(patientStayList));
        }
Exemplo n.º 8
0
 public ActionResult <List <LabDataModel> > Patient_Labordaten_Ps([FromBody] PatientListParameter parameter)
 {
     _logger.LogInformation("CALLED Patient_Labordaten_Ps with parameters: PatientIDs: {patList}", parameter.ToAQLMatchString());
     try
     {
         return(_patientInformation.Patient_Labordaten_Ps(parameter));
     }
     catch (Exception e)
     {
         _logger.LogWarning("CALLED Patient_Labordaten_Ps:" + e.Message);
         return(ErrorHandling(e));
     }
 }
Exemplo n.º 9
0
 private void ContactModelConstructor(List <ContactPatientModel> ContactPatientList)
 {
     foreach (ContactPatientModel contact in ContactPatientList)
     {
         PatientListParameter patList = new PatientListParameter()
         {
             patientList = new List <string> {
                 contact.PatientID
             }
         };
         contacts.PatientMovements.AddRange(_patientInformation.Patient_Bewegung_Ps(patList));
         contacts.LaborData.AddRange(_patientInformation.Patient_Labordaten_Ps(patList));
     }
 }
Exemplo n.º 10
0
        public List <MibiLabDataModel> Process(PatientListParameter parameter)
        {
            mibiLabDatas = new List <MibiLabDataModel>();

            List <MetaDataReceiveModel> metaDatas = _restData.AQLQuery <MetaDataReceiveModel>(AQLCatalog.CasesWithResults(parameter));

            if (metaDatas != null)
            {
                getSampleData(metaDatas);
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("metaDatas is null");
            }

            return(mibiLabDatas);
        }
Exemplo n.º 11
0
        public NECCombinedDataModel Process(DateTime date)
        {
            List <PatientModel> currentPatients = _restData.AQLQuery <PatientModel>(AQLCatalog.GetAllPatients(date));

            PatientListParameter patientParameter = PatientModelListToPatientListParameter(currentPatients);

            List <LabDataModel>         patLabs      = _labFac.Process(patientParameter);
            List <PatientMovementModel> patMovemenst = _movFac.Process(patientParameter);


            NECCombinedDataModel data = new NECCombinedDataModel()
            {
                labdat       = reduceToNECData(patLabs),
                movementData = reduceToNECData(patMovemenst)
            };

            return(data);
        }
Exemplo n.º 12
0
 public static AQLQuery PatientStay(PatientListParameter patientList)
 {
     return(new AQLQuery("PatientStay", $@"SELECT e/ehr_id/value as PatientID,
                         i/items[at0001]/value/value as FallID,
                         h/data[at0001]/items[at0004]/value/value as Beginn,
                         h/data[at0001]/items[at0005]/value/value as Ende,
                         h/data[at0001]/items[at0006]/value/value as Bewegungsart_l,
                         s/items[at0027]/value/value as StationID,
                         s/items[at0029]/value/value as Raum,
                         f/items[at0024]/value/value as Fachabteilung,
                         f/items[at0024]/value/defining_code/code_string as FachabteilungsID
                         FROM EHR e 
                         CONTAINS COMPOSITION c[openEHR-EHR-COMPOSITION.event_summary.v0] 
                             CONTAINS (CLUSTER i[openEHR-EHR-CLUSTER.case_identification.v0]
                             AND ADMIN_ENTRY h[openEHR-EHR-ADMIN_ENTRY.hospitalization.v0]
                                 CONTAINS (CLUSTER s[openEHR-EHR-CLUSTER.location.v1]
                                 AND CLUSTER f[openEHR-EHR-CLUSTER.organization.v0]))
                         WHERE c/name/value = 'Patientenaufenthalt'
                         AND i/items[at0001]/name/value = 'Zugehöriger Versorgungsfall (Kennung)'
                         AND e/ehr_id/value MATCHES {patientList.ToAQLMatchString()}
                         ORDER BY e/ehr_id/value ASC, h/data[at0001]/items[at0004]/value/value ASC"));
 }
Exemplo n.º 13
0
 public static AQLQuery PatientSymptom_US(PatientListParameter patientList)
 {
     return(new AQLQuery("PatientSymptom_US", $"SELECT e/ehr_id/value as PatientenID, a/data[at0001]/items[at0002]/value/value as UnbekanntesSymptom, a/ data[at0001]/items[at0005]/value/value as AussageFehlendeInfo FROM EHR e CONTAINS COMPOSITION c CONTAINS EVALUATION a[openEHR-EHR-EVALUATION.absence.v2] WHERE c/archetype_details/template_id='Symptom' and e/ehr_id/value matches { patientList.ToAQLMatchString() }"));
 }
Exemplo n.º 14
0
 public static AQLQuery PatientSymptom_AS(PatientListParameter patientList)
 {
     return(new AQLQuery("PatientSymptom_AS", $"SELECT e/ehr_id/value as PatientenID, a/data[at0001]/items[at0002]/value/value as AusschlussAussage, a/ data[at0001]/items[at0003]/value/value as Diagnose FROM EHR e CONTAINS COMPOSITION c CONTAINS EVALUATION a[openEHR-EHR-EVALUATION.exclusion_specific.v1] WHERE c/archetype_details/template_id='Symptom' and e/ehr_id/value matches { patientList.ToAQLMatchString() }"));
 }
Exemplo n.º 15
0
 public static AQLQuery PatientSymptom_VS(PatientListParameter patientList)
 {
     return(new AQLQuery("PatientSymptom_VS", $"SELECT e/ehr_id/value as PatientenID, a/data[at0190]/events[at0191]/data[at0192]/items[at0001]/value/value as NameDesSymptoms, a/data[at0190]/events[at0191]/data[at0192/items[at0151]/value/value as Lokalisation, a/ data[at0190]/events[at0191]/data[at0192]/items[at0152]/value/value as Beginn, a/ data[at0190]/events[at0191]/data[at0192]/items[at0021]/value/value as Schweregrad, a/ data[at0190]/events[at0191]/data[at0192]/items[at0161] as Rueckgang FROM EHR e CONTAINS COMPOSITION c CONTAINS OBSERVATION a[openEHR-EHR-OBSERVATION.symptom_sign.v0] WHERE c/archetype_details/template_id='Symptom' and e/ehr_id/value matches { patientList.ToAQLMatchString() }"));
 }
Exemplo n.º 16
0
 public static AQLQuery CasesWithResults(PatientListParameter patientList)
 {
     return(new AQLQuery("CasesWithResults", $"SELECT DISTINCT e/ehr_id/value as PatientID, m/items[at0001]/value/value AS FallID, c/uid/value as UID FROM EHR e CONTAINS COMPOSITION c CONTAINS CLUSTER m[openEHR-EHR-CLUSTER.case_identification.v0] WHERE c/name/value = 'Mikrobiologischer Befund' AND e/ehr_id/value matches { patientList.ToAQLMatchString() } order by m/items[at0001]/value/value asc"));
 }
Exemplo n.º 17
0
 public List <PatientMovementModel> Patient_Bewegung_Ps(PatientListParameter parameter)
 {
     return(_patMoveFac.Process(parameter));
 }
Exemplo n.º 18
0
 public List <LabDataModel> Patient_Labordaten_Ps(PatientListParameter parameter)
 {
     return(_patLabFac.Process(parameter));
 }
Exemplo n.º 19
0
 public List <MibiLabDataModel> MibiLabData(PatientListParameter parameter)
 {
     return(_mibiLabFac.Process(parameter));
 }
Exemplo n.º 20
0
 public List <SymptomModel> Patient_Symptom_TTPs(PatientListParameter parameter)
 {
     return(_symptomFac.Process(parameter));
 }