Esempio n. 1
0
        private static MeningoPatient CreateMeningoPatient(Dictionary <string, object> source)
        {
            var patient = new MeningoPatient
            {
                PatientId = (int)source["patnr"],
                Initials  = source["initialen"].ToString(),
                BirthDate = source["geb_dat"] is DBNull
                    ? (DateTime?)null
                    : DateTime.Parse(source["geb_dat"].ToString()),
                Gender     = ConvertGender(source),
                PostalCode = source["plz"].ToString(),
                City       = source["wohnort"].ToString(),
                State      = source["bundeslandnr"] is DBNull
                    ? State.Unknown
                    : AccessStateToState[source["bundeslandnr"]]
            };

            if (string.IsNullOrEmpty(patient.PostalCode))
            {
                patient.PostalCode = "keine Angabe";
            }
            if (string.IsNullOrEmpty(patient.Initials))
            {
                patient.Initials = "?.?.";
            }
            return(patient);
        }
Esempio n. 2
0
        public MeningoPatient Convert(Dictionary <string, object> source, MeningoPatient destination,
                                      ResolutionContext context)
        {
            var patient = CreateMeningoPatient(source);

            QueryCounty(source, patient);
            PopulateClinicalInformation(source, patient);
            return(patient);
        }
Esempio n. 3
0
 private static void InitializeOrAmendOtherClinicalInformation(MeningoPatient patient)
 {
     if (!string.IsNullOrEmpty(patient.OtherClinicalInformation))
     {
         patient.OtherClinicalInformation += ", ";
     }
     else
     {
         patient.OtherClinicalInformation = "";
     }
 }
Esempio n. 4
0
        private void QueryCounty(Dictionary <string, object> source, MeningoPatient patient)
        {
            if (!QueryCountyEnabled)
            {
                return;
            }
            var json        = new GeonamesService().QueryByPostalCode(source["plz"].ToString());
            var jObject     = JObject.Parse(json);
            var postalCodes = jObject["postalcodes"];

            if (postalCodes.Any())
            {
                var city   = postalCodes[0]["placeName"];
                var county = postalCodes[0]["adminName3"];
                var state  = postalCodes[0]["adminCode1"];
                patient.County = county.ToString();
            }
        }
Esempio n. 5
0
        private static void PopulateClinicalInformation(Dictionary <string, object> source, MeningoPatient patient)
        {
            if (source["meningitis"].Equals(true))
            {
                patient.ClinicalInformation |= MeningoClinicalInformation.Meningitis;
            }

            if (source["sepsis"].Equals(true))
            {
                patient.ClinicalInformation |= MeningoClinicalInformation.Sepsis;
            }

            if (source["wfs"].Equals(true))
            {
                patient.ClinicalInformation |= MeningoClinicalInformation.WaterhouseFriderichsenSyndrome;
            }

            if (source["k_sympt"].Equals(true))
            {
                patient.ClinicalInformation |= MeningoClinicalInformation.NoSymptoms;
            }

            if (source["n_spez"].Equals(true))
            {
                patient.ClinicalInformation |= MeningoClinicalInformation.NotAvailable;
            }

            if (!(source["sonst_sympt"] is DBNull))
            {
                patient.ClinicalInformation     |= MeningoClinicalInformation.Other;
                patient.OtherClinicalInformation = source["sonst_sympt"].ToString();
            }

            if (!(source["and_inv_erkr"] is DBNull))
            {
                patient.ClinicalInformation |= MeningoClinicalInformation.Other;
                InitializeOrAmendOtherClinicalInformation(patient);
                patient.OtherClinicalInformation += source["and_inv_erkr"].ToString();
            }

            if (!(source["grunderkr"] is DBNull))
            {
                patient.ClinicalInformation |= MeningoClinicalInformation.Other;
                InitializeOrAmendOtherClinicalInformation(patient);
                patient.OtherClinicalInformation += source["grunderkr"].ToString();
            }
        }