示例#1
0
        private static Observation MakeObservation(string section)
        {
            Observation o = new Observation();

            if (section == "ALLERGIES")
            {
                //It automatically adds class code
                o.MoodCode = new CS<x_ActMoodDocumentObservation>(x_ActMoodDocumentObservation.Eventoccurrence);
                o.TemplateId = new LIST<II>();
                o.TemplateId.Add(new II("2.16.840.1.113883.10.20.22.4.7"));
                o.Id = new SET<II>(new II(new Guid()));
                o.Code = new CD<string>(
                    "ASSERTION",
                    "2.16.840.1.113883.5.4",
                    null,
                    null,
                    null,
                    null);
                o.StatusCode = new CS<ActStatus>(ActStatus.Completed);
                o.EffectiveTime = new IVL<TS>(new TS());
                o.EffectiveTime.Low = new TS(DateTime.Now);
                o.EffectiveTime.Low.NullFlavor = new CS<NullFlavor>(NullFlavor.Unknown);

                o.Value = new CD<string>(
                    "416098002",
                    "2.16.840.1.113883.6.96",
                    "SNOMED CT",
                    null,
                    "drug allergy",
                    new ED(new TEL("#allergy1")));

                Participant2 participant2 = new Participant2();
                participant2.TypeCode = new CS<ParticipationType>(ParticipationType.Consumable);
                participant2.ParticipantRole = new ParticipantRole();
                participant2.ParticipantRole.ClassCode = new CS<string>("MANU");
                PlayingEntity pe = new PlayingEntity(null,
                    new CE<string>("70618", "2.16.840.1.113883.6.88", "RxNorm", null, "Penicillin", null),
                    null,
                    null,
                    null);
                pe.Code.OriginalText = new ED();
                pe.Code.OriginalText.Reference = new TEL("#allergy1");
                pe.ClassCode = new CS<EntityClassRoot>(new EntityClassRoot());

                participant2.ParticipantRole.SetPlayingEntityChoice(pe);
                o.Participant.Add(participant2);

                o.EntryRelationship = new List<EntryRelationship>();
                EntryRelationship er = new EntryRelationship();
                er.TypeCode = new CS<x_ActRelationshipEntryRelationship>(x_ActRelationshipEntryRelationship.MFST);
                er.InversionInd = new BL(true);

                Observation obs = new Observation();
                obs.MoodCode = new CS<x_ActMoodDocumentObservation>(x_ActMoodDocumentObservation.Eventoccurrence);
                obs.TemplateId = new LIST<II>();
                obs.TemplateId.Add(new II("2.16.840.1.113883.10.20.22.4.8"));
                obs.Code = new CD<string>("SEV", "2.16.840.1.113883.5.4", "ActCode", null, null, null);
                obs.Text = new ED();
                obs.Text.Reference = new TEL("#allergy1");
                obs.StatusCode = new CS<ActStatus>();
                obs.StatusCode.Code = new MARC.Everest.DataTypes.Primitives.CodeValue<ActStatus>(ActStatus.Completed);
                obs.Value = new CD<string>(
                    "6736007",
                    "2.16.840.1.113883.6.96",
                    "SNOMED CT",
                    null,
                    "moderate",
                    null);

                er.SetClinicalStatement(obs);
                o.EntryRelationship.Add(er);
            }

            if (section == "SOCIAL HISTORY")
            {
                //It automatically adds class code
                o.MoodCode = new CS<x_ActMoodDocumentObservation>(x_ActMoodDocumentObservation.Eventoccurrence);
                o.TemplateId = new LIST<II>();
                o.TemplateId.Add(new II("2.16.840.1.113883.10.20.22.4.78"));
                o.Id = new SET<II>(new II(new Guid()));
                o.Code = new CD<string>(
                    "ASSERTION",
                    "2.16.840.1.113883.5.4",
                    null,
                    null,
                    null,
                    null);
                o.StatusCode = new CS<ActStatus>(ActStatus.Completed);
                o.EffectiveTime = new IVL<TS>(new TS(DateTime.Now), new TS(DateTime.Now));

                o.Value = new CD<string>(
                    "8517006",
                    "2.16.840.1.113883.6.96",
                    "SNOMED CT",
                    null,
                    "former smoker",
                    null);
            }

            if (section == "PROBLEM LIST")
            {
                //It automatically adds class code
                o.MoodCode = new CS<x_ActMoodDocumentObservation>(x_ActMoodDocumentObservation.Eventoccurrence);
                o.TemplateId = new LIST<II>();
                o.TemplateId.Add(new II("2.16.840.1.113883.10.20.22.4.4"));
                o.Id = new SET<II>(new II(new Guid()));
                o.Code = new CD<string>(
                    "64572001",
                    "2.16.840.1.113883.6.96",
                    "SNOMED CT",
                    null,
                    "Condition",
                    null);
                o.Text = new ED();
                o.Text.Reference = new TEL("#problem1");
                o.StatusCode = new CS<ActStatus>(ActStatus.Completed);
                o.EffectiveTime = new IVL<TS>(new TS(DateTime.Now), null);

                o.Value = new CD<string>(
                    "5962100",
                    "2.16.840.1.113883.6.96",
                    "SNOMED CT",
                    null,
                    "Essential Hypertension",
                    null);
            }

            return o;
        }
示例#2
0
        private static EntryRelationship MakeEntryRelationship(string section)
        {
            EntryRelationship er = new EntryRelationship();
            er.TypeCode = new CS<x_ActRelationshipEntryRelationship>(x_ActRelationshipEntryRelationship.SUBJ);

            if (section == "ALLERGIES")
            {
                er.InversionInd = true;
                er.SetClinicalStatement(MakeObservation("ALLERGIES"));
            }

            if (section == "PROBLEM LIST")
            {
                er.SetClinicalStatement(MakeObservation("PROBLEM LIST"));
            }

            return er;
        }