예제 #1
0
        public override BareANY Parse(ParseContext context, XmlNode node, XmlToModelResult result)
        {
            BareANY            codedTypeAny = DoCreateR2DataTypeInstance(context);
            XmlElement         element      = (XmlElement)node;
            CodedTypeR2 <Code> codedType    = new CodedTypeR2 <Code>();

            // attributes
            HandleNullFlavor(element, codedTypeAny, context, result);
            HandleCodeAndCodeSystem(element, codedType, context, result);
            HandleCodeSystemName(element, codedType, context, result);
            HandleCodeSystemVersion(element, codedType, context, result);
            HandleDisplayName(element, codedType, context, result);
            HandleValue(element, codedType, context, result);
            HandleQty(element, codedType, context, result);
            HandleOperator(element, codedTypeAny, codedType, context, result);
            // elements
            HandleSimpleValue(element, codedType, context, result);
            HandleOriginalText(element, codedType, context, result);
            HandleQualifier(element, codedType, context, result);
            HandleTranslation(element, codedType, context, result);
            HandleValidTime(element, codedType, context, result);
            HandleConstraints(codedType, context.GetConstraints(), element, result);
            // want to return null if no attributes or elements are present
            if (codedType.IsEmpty())
            {
                codedType = null;
            }
            ((BareANYImpl)codedTypeAny).BareValue = CodedTypeR2Helper.ConvertCodedTypeR2(codedType, context.GetExpectedReturnType());
            return(codedTypeAny);
        }
예제 #2
0
 protected override BareANY DoCreateR2DataTypeInstance(ParseContext context)
 {
     if ("CO".Equals(context.Type))
     {
         return(CodedTypeR2Helper.CreateCOInstance(context.GetExpectedReturnType()));
     }
     return(CodedTypeR2Helper.CreateCVInstance(context.GetExpectedReturnType()));
 }
예제 #3
0
 protected override CodedTypeR2 <Code> ExtractBareValue(BareANY hl7Value)
 {
     return(hl7Value == null ? null : CodedTypeR2Helper.ConvertCodedTypeR2(hl7Value.BareValue));
 }
예제 #4
0
 private CollectionHelper HandleListTypes(string typeName, Type expectedReturnType)
 {
     if ("LIST<AD>".Equals(typeName))
     {
         return(new LISTImpl <AD, PostalAddress>(typeof(ADImpl)));
     }
     else
     {
         if ("LIST<GTS>".Equals(typeName))
         {
             return(new LISTImpl <GTS, GeneralTimingSpecification>(typeof(GTSImpl)));
         }
         else
         {
             if ("LIST<II>".Equals(typeName))
             {
                 return(new LISTImpl <II, Identifier>(typeof(IIImpl)));
             }
             else
             {
                 if ("LIST<PN>".Equals(typeName))
                 {
                     return(new LISTImpl <PN, PersonName>(typeof(PNImpl)));
                 }
                 else
                 {
                     if ("LIST<TEL>".Equals(typeName))
                     {
                         return(new LISTImpl <TEL, TelecommunicationAddress>(typeof(TELImpl)));
                     }
                     else
                     {
                         if ("LIST<ON>".Equals(typeName))
                         {
                             return(new LISTImpl <ON, OrganizationName>(typeof(ONImpl)));
                         }
                         else
                         {
                             if ("LIST<CD>".Equals(typeName))
                             {
                                 return(CodedTypeR2Helper.CreateCDList(expectedReturnType));
                             }
                             else
                             {
                                 if ("LIST<CS>".Equals(typeName))
                                 {
                                     return(CodedTypeR2Helper.CreateCSList(expectedReturnType));
                                 }
                                 else
                                 {
                                     if ("LIST<CE>".Equals(typeName))
                                     {
                                         return(CodedTypeR2Helper.CreateCEList(expectedReturnType));
                                     }
                                     else
                                     {
                                         if ("LIST<SXCM<TS>>".Equals(typeName))
                                         {
                                             return(GenericClassUtil.CreateSXCMR2List());
                                         }
                                         else
                                         {
                                             if ("LIST<ANY>".Equals(typeName))
                                             {
                                                 return(new LISTImpl <ANY <object>, object>(typeof(ANYImpl <object>)));
                                             }
                                             else
                                             {
                                                 if ("LIST<INT>".Equals(typeName))
                                                 {
                                                     return(new LISTImpl <INT, Int32?>(typeof(INTImpl)));
                                                 }
                                                 else
                                                 {
                                                     if ("LIST<PQ>".Equals(typeName))
                                                     {
                                                         return(new LISTImpl <PQ, PhysicalQuantity>(typeof(PQImpl)));
                                                     }
                                                     else
                                                     {
                                                         if ("LIST<ST>".Equals(typeName))
                                                         {
                                                             return(new LISTImpl <ST, string>(typeof(STImpl)));
                                                         }
                                                         else
                                                         {
                                                             if ("LIST<SXCMTSCDAR1>".Equals(typeName))
                                                             {
                                                                 return(new LISTImpl <SXCMTSCDAR1, MbDate>(typeof(SXCMTSCDAR1Impl)));
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     return(null);
 }
예제 #5
0
 protected override BareANY DoCreateR2DataTypeInstance(ParseContext context)
 {
     return(CodedTypeR2Helper.CreateSXCMInstance(context.GetExpectedReturnType()));
 }