コード例 #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);
        }
コード例 #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);
        }
コード例 #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");
 }
コード例 #4
0
 public virtual void ShouldFindUniqueTealBeanForHl7PartType()
 {
     Assert.IsTrue(Instantiator.GetInstance().InstantiateMessagePartBean(MockVersionNumber.MOCK_NEWFOUNDLAND, "MOCK_MT123456CA.SubType"
                                                                         , new Interaction()) is MockSubType, "instance of Sender");
 }
コード例 #5
0
 private static void InitializeInstance()
 {
     Ca.Infoway.Messagebuilder.Marshalling.Instantiator factory = new Ca.Infoway.Messagebuilder.Marshalling.Instantiator();
     instance = factory;
 }