コード例 #1
0
ファイル: TestMiacClient.cs プロジェクト: nbIxMaN/EMKT
 private List<EMKServise.MedRecord> ConvertMedRecords(MedRecord[] c)
 {
     if (((object)c != null) && (c.Length != 0))
     {
         List<EMKServise.MedRecord> lmr = new List<EMKServise.MedRecord>();
         foreach (object i in c)
         {
             Service ser = i as Service;
             if (ser != null)
             {
                 EMKServise.Service eser = new EMKServise.Service();
                 if (ser.DateEnd != DateTime.MinValue)
                     eser.DateEnd = ser.DateEnd;
                 if (ser.DateStart != DateTime.MinValue)
                     eser.DateStart = ser.DateStart;
                 if (ser.IdServiceType != "")
                     eser.IdServiceType = ser.IdServiceType;
                 eser.PaymentInfo = ConvertPaymentInfo(ser.PaymentInfo);
                 eser.Performer = ConvertParticipant(ser.Performer);
                 if (ser.ServiceName != "")
                     eser.ServiceName = ser.ServiceName;
                 lmr.Add(eser);
             }
             TfomsInfo tfi = i as TfomsInfo;
             if (tfi != null)
             {
                 EMKServise.TfomsInfo etfi = new EMKServise.TfomsInfo();
                 etfi.Count = tfi.Count;
                 etfi.IdTfomsType = tfi.IdTfomsType;
                 etfi.Tariff = tfi.Tariff;
                 lmr.Add(etfi);
             }
             AppointedMedication ap = i as AppointedMedication;
             if (ap != null)
             {
                 EMKServise.AppointedMedication eap = new EMKServise.AppointedMedication();
                 if (ap.AnatomicTherapeuticChemicalClassification != "")
                     eap.AnatomicTherapeuticChemicalClassification = ap.AnatomicTherapeuticChemicalClassification;
                 eap.CourseDose = ConvertQuantity(ap.CourseDose);
                 eap.DayDose = ConvertQuantity(ap.DayDose);
                 eap.DaysCount = ap.DaysCount;
                 eap.Doctor = ConvertMedicalStaff(ap.Doctor);
                 if (ap.IssuedDate != DateTime.MinValue)
                     eap.IssuedDate = ap.IssuedDate;
                 if (ap.MedicineIssueType != "")
                     eap.MedicineIssueType = ap.MedicineIssueType;
                 if (ap.MedicineName != "")
                     eap.MedicineName = ap.MedicineName;
                 eap.MedicineType = ap.MedicineType;
                 eap.MedicineUseWay = ap.MedicineUseWay;
                 if (ap.Number != "")
                     eap.Number = ap.Number;
                 eap.OneTimeDose = ConvertQuantity(ap.OneTimeDose);
                 if (ap.Seria != "")
                     eap.Seria = ap.Seria;
                 lmr.Add(eap);
             }
             DeathInfo di = i as DeathInfo;
             if (di != null)
             {
                 EMKServise.DeathInfo edi = new EMKServise.DeathInfo();
                 if (di.MkbCode != "")
                     edi.MkbCode = di.MkbCode;
                 lmr.Add(edi);
             }
             ClinicMainDiagnosis cmd = i as ClinicMainDiagnosis;
             if ((cmd != null) && (cmd.DiagnosisInfo.IdDiagnosisType == TestDiagnosis.IdClinicMainDiagnosis))
             {
                 EMKServise.ClinicMainDiagnosis ecmd = new EMKServise.ClinicMainDiagnosis();
                 ecmd.Complications = ConvertDiagnosis(cmd.Complications);
                 ecmd.DiagnosisInfo = ConvertDiagnosisInfo(cmd.DiagnosisInfo);
                 ecmd.Doctor = ConvertMedicalStaff(cmd.Doctor);
                 lmr.Add(ecmd);
             }
             if (cmd == null)
             {
                 Diagnosis diag = i as Diagnosis;
                 if ((diag != null) && (diag.DiagnosisInfo.IdDiagnosisType == TestDiagnosis.IdClinicMainDiagnosis))
                 {
                     EMKServise.ClinicMainDiagnosis ecmd = new EMKServise.ClinicMainDiagnosis();
                     ecmd.DiagnosisInfo = ConvertDiagnosisInfo(diag.DiagnosisInfo);
                     ecmd.Doctor = ConvertMedicalStaff(diag.Doctor);
                     lmr.Add(ecmd);
                 }
                 if ((diag != null) && (diag.DiagnosisInfo.IdDiagnosisType != TestDiagnosis.IdClinicMainDiagnosis))
                 {
                     EMKServise.Diagnosis ecmd = new EMKServise.Diagnosis();
                     ecmd.DiagnosisInfo = ConvertDiagnosisInfo(diag.DiagnosisInfo);
                     ecmd.Doctor = ConvertMedicalStaff(diag.Doctor);
                     lmr.Add(ecmd);
                 }
             }
             Referral r = i as Referral;
             if (r != null)
             {
                 EMKServise.Referral er = new EMKServise.Referral();
                 er.Attachment = ConvertAttachment(r.Attachment);
                 er.Author = ConvertMedicalStaff(r.Author);
                 if (r.CreationDate != DateTime.MinValue)
                     er.CreationDate = r.CreationDate;
                 er.DepartmentHead = ConvertMedicalStaff(r.DepartmentHead);
                 if (r.Header != "")
                     er.Header = r.Header;
                 if (r.IdSourceLpu != "")
                     er.IdSourceLpu = r.IdSourceLpu;
                 if (r.IdTargetLpu != "")
                     er.IdTargetLpu = r.IdTargetLpu;
                 if (r.ReferralID != "")
                     er.ReferralID = r.ReferralID;
                 er.ReferralInfo = ConvertReferralInfo(r.ReferralInfo);
                 if (r.RelatedID != "")
                     er.RelatedID = r.RelatedID;
                 lmr.Add(er);
             }
             SickList sl = i as SickList;
             if (sl != null)
             {
                 EMKServise.SickList esl = new EMKServise.SickList();
                 esl.Attachment = ConvertAttachment(sl.Attachment);
                 esl.Author = ConvertMedicalStaff(sl.Author);
                 if (sl.CreationDate != DateTime.MinValue)
                     esl.CreationDate = sl.CreationDate;
                 if (sl.Header != "")
                     esl.Header = sl.Header;
                 esl.SickListInfo = ConvertSickListInfo(sl.SickListInfo);
                 lmr.Add(esl);
             }
             DischargeSummary ds = i as DischargeSummary;
             if (ds != null)
             {
                 EMKServise.DischargeSummary eds = new EMKServise.DischargeSummary();
                 eds.Attachment = ConvertAttachment(ds.Attachment);
                 eds.Author = ConvertMedicalStaff(ds.Author);
                 if (ds.CreationDate != DateTime.MinValue)
                     eds.CreationDate = ds.CreationDate;
                 if (ds.Header != "")
                     eds.Header = ds.Header;
                 lmr.Add(eds);
             }
             LaboratoryReport lr = i as LaboratoryReport;
             if (lr != null)
             {
                 EMKServise.LaboratoryReport elr = new EMKServise.LaboratoryReport();
                 elr.Attachment = ConvertAttachment(lr.Attachment);
                 elr.Author = ConvertMedicalStaff(lr.Author);
                 if (lr.CreationDate != DateTime.MinValue)
                     elr.CreationDate = lr.CreationDate;
                 if (lr.Header != "")
                     elr.Header = lr.Header;
                 lmr.Add(elr);
             }
             ConsultNote cn = i as ConsultNote;
             if (cn != null)
             {
                 EMKServise.ConsultNote ecn = new EMKServise.ConsultNote();
                 ecn.Attachment = ConvertAttachment(cn.Attachment);
                 ecn.Author = ConvertMedicalStaff(cn.Author);
                 if (cn.CreationDate != DateTime.MinValue)
                     ecn.CreationDate = cn.CreationDate;
                 if (cn.Header != "")
                     ecn.Header = cn.Header;
                 lmr.Add(ecn);
             }
             DispensaryOne d1 = i as DispensaryOne;
             if (d1 != null)
             {
                 EMKServise.DispensaryOne ed1 = new EMKServise.DispensaryOne();
                 ed1.Attachment = ConvertAttachment(d1.Attachment);
                 ed1.Author = ConvertMedicalStaff(d1.Author);
                 if (d1.CreationDate != DateTime.MinValue)
                     ed1.CreationDate = d1.CreationDate;
                 if (d1.Header != "")
                     ed1.Header = d1.Header;
                 ed1.HasExpertCareRefferal = d1.HasExpertCareRefferal;
                 ed1.HasExtraResearchRefferal = d1.HasExtraResearchRefferal;
                 ed1.HasHealthResortRefferal = d1.HasHealthResortRefferal;
                 ed1.HasPrescribeCure = d1.HasPrescribeCure;
                 ed1.HasSecondStageRefferal = d1.HasSecondStageRefferal;
                 ed1.HealthGroup = ConvertHealthGroup(d1.HealthGroup);
                 ed1.IsGuested = d1.IsGuested;
                 ed1.IsUnderObservation = d1.IsUnderObservation;
                 ed1.Recommendations = ConvertRecommendation(d1.Recommendations);
                 lmr.Add(ed1);
             }
         }
         return lmr;
     }
     else
         return null;
 }
