Not Able to add IObservation Value.

Jan 24, 2014 at 9:43 AM
Hi All,

We are using this HL7Sdk for Creating CDA Document but we got stuck at one place where we need to add Value tag in IObservation. Please let us know how to create it. The blow XML we are trying to create:

<observation classCode="OBS" moodCode="EVN">
<!-- allergy observation template -->
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
    <id root="4adc1020-7b14-11db-9fe1-0800200c9a66"/>
    <code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
    <statusCode code="completed"/>
    <effectiveTime>
        <low value="20110215"/>
    </effectiveTime>
    <value xsi:type="CD" code="282100009" displayName="Adverse reaction to         
            substance" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED 
             CT">
            <originalText>
             <reference value="#reaction1"/>
            </originalText>
    </value>
    <participant typeCode="CSM">
          <participantRole classCode="MANU">
        <playingEntity classCode="MMAT">
             <code code="314422" displayName="ALLERGENIC EXTRACT, PENICILLIN" 
                         codeSystem="2.16.840.1.113883.6.88" codeSystemName="RxNorm">
        <originalText>
             <reference value="#reaction1"/>
        </originalText>
        </code
        <name>Penicillin</name>
        </playingEntity>
        </participantRole>
        </participant>
Thanks,
Shashwat
Coordinator
Jan 24, 2014 at 5:49 PM
Observation.value is actually a collection of ANY:
[TestMethod]
public void TestAddObservationValue()
{
    var obs = new Observation();
    var obsValueAsCD = new CD();
    obs.EffectiveTime = new IVL_TS().Init(low: new IVXB_TS() { Value = "20110215" } );
    obsValueAsCD.Code = "282100009";
    obsValueAsCD.CodeSystem = "2.16.840.1.113883.6.96";
    obsValueAsCD.CodeSystemName = "SNOMED CT";
    obsValueAsCD.OriginalText.Reference.Value = "#reaction1";
    obs.Value.Add(obsValueAsCD);
    TestContext.WriteLine("{0}", obs.Xml);
 }
Jan 27, 2014 at 6:43 AM
Hi dmitryab,

Thanks for Replying that's really helpful.

I am getting problem while creating the below XML(NAME Tag) :
<participant typeCode="CSM">
    <participantRole classCode="MANU">
    <playingEntity classCode="MMAT">
        <code code="2670" displayName="Codeine" codeSystem="2.16.840.1.113883.6.88" codeSystemName="RxNorm">
            <originalText>
            <reference value="#reaction3"/>
            </originalText>
        </code>
                    __<name>Aspirin</name>__
    </playingEntity>
</participantRole>
</participant>
Coordinator
Jan 27, 2014 at 8:30 AM
name is also a collection (in your case, of PN type):
            var p = new Participant2();
            p.TypeCode = "CSM";
            p.ParticipantRole.ClassCode = "MANU";
            var pe = p.ParticipantRole.AsPlayingEntity;
            pe.ClassCode = "MMAT";
            pe.Code.Code = "2670";
            pe.Code.DisplayName = "Codeine";
            pe.Code.CodeSystem = "2.16.840.1.113883.6.88";
            pe.Code.CodeSystemName = "RxNorm";
            pe.Name.Add(new PN() { Text = "Aspirin" });
Jan 29, 2014 at 8:45 AM
Hi dmitryab,

Thanks for Replying that's really helpful.

Just have a question like which date format i should use to add date in XML

Thanks,
Shashwat
Coordinator
Jan 29, 2014 at 12:30 PM
Just have a question like which date format i should use to add date in XML
Date/time formats are defined by the HL7 v3 datatypes specification. The TS class accepts both string values (with no validation) and DateTime.
        [TestMethod]
        public void TestDates()
        {
            var cd = new ClinicalDocument();
            cd.EffectiveTime = new TS() { Value = "2014" };
            TestContext.WriteLine("{0}", cd.Xml);
            cd.EffectiveTime = new TS() { Value = "201401" };
            TestContext.WriteLine("{0}", cd.Xml);
            cd.EffectiveTime.Value = "20140129";
            TestContext.WriteLine("{0}", cd.Xml);
            cd.EffectiveTime.AsDateTime = DateTime.Now;
            TestContext.WriteLine("{0}", cd.Xml);
        }
Jan 31, 2014 at 6:54 AM
Hi dmitryab,

I have a Question Regarding codeSystem and code attribute in tags.
<templateId root="2.16.840.1.113883.10.20.22.4.7"/>
<id root="4adc1020-7b14-11db-9fe1-0800200c9a66"/>
<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
<statusCode code="completed"/>
<effectiveTime>
     <low value="20110215"/>
</effectiveTime>
<value xsi:type="CD" __code__="282100009" displayName="Adverse reaction to substance" __codeSystem__="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT">
     <originalText>
         <reference value="#reaction2"/>
     </originalText>
</value>
I want to know values of these attributes (codeSystem/Code) , do we need to manually add these codes or DLL itself creates ?

Thanks,
Shashwat
Coordinator
Jan 31, 2014 at 7:36 AM
shashwatp wrote:
I want to know values of these attributes (codeSystem/Code) , do we need to manually add these codes or DLL itself creates ?
SNOMED CT codes (http://snomedbrowser.com). SNOMED CT is just a vocabulary of concepts as well as ICD-10, LOINC or RxNorm. Actually you can use whatever code system you want, but HL7 SDK knows absolutely nothing about code systems and does not perform code recognizing, resolving or validating.
Feb 6, 2014 at 6:55 AM
Hi dmitryab,

We are facing some problem while using HL7SDK DLL in our project as this DLL Required .Net 4.0 Framework but we are using 3.5 Framework. If we change to 4.0 then we are facing problems in other thirdparty DLL those only supports 3.5 Framework in our project. Please let us know how to proceed, if you can send us the 3.5 framework DLL of HL7SDK then that will be really helpful for us.

Thanks,
Shashwat
Coordinator
Feb 11, 2014 at 3:39 PM
Sorry for the late answer. The library is targeted to .NET 4 and I doubt that any "downgrade" is possible. You can try to connect .NET 4 and .NET 3.5 through COM interop but I've not tested that.