Esempio n. 1
0
        public string GetPersonIdFieldName()
        {
            if (Persons != null && Persons.Any())
            {
                return(Persons[0].PersonId);
            }

            if (PayerPlanPeriods != null && PayerPlanPeriods.Any())
            {
                return(PayerPlanPeriods[0].PersonId);
            }

            if (ConditionOccurrence != null && ConditionOccurrence.Any())
            {
                return(ConditionOccurrence[0].PersonId);
            }

            if (Death != null && Death.Any())
            {
                return(Death[0].PersonId);
            }

            if (DrugExposure != null && DrugExposure.Any())
            {
                return(DrugExposure[0].PersonId);
            }

            if (ProcedureOccurrence != null && ProcedureOccurrence.Any())
            {
                return(ProcedureOccurrence[0].PersonId);
            }

            if (Observation != null && Observation.Any())
            {
                return(Observation[0].PersonId);
            }

            if (Measurement != null && Measurement.Any())
            {
                return(Measurement[0].PersonId);
            }

            if (VisitOccurrence != null && VisitOccurrence.Any())
            {
                return(VisitOccurrence[0].PersonId);
            }

            if (Cohort != null && Cohort.Any())
            {
                return(Cohort[0].PersonId);
            }

            if (DeviceExposure != null && DeviceExposure.Any())
            {
                return(DeviceExposure[0].PersonId);
            }

            if (Note != null && Note.Any())
            {
                return(Note[0].PersonId);
            }

            throw new Exception("Cant find PersonId FieldName " + this.FileName);
        }