private static void ConvertQuestionnaireItemComponent(TargetModel.Questionnaire.ItemComponent to, SourceModel.Questionnaire.ItemComponent from, FhirConverter converter)
 {
     to.Initial = from.Initial == null ? to.Initial : new List <TargetModel.Questionnaire.InitialComponent> {
         ConvertElementToInitialComponent(from.Initial, converter)
     };
     to.AnswerValueSetElement = ConvertResourceReferenceToCanonical(from.Options, converter);
     to.AnswerOption          = from.Option == null ? to.AnswerOption : converter.ConvertList <TargetModel.Questionnaire.AnswerOptionComponent, SourceModel.Questionnaire.OptionComponent>(from.Option).ToList();
 }
Пример #2
0
 private static void ConvertMoney(TargetModel.Money to, SourceModel.Money from, FhirConverter converter)
 {
     if (from.Currency.HasValue)
     {
         to.System      = "urn:iso:std:iso:4217";
         to.CodeElement = new Code
         {
             Value     = from.Currency.Value.GetLiteral(),
             Extension = converter.ConvertList <Extension, Extension>(from.Extension).ToList()
         };
     }
 }
Пример #3
0
        private void ConvertStructureDefinition(TargetModel.StructureDefinition to, SourceModel.StructureDefinition from, FhirConverter converter)
        {
            to.FhirVersionElement = new Id("3.0.2")
            {
                Extension = converter.ConvertList <Extension, Extension>(from.FhirVersionElement?.Extension).ToList()
            };

            var contextTypeElement = from.Context?.FirstOrDefault()?.TypeElement;

            to.ContextTypeElement = converter.ConvertElement <Code <TargetModel.StructureDefinition.ExtensionContext>, Code <SourceModel.StructureDefinition.ExtensionContextType> >(contextTypeElement);
            to.ContextElement     = from.Context.Select(context =>
                                                        converter.ConvertElement <FhirString, FhirString>(context.ExpressionElement)
                                                        ).ToList();

            to.TypeElement = ConvertFhirUriToCode(from.TypeElement, converter);

            to.BaseDefinitionElement = ConvertCanonicalToFhirUri(from.BaseDefinitionElement, converter);
        }
        private static void ConvertStructureDefinition(TargetModel.StructureDefinition to, SourceModel.StructureDefinition from, FhirConverter converter)
        {
            // StructureDefinition.fhirVersion
            to.FhirVersionElement = new Code <TargetModel.FHIRVersion>(TargetModel.FHIRVersion.N4_0_0)
            {
                Extension = converter.ConvertList <Extension, Extension>(from.FhirVersionElement?.Extension).ToList()
            };

            // StructureDefinition.context
            to.Context = from.ContextElement.Select(contextElement =>
                                                    new TargetModel.StructureDefinition.ContextComponent
            {
                TypeElement       = converter.ConvertElement <Code <TargetModel.StructureDefinition.ExtensionContextType>, Code <SourceModel.StructureDefinition.ExtensionContext> >(from.ContextTypeElement),
                ExpressionElement = converter.ConvertElement <FhirString, FhirString>(contextElement)
            }
                                                    ).ToList();

            // StructureDefinition.type
            to.TypeElement = ConvertCodeToFhirUri(from.TypeElement, converter);

            // StructureDefinition.baseDefinition
            to.BaseDefinitionElement = ConvertFhirUriToCanonical(from.BaseDefinitionElement, converter);
        }
Пример #5
0
 private static void ConvertQuestionnaireItemComponent(TargetModel.Questionnaire.ItemComponent to, SourceModel.Questionnaire.ItemComponent from, FhirConverter converter)
 {
     to.Initial = converter.ConvertElement <DataType, DataType>(from.Initial.FirstOrDefault()?.Value);
     to.Options = ConvertCanonicalToResourceReference(from.AnswerValueSetElement, converter);
     to.Option  = from.AnswerOption == null ? to.Option : converter.ConvertList <TargetModel.Questionnaire.OptionComponent, SourceModel.Questionnaire.AnswerOptionComponent>(from.AnswerOption).ToList();
 }