Beispiel #1
0
        internal MeasureMap(StructureMessage message)
        {
            Map(o => TempConceptRef.Create(o.Concept)).ToAttributeGroup("conceptRef")
            .Set(v => _measure = Create(message.GetConcept(v.ID, v.AgencyID, v.Version)))
            .GroupTypeMap(new TempConceptRefMap());

            Map(o => TempCodelistRef.Create(o.CodeList)).ToAttributeGroup("codelist")
            .Set(v => _measure.CodeList = message.GetCodeList(v.ID, v.AgencyID, v.Version))
            .GroupTypeMap(new TempCodelistRefMap());

            Map(o => o.TextFormat).ToElement("TextFormat", false)
            .Set(v => _measure.TextFormat = v)
            .ClassMap(() => new TextFormatMap());
        }
Beispiel #2
0
        public ComponentMap(StructureMessage message)
        {
            Map(o => ConceptRef.Create(o.Concept)).ToAttributeGroup("conceptRef")
            .Set(v => _component = Create(GetConcept(message, v)))
            .GroupTypeMap(new ConceptRefMap());

            Map(o => TempCodelistRef.Create(o.CodeList)).ToAttributeGroup("codelist")
            .Set(v => _component.CodeList = GetCodeList(message, v))
            .GroupTypeMap(new TempCodelistRefMap());

            Map(o => GetTextFormat(o)).ToElement("TextFormat", false)
            .Set(v => SetTextFormat(v))
            .ClassMap(() => new TextFormatMap());
        }
Beispiel #3
0
        public static TempCodelistRef Create(CodeList codelist)
        {
            if (codelist == null)
            {
                return(null);
            }
            else
            {
                var codelistRef = new TempCodelistRef();
                codelistRef.Id       = codelist.Id;
                codelistRef.Version  = codelist.Version;
                codelistRef.AgencyId = codelist.AgencyId;

                return(codelistRef);
            }
        }
Beispiel #4
0
        public CompoenentMap(StructureMessage message)
        {
            Map(o => TempConceptRef.Create(o.Concept)).ToAttributeGroup("conceptRef")
            .Set(v => _component = Create(message.GetConcept(v.ID, v.AgencyID, v.Version)))
            .GroupTypeMap(new TempConceptRefMap());

            Map(o => TempCodelistRef.Create(o.CodeList)).ToAttributeGroup("codelist")
            .Set(v => _component.CodeList = message.GetCodeList(v.ID, v.AgencyID, v.Version))
            .GroupTypeMap(new TempCodelistRefMap());

            Map(o => o.CrossSectionalAttachmentLevel).ToAttributeGroup("crossSectionalAttachmentLevel", CrossSectionalAttachmentLevel.None)
            .Set(v => _component.CrossSectionalAttachmentLevel = v)
            .GroupTypeMap(new CrossSectionalAttachmentLevelMap());

            Map(o => o.TextFormat).ToElement("TextFormat", false)
            .Set(v => _component.TextFormat = v)
            .ClassMap(() => new TextFormatMap());
        }
Beispiel #5
0
        CodeList GetCodeList(StructureMessage message, TempCodelistRef v)
        {
            var codelist = message.FindCodeList(v.Id, v.AgencyId, v.Version);

            if (codelist == null || codelist.Count() == 0)
            {
                SignalError("Codelist not found: id='{0}',agencyId='{1}',version='{2}'. Codelists thar are referenced by a key family must exist in the same file of the key family.",
                            v.Id, v.AgencyId, v.Version);
                return(null);
            }

            if (codelist.Count() > 1)
            {
                SignalError("Duplicate codelist found: id='{0}',agencyId='{1}',version='{2}'. Codelists thar are referenced by a key family must exist in the same file of the key family.",
                            v.Id, v.AgencyId, v.Version);
                return(codelist.First());
            }

            return(codelist.Single());
        }