コード例 #2
0
ファイル: TestMiacClient.cs プロジェクト: nbIxMaN/EMKT
 private List <EMKServise.MedRecord> ConvertMedRecords(MedRecord[] c)
 {
     if (((object)c != null) && (c.Length != 0))
     {
         List <EMKServise.MedRecord> lmr = new List <EMKServise.MedRecord>();
         foreach (object i in c)
         {
             Service ser = i as Service;
             if (ser != null)
             {
                 EMKServise.Service eser = new EMKServise.Service();
                 if (ser.DateEnd != DateTime.MinValue)
                 {
                     eser.DateEnd = ser.DateEnd;
                 }
                 if (ser.DateStart != DateTime.MinValue)
                 {
                     eser.DateStart = ser.DateStart;
                 }
                 if (ser.IdServiceType != "")
                 {
                     eser.IdServiceType = ser.IdServiceType;
                 }
                 eser.PaymentInfo = ConvertPaymentInfo(ser.PaymentInfo);
                 eser.Performer   = ConvertParticipant(ser.Performer);
                 if (ser.ServiceName != "")
                 {
                     eser.ServiceName = ser.ServiceName;
                 }
                 lmr.Add(eser);
             }
             TfomsInfo tfi = i as TfomsInfo;
             if (tfi != null)
             {
                 EMKServise.TfomsInfo etfi = new EMKServise.TfomsInfo();
                 etfi.Count       = tfi.Count;
                 etfi.IdTfomsType = tfi.IdTfomsType;
                 etfi.Tariff      = tfi.Tariff;
                 lmr.Add(etfi);
             }
             AppointedMedication ap = i as AppointedMedication;
             if (ap != null)
             {
                 EMKServise.AppointedMedication eap = new EMKServise.AppointedMedication();
                 if (ap.AnatomicTherapeuticChemicalClassification != "")
                 {
                     eap.AnatomicTherapeuticChemicalClassification = ap.AnatomicTherapeuticChemicalClassification;
                 }
                 eap.CourseDose = ConvertQuantity(ap.CourseDose);
                 eap.DayDose    = ConvertQuantity(ap.DayDose);
                 eap.DaysCount  = ap.DaysCount;
                 eap.Doctor     = ConvertMedicalStaff(ap.Doctor);
                 if (ap.IssuedDate != DateTime.MinValue)
                 {
                     eap.IssuedDate = ap.IssuedDate;
                 }
                 if (ap.MedicineIssueType != "")
                 {
                     eap.MedicineIssueType = ap.MedicineIssueType;
                 }
                 if (ap.MedicineName != "")
                 {
                     eap.MedicineName = ap.MedicineName;
                 }
                 eap.MedicineType   = ap.MedicineType;
                 eap.MedicineUseWay = ap.MedicineUseWay;
                 if (ap.Number != "")
                 {
                     eap.Number = ap.Number;
                 }
                 eap.OneTimeDose = ConvertQuantity(ap.OneTimeDose);
                 if (ap.Seria != "")
                 {
                     eap.Seria = ap.Seria;
                 }
                 lmr.Add(eap);
             }
             DeathInfo di = i as DeathInfo;
             if (di != null)
             {
                 EMKServise.DeathInfo edi = new EMKServise.DeathInfo();
                 if (di.MkbCode != "")
                 {
                     edi.MkbCode = di.MkbCode;
                 }
                 lmr.Add(edi);
             }
             ClinicMainDiagnosis cmd = i as ClinicMainDiagnosis;
             if ((cmd != null) && (cmd.DiagnosisInfo.IdDiagnosisType == TestDiagnosis.IdClinicMainDiagnosis))
             {
                 EMKServise.ClinicMainDiagnosis ecmd = new EMKServise.ClinicMainDiagnosis();
                 ecmd.Complications = ConvertDiagnosis(cmd.Complications);
                 ecmd.DiagnosisInfo = ConvertDiagnosisInfo(cmd.DiagnosisInfo);
                 ecmd.Doctor        = ConvertMedicalStaff(cmd.Doctor);
                 lmr.Add(ecmd);
             }
             if (cmd == null)
             {
                 Diagnosis diag = i as Diagnosis;
                 if ((diag != null) && (diag.DiagnosisInfo.IdDiagnosisType == TestDiagnosis.IdClinicMainDiagnosis))
                 {
                     EMKServise.ClinicMainDiagnosis ecmd = new EMKServise.ClinicMainDiagnosis();
                     ecmd.DiagnosisInfo = ConvertDiagnosisInfo(diag.DiagnosisInfo);
                     ecmd.Doctor        = ConvertMedicalStaff(diag.Doctor);
                     lmr.Add(ecmd);
                 }
                 if ((diag != null) && (diag.DiagnosisInfo.IdDiagnosisType != TestDiagnosis.IdClinicMainDiagnosis))
                 {
                     EMKServise.Diagnosis ecmd = new EMKServise.Diagnosis();
                     ecmd.DiagnosisInfo = ConvertDiagnosisInfo(diag.DiagnosisInfo);
                     ecmd.Doctor        = ConvertMedicalStaff(diag.Doctor);
                     lmr.Add(ecmd);
                 }
             }
             Referral r = i as Referral;
             if (r != null)
             {
                 EMKServise.Referral er = new EMKServise.Referral();
                 er.Attachment = ConvertAttachment(r.Attachment);
                 er.Author     = ConvertMedicalStaff(r.Author);
                 if (r.CreationDate != DateTime.MinValue)
                 {
                     er.CreationDate = r.CreationDate;
                 }
                 er.DepartmentHead = ConvertMedicalStaff(r.DepartmentHead);
                 if (r.Header != "")
                 {
                     er.Header = r.Header;
                 }
                 if (r.IdSourceLpu != "")
                 {
                     er.IdSourceLpu = r.IdSourceLpu;
                 }
                 if (r.IdTargetLpu != "")
                 {
                     er.IdTargetLpu = r.IdTargetLpu;
                 }
                 if (r.ReferralID != "")
                 {
                     er.ReferralID = r.ReferralID;
                 }
                 er.ReferralInfo = ConvertReferralInfo(r.ReferralInfo);
                 if (r.RelatedID != "")
                 {
                     er.RelatedID = r.RelatedID;
                 }
                 lmr.Add(er);
             }
             SickList sl = i as SickList;
             if (sl != null)
             {
                 EMKServise.SickList esl = new EMKServise.SickList();
                 esl.Attachment = ConvertAttachment(sl.Attachment);
                 esl.Author     = ConvertMedicalStaff(sl.Author);
                 if (sl.CreationDate != DateTime.MinValue)
                 {
                     esl.CreationDate = sl.CreationDate;
                 }
                 if (sl.Header != "")
                 {
                     esl.Header = sl.Header;
                 }
                 esl.SickListInfo = ConvertSickListInfo(sl.SickListInfo);
                 lmr.Add(esl);
             }
             DischargeSummary ds = i as DischargeSummary;
             if (ds != null)
             {
                 EMKServise.DischargeSummary eds = new EMKServise.DischargeSummary();
                 eds.Attachment = ConvertAttachment(ds.Attachment);
                 eds.Author     = ConvertMedicalStaff(ds.Author);
                 if (ds.CreationDate != DateTime.MinValue)
                 {
                     eds.CreationDate = ds.CreationDate;
                 }
                 if (ds.Header != "")
                 {
                     eds.Header = ds.Header;
                 }
                 lmr.Add(eds);
             }
             LaboratoryReport lr = i as LaboratoryReport;
             if (lr != null)
             {
                 EMKServise.LaboratoryReport elr = new EMKServise.LaboratoryReport();
                 elr.Attachment = ConvertAttachment(lr.Attachment);
                 elr.Author     = ConvertMedicalStaff(lr.Author);
                 if (lr.CreationDate != DateTime.MinValue)
                 {
                     elr.CreationDate = lr.CreationDate;
                 }
                 if (lr.Header != "")
                 {
                     elr.Header = lr.Header;
                 }
                 lmr.Add(elr);
             }
             ConsultNote cn = i as ConsultNote;
             if (cn != null)
             {
                 EMKServise.ConsultNote ecn = new EMKServise.ConsultNote();
                 ecn.Attachment = ConvertAttachment(cn.Attachment);
                 ecn.Author     = ConvertMedicalStaff(cn.Author);
                 if (cn.CreationDate != DateTime.MinValue)
                 {
                     ecn.CreationDate = cn.CreationDate;
                 }
                 if (cn.Header != "")
                 {
                     ecn.Header = cn.Header;
                 }
                 lmr.Add(ecn);
             }
             DispensaryOne d1 = i as DispensaryOne;
             if (d1 != null)
             {
                 EMKServise.DispensaryOne ed1 = new EMKServise.DispensaryOne();
                 ed1.Attachment = ConvertAttachment(d1.Attachment);
                 ed1.Author     = ConvertMedicalStaff(d1.Author);
                 if (d1.CreationDate != DateTime.MinValue)
                 {
                     ed1.CreationDate = d1.CreationDate;
                 }
                 if (d1.Header != "")
                 {
                     ed1.Header = d1.Header;
                 }
                 ed1.HasExpertCareRefferal    = d1.HasExpertCareRefferal;
                 ed1.HasExtraResearchRefferal = d1.HasExtraResearchRefferal;
                 ed1.HasHealthResortRefferal  = d1.HasHealthResortRefferal;
                 ed1.HasPrescribeCure         = d1.HasPrescribeCure;
                 ed1.HasSecondStageRefferal   = d1.HasSecondStageRefferal;
                 ed1.HealthGroup        = ConvertHealthGroup(d1.HealthGroup);
                 ed1.IsGuested          = d1.IsGuested;
                 ed1.IsUnderObservation = d1.IsUnderObservation;
                 ed1.Recommendations    = ConvertRecommendation(d1.Recommendations);
                 lmr.Add(ed1);
             }
         }
         return(lmr);
     }
     else
     {
         return(null);
     }
 }