Esempio n. 1
0
        private object GetOrCreateCollapsedBean(Hl7Source source, Relationship relationship)
        {
            BeanProperty property = FindBeanProperty(relationship);

            // TM - fix for bug 13100 - will property always be null?
            if (property == null)
            {
                property = GetPropertyForAssociation();
            }
            object collapsedBean = property.Get();

            if (collapsedBean == null)
            {
                Relationship collapsedRelationship = GetCollapsedRelationship(source, property.GetAnnotation <Hl7XmlMappingAttribute>());
                if (collapsedRelationship != null)
                {
                    Hl7PartSource collapsedPartSource = source.CreatePartSource(collapsedRelationship, source.GetCurrentElement());
                    collapsedBean = Instantiator.GetInstance().InstantiateMessagePartBean(collapsedPartSource.GetVersion(), collapsedPartSource
                                                                                          .Type, collapsedPartSource.GetInteraction());
                    property.Set(collapsedBean);
                }
                else
                {
                    this.log.Info(System.String.Format("UNABLE TO SET NULL FLAVOR - Can not find bean for collapsed property {0}.{1}", this.sorter
                                                       .GetBeanType().Name, this.contextName));
                }
            }
            return(collapsedBean);
        }
Esempio n. 2
0
        internal virtual object MapPartSourceToTeal(Hl7PartSource source, Relationship relationship)
        {
            object bean = Instantiator.GetInstance().InstantiateMessagePartBean(source.GetVersion(), source.Type, source.GetInteraction
                                                                                    ());
            BeanWrapper wrapper = new BeanWrapper(bean);

            MapToTeal(source, wrapper, relationship);
            return(bean);
        }
Esempio n. 3
0
 public virtual void ShouldFindTealBeanWhenPartTypeHasVersionSuffix()
 {
     Assert.IsTrue(Instantiator.GetInstance().InstantiateMessagePartBean(MockVersionNumber.MOCK_NEWFOUNDLAND, "MOCK_MT123456CA.SubType_V02R02"
                                                                         , new Interaction()) is MockSubType, "instance of Sender");
 }
Esempio n. 4
0
 public virtual void ShouldFindUniqueTealBeanForHl7PartType()
 {
     Assert.IsTrue(Instantiator.GetInstance().InstantiateMessagePartBean(MockVersionNumber.MOCK_NEWFOUNDLAND, "MOCK_MT123456CA.SubType"
                                                                         , new Interaction()) is MockSubType, "instance of Sender");
 }