public List <LabResult> FillLabResults(IEntryCollection entryCollection)
        {
            List <LabResult> labResult = new List <LabResult>();

            foreach (IEntry entryitem in entryCollection)
            {
                IOrganizer            entryOrganizer = entryitem.AsOrganizer;
                IComponent4Collection entryComponent = entryOrganizer.Component;
                LabResult             ptLabResult    = new LabResult();
                foreach (IComponent4 obserComponent in entryComponent)
                {
                    IObservation    entryObservation = obserComponent.AsObservation;
                    IReferenceRange referenceRange   = entryObservation.ReferenceRange.FirstOrDefault();
                    meterialCode = entryObservation.Code;
                    try{ valueCode = (IPQ)entryObservation.Value[0]; }catch (Exception) {}
                    ptLabResult.TestPerformed = meterialCode.DisplayName;
                    ptLabResult.ReportDate    = entryObservation.EffectiveTime == null ? null : new DateTime?(Convert.ToDateTime(entryObservation.EffectiveTime.AsDateTime));
                    ptLabResult.LonicCode     = meterialCode.Code;
                    ptLabResult.Units         = valueCode != null?valueCode.Unit.ToString() : string.Empty;

                    ptLabResult.TestResultn = valueCode != null?valueCode.Value.ToString():string.Empty;

                    ptLabResult.NormalFindings = referenceRange != null ? referenceRange.ObservationRange.Text != null ? referenceRange.ObservationRange.Text.Text : null : null;
                }
                labResult.Add(ptLabResult);
            }

            return(labResult);
        }
示例#2
0
        public void GenerateVitalSignsEntryEmpty(III hl7III, Factory hl7Factory)
        {
            IEntry entry = functionalStatus.Section.Entry.Append();

            entry.TypeCode = x_ActRelationshipEntry.DRIV;
            entry.AsOrganizer.ClassCode = x_ActClassDocumentEntryOrganizer.CLUSTER;
            entry.AsOrganizer.MoodCode  = "EVN";
            hl7III = entry.AsOrganizer.TemplateId.Append();
            hl7III.Init("2.16.840.1.113883.10.20.22.4.26");
            hl7III                                = entry.AsOrganizer.Id.Append();
            hl7III.NullFlavor                     = "UNK";
            entry.AsOrganizer.Code.Code           = "46680005";
            entry.AsOrganizer.Code.CodeSystem     = "2.16.840.1.113883.6.96";
            entry.AsOrganizer.Code.CodeSystemName = "SNOMED CT";
            entry.AsOrganizer.Code.DisplayName    = "Vital signs";
            entry.AsOrganizer.StatusCode.Init("completed");

            entry.AsOrganizer.EffectiveTime.Init(DateTime.Now);

            IComponent4 component = entry.AsOrganizer.Component.Append();

            // Height Component
            component.AsObservation.ClassCode = "OBS";
            component.AsObservation.MoodCode  = x_ActMoodDocumentObservation.EVN;
            hl7III = component.AsObservation.TemplateId.Append();
            hl7III.Init("2.16.840.1.113883.10.20.22.4.27");
            hl7III            = component.AsObservation.Id.Append();
            hl7III.NullFlavor = "UNK";
            component.AsObservation.Code.NullFlavor           = "UNK";
            component.AsObservation.Text.Reference.NullFlavor = "UNK";
            component.AsObservation.StatusCode.Init("completed");
            component.AsObservation.EffectiveTime.NullFlavor = "NA";
            IPQ PQ = hl7Factory.CreatePQ();

            PQ.NullFlavor = "UNK";
            component.AsObservation.Value.Add(PQ);
            ICE CE = hl7Factory.CreateCE();

            CE.NullFlavor = "UNK";
            component.AsObservation.InterpretationCode.Add(CE);
            IReferenceRange refRange = hl7Factory.CreateReferenceRange();

            refRange.ObservationRange.Text.Text = "";
            component.AsObservation.ReferenceRange.Add(refRange);
        }