public MeningoSending Convert(Dictionary <string, object> source, MeningoSending destination, ResolutionContext context) { var sending = CreateMeningoSending(source); FillSamplingLocation(sending, source); return(sending); }
private void FillSamplingLocation(MeningoSending sending, Dictionary <string, object> source) { var materialNr = source["isol_mat_nr"]; sending.SamplingLocation = Mapper.Map <MeningoSamplingLocation>(materialNr); if (20.Equals(materialNr)) { sending.OtherInvasiveSamplingLocation = "nicht-steriles Mat. bei IMD"; } }
private static MeningoSending CreateMeningoSending(Dictionary <string, object> source) { var sending = new MeningoSending { MeningoSendingId = (int)source["dbnr"], MeningoPatientId = (int)source[$"{Program.PatientAccessTable}.patnr"], LaboratoryNumber = SanitizeLaboratoryNumber(source["labornr"].ToString()), Material = ConvertToMaterial(source["art"]), SenderLaboratoryNumber = source["nr_eins"].ToString(), ReceivingDate = String.IsNullOrEmpty(source["eing_dat"].ToString()) ? DateTime.MinValue : DateTime.Parse(source["eing_dat"].ToString()), SamplingDate = source["entn_dat"] is DBNull ? (DateTime?)null : DateTime.Parse(source["entn_dat"].ToString()), SerogroupSender = source["erg_eins"].ToString(), Remark = source[$"{Program.PatientAccessTable}.notizen"].ToString() }; if (string.IsNullOrEmpty(sending.SenderLaboratoryNumber)) { sending.SenderLaboratoryNumber = "keine Angabe"; } return(sending); }
public void Setup() { Sending = MockData.CreateInstance <MeningoSending>(); Sending.Isolate.EpsilometerTests.Clear(); Sending.Isolate.EpsilometerTests.Add(MockData.CreateInstance <EpsilometerTest>()); }