Exemplo n.º 1
0
        /// <summary>
        /// Creates a CDA component for use with adding into documents
        /// </summary>
        /// <returns>A CDA component</returns>
        public virtual POCD_MT000040Component5 ToPocdComponent5()
        {
            POCD_MT000040Component5 returnVal = new POCD_MT000040Component5();

            returnVal.section = new POCD_MT000040Section();

            // *** Template ID ***
            returnVal.section.templateId = this.TemplateIds.ToPocd();

            // *** Make sure section has an unique ID ***
            returnVal.section.id = new II {
                root = Guid.NewGuid().ToString()
            };

            // *** Code ***
            returnVal.section.code = new CE()
            {
                code           = this.Code,
                displayName    = this.DisplayName,
                codeSystem     = this.CodeSystemId,
                codeSystemName = this.CodeSystemName
            };

            // *** Title ***
            returnVal.section.title = new ST()
            {
                Text = new string[] { this.SectionTitle }
            };

            // *** Then add the text ***
            returnVal.section.text = this.GetSectionText();

            return(returnVal);
        }
Exemplo n.º 2
0
        public override POCD_MT000040Component5 ToPocdComponent5()
        {
            POCD_MT000040Component5 returnVal = base.ToPocdComponent5();

            if (this.Observations.Count > 0)
            {
                List <POCD_MT000040Entry> entryList = new List <POCD_MT000040Entry>();

                foreach (var obs in this.Observations)
                {
                    // *** Create an entry ***
                    POCD_MT000040Entry newEntry = new POCD_MT000040Entry();

                    newEntry.Item = obs.ToPocd();

                    entryList.Add(newEntry);
                }

                returnVal.section.entry = entryList.ToArray();
            }

            return(returnVal);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Create the component to add to the document
        /// </summary>
        /// <returns></returns>
        public override POCD_MT000040Component5 ToPocdComponent5()
        {
            if (this.Observations.Count == 0)
            {
                this.Narrative = "(No Data)";
            }

            POCD_MT000040Component5 returnVal = base.ToPocdComponent5();

            // *** Check if we have entries ***
            if (this.Observations.Count > 0)
            {
                // *** And entries ***
                List <POCD_MT000040Entry> entryList = new List <POCD_MT000040Entry>();

                // *** Create an entry ***
                POCD_MT000040Entry newEntry = new POCD_MT000040Entry();

                // *** Create vital signs organizer ***
                POCD_MT000040Organizer organizer = new POCD_MT000040Organizer();

                // *** Set the organizer attributes ***
                organizer.classCode = x_ActClassDocumentEntryOrganizer.CLUSTER;
                organizer.moodCode  = "EVN";

                // *** Template Id's ***
                CdaTemplateIdList orgIds = new CdaTemplateIdList("2.16.840.1.113883.10.20.1.32", "2.16.840.1.113883.10.20.1.35", "1.3.6.1.4.1.19376.1.5.3.1.4.13.1");
                organizer.templateId = orgIds.ToPocd();

                // *** Vital Signs Organizer Code ***
                CdaCode orgCode = new CdaCode()
                {
                    Code = "46680005", CodeSystem = CodingSystem.SnomedCT, DisplayName = "Vital Signs"
                };
                organizer.code = orgCode.ToCD();

                // *** Organizer shall have id ***
                organizer.id = new II[] { new II()
                                          {
                                              root = Guid.NewGuid().ToString()
                                          } };

                organizer.statusCode = new CS()
                {
                    code = "completed"
                };

                // *** Note: Using first observation's date/time ***

                // *** Effective Time of observations ***
                organizer.effectiveTime = this.Observations[0].EffectiveTime.ToIvlTs();

                // *** Create a list of components for the observations ***
                List <POCD_MT000040Component4> componentList = new List <POCD_MT000040Component4>();

                foreach (var item in this.Observations)
                {
                    // *** Create a component ***
                    POCD_MT000040Component4 component = new POCD_MT000040Component4();

                    // *** Add observation to component ***
                    component.Item = item.ToPocd();

                    // *** Add component to list ***
                    componentList.Add(component);
                }

                // *** Add component array to organizer ***
                organizer.component = componentList.ToArray();

                // *** Add organizer to entry ***
                newEntry.Item = organizer;

                // *** Add entry to the list ***
                entryList.Add(newEntry);

                // *** Add entry list to section ***
                returnVal.section.entry = entryList.ToArray();
            }

            return(returnVal);
        }