コード例 #1
0
        private ConstrainedDatatype CreateConstraints(bool referenceMandatory)
        {
            //        <relationship name="reference" attribute="false" cardinality="1"/>
            //        <relationship name="reference.value" attribute="false" cardinality="1"/>
            //
            //        <relationship name="reference" attribute="false" cardinality="0-1"/>
            //        <relationship name="reference.value" attribute="false" cardinality="1"/>
            //
            //        <relationship name="mediaType" attribute="false" cardinality="1" fixedValue="application/dicom"/>
            //        <relationship name="reference" attribute="false" cardinality="1"/>
            ConstrainedDatatype constraints = new ConstrainedDatatype("MessagePart.relationshipName", "ED");

            constraints.SetRestriction();
            Relationship referenceConstraint = new Relationship("reference", null, Cardinality.Create(referenceMandatory ? "1" : "0-1"
                                                                                                      ));

            constraints.Relationships.Add(referenceConstraint);
            Relationship referenceValueConstraint = new Relationship("reference.value", null, Cardinality.Create("1"));

            constraints.Relationships.Add(referenceValueConstraint);
            Relationship mediaTypeConstraint = new Relationship("mediaType", null, Cardinality.Create("1"));

            mediaTypeConstraint.FixedValue = "application/dicom";
            constraints.Relationships.Add(mediaTypeConstraint);
            return(constraints);
        }
コード例 #2
0
        private ConstrainedDatatype CreateLowHighConstraints()
        {
            ConstrainedDatatype constraints = new ConstrainedDatatype("MessagePart.relationshipName", "IVL<TS>");

            constraints.SetRestriction();
            Relationship lowConstraint  = new Relationship("low", null, Cardinality.Create("1"));
            Relationship highConstraint = new Relationship("high", null, Cardinality.Create("1"));

            constraints.Relationships.Add(lowConstraint);
            constraints.Relationships.Add(highConstraint);
            return(constraints);
        }
コード例 #3
0
        private ConstrainedDatatype CreateConstraints(bool isTemplateId)
        {
            string name = (isTemplateId ? "MessagePart.templateId" : "MessagePart.relationshipName");
            ConstrainedDatatype constraints = new ConstrainedDatatype(name, "II");

            constraints.SetRestriction();
            Relationship rootConstraint = new Relationship("root", null, Cardinality.Create("1"));

            rootConstraint.FixedValue = "1.2.3.4";
            Relationship extensionConstraint = new Relationship("extension", null, Cardinality.Create("1"));

            extensionConstraint.FixedValue = "1234";
            constraints.Relationships.Add(rootConstraint);
            constraints.Relationships.Add(extensionConstraint);
            return(constraints);
        }
コード例 #4
0
        private ConstrainedDatatype CreateConstraints(bool qualifierMandatory)
        {
            //        <relationship name="qualifier" attribute="false" cardinality="0-1"/>
            //        <relationship name="qualifier" attribute="false" cardinality="1"/>
            //        <relationship name="qualifier.name" attribute="false" cardinality="1"/>
            //        <relationship name="qualifier.name.code" attribute="false" cardinality="1" fixedValue="121139"/>
            //        <relationship name="qualifier.name.codeSystem" attribute="false" cardinality="1" fixedValue="1.2.840.10008.2.16.4"/>
            //        <relationship name="qualifier.value" attribute="false" cardinality="1"/>
            //        <relationship name="qualifier.value.code" attribute="false" domainType="TargetSiteQualifiers" domainSource="VALUE_SET" cardinality="0-1"/>
            //        <relationship name="codeSystem" attribute="false" cardinality="1" fixedValue="1.2.840.10008.2.6.1"/>
            ConstrainedDatatype constraints = new ConstrainedDatatype("MessagePart.relationshipName", "CD");

            constraints.SetRestriction();
            Relationship qualifierConstraint = new Relationship("qualifier", null, Cardinality.Create(qualifierMandatory ? "1" : "0-1"
                                                                                                      ));
            Relationship qualifierNameConstraint     = new Relationship("qualifier.name", null, Cardinality.Create("1"));
            Relationship qualifierNameCodeConstraint = new Relationship("qualifier.name.code", null, Cardinality.Create("1"));

            qualifierNameCodeConstraint.FixedValue = "121139";
            Relationship qualifierNameCodeSystemConstraint = new Relationship("qualifier.name.codeSystem", null, Cardinality.Create("1"
                                                                                                                                    ));

            qualifierNameCodeSystemConstraint.FixedValue = "1.2.840.10008.2.16.4";
            Relationship qualifierValueConstraint     = new Relationship("qualifier.value", null, Cardinality.Create("1"));
            Relationship qualifierValueCodeConstraint = new Relationship("qualifier.value.code", null, Cardinality.Create("1"));
            Relationship codeSystemConstraint         = new Relationship("codeSystem", null, Cardinality.Create("1"));

            codeSystemConstraint.FixedValue = "1.2.840.10008.2.6.1";
            constraints.Relationships.Add(qualifierConstraint);
            constraints.Relationships.Add(qualifierNameConstraint);
            constraints.Relationships.Add(qualifierNameCodeConstraint);
            constraints.Relationships.Add(qualifierNameCodeSystemConstraint);
            constraints.Relationships.Add(qualifierValueConstraint);
            constraints.Relationships.Add(qualifierValueCodeConstraint);
            constraints.Relationships.Add(codeSystemConstraint);
            return(constraints);
        }