Example #1
0
File: SCV.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a SCV.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public SCV(Message message, string description)
     : base(message, description)
 {
     data = new Type[2];
     data[0] = new IS(message, 0,"Parameter class");
     data[1] = new ST(message,"Parameter value");
 }
Example #2
0
File: WVS.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a WVS.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public WVS(Message message, string description)
     : base(message, description)
 {
     data = new Type[2];
     data[0] = new ST(message,"Source name 1");
     data[1] = new ST(message,"Source name 2");
 }
Example #3
0
File: SRT.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a SRT.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public SRT(Message message, string description)
     : base(message, description)
 {
     data = new Type[2];
     data[0] = new ST(message,"Sort-by field");
     data[1] = new ID(message, 0,"Sequencing");
 }
Example #4
0
File: TS.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a TS.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public TS(Message message, string description)
     : base(message, description)
 {
     data = new Type[2];
     data[0] = new TSComponentOne(message,"Time of an event");
     data[1] = new ST(message,"Degree of precision");
 }
Example #5
0
File: WVI.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a WVI.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public WVI(Message message, string description)
     : base(message, description)
 {
     data = new Type[2];
     data[0] = new NM(message,"Channel Number");
     data[1] = new ST(message,"Channel Name");
 }
Example #6
0
 private void btnRender_Click(object sender, EventArgs e)
 {
     ST st = new ST();
     // Determine if null flavor should be attached to the object
     if (cbxNullFlavor.SelectedItem != null)
         switch (cbxNullFlavor.SelectedItem.ToString())
         {
             case "NAV":
                 st.NullFlavor = NullFlavor.Unavailable;
                 break;
             case "OTH":
                 st.NullFlavor = NullFlavor.Other;
                 break;
             case "NI":
                 st.NullFlavor = NullFlavor.NoInformation;
                 break;
             default:
                 st.NullFlavor = null;
                 break;
         }
     // Set the language
     if (txtLanguage.Text != String.Empty)
         st.Language = txtLanguage.Text;
     // Set the text
     st.Value = txtText.Text;
     // Represent in txtXml
     txtXml.Text = FormatterHelper.FormatDataType(st, "ST");
 }
Example #7
0
File: RI.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a RI.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public RI(Message message, string description)
     : base(message, description)
 {
     data = new Type[2];
     data[0] = new IS(message, 0,"Repeat pattern");
     data[1] = new ST(message,"Explicit time interval");
 }
Example #8
0
File: VR.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a VR.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public VR(Message message, string description)
     : base(message, description)
 {
     data = new Type[2];
     data[0] = new ST(message,"First data code value");
     data[1] = new ST(message,"Last data code calue");
 }
Example #9
0
File: QIP.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a QIP.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public QIP(Message message, string description)
     : base(message, description)
 {
     data = new Type[2];
     data[0] = new ST(message,"Segment field name");
     data[1] = new ST(message,"Value1&value2&value3");
 }
Example #10
0
File: AUI.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a AUI.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public AUI(Message message, string description)
     : base(message, description)
 {
     data = new Type[3];
     data[0] = new ST(message,"Authorization number");
     data[1] = new DT(message,"Date");
     data[2] = new ST(message,"Source");
 }
Example #11
0
File: PI.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a PI.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public PI(Message message, string description)
     : base(message, description)
 {
     data = new Type[3];
     data[0] = new ST(message,"ID number (ST)");
     data[1] = new IS(message, 0,"Type of ID number (IS)");
     data[2] = new ST(message,"Other qualifying info");
 }
Example #12
0
File: SAD.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a SAD.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public SAD(Message message, string description)
     : base(message, description)
 {
     data = new Type[3];
     data[0] = new ST(message,"Street or mailing address");
     data[1] = new ST(message,"Street name");
     data[2] = new ST(message,"Dwelling number");
 }
Example #13
0
File: DLN.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a DLN.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public DLN(Message message, string description)
     : base(message, description)
 {
     data = new Type[3];
     data[0] = new ST(message,"Driver´s License Number");
     data[1] = new IS(message, 0,"Issuing State, province, country");
     data[2] = new DT(message,"Expiration date");
 }
Example #14
0
File: HD.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a HD.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public HD(Message message, string description)
     : base(message, description)
 {
     data = new Type[3];
     data[0] = new IS(message, 300,"Namespace ID");
     data[1] = new ST(message,"Universal ID");
     data[2] = new ID(message, 301,"Universal ID type");
 }
Example #15
0
File: RCD.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a RCD.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public RCD(Message message, string description)
     : base(message, description)
 {
     data = new Type[3];
     data[0] = new ST(message,"Segment field name");
     data[1] = new ST(message,"HL7 date type");
     data[2] = new NM(message,"Maximum column width");
 }
Example #16
0
File: PRL.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a PRL.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public PRL(Message message, string description)
     : base(message, description)
 {
     data = new Type[3];
     data[0] = new CE(message,"OBX-3 observation identifier of parent result");
     data[1] = new ST(message,"OBX-4 sub-ID of parent result");
     data[2] = new TX(message,"Part of OBX-5 observation result from parent");
 }
Example #17
0
File: DLT.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a DLT.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public DLT(Message message, string description)
     : base(message, description)
 {
     data = new Type[4];
     data[0] = new NR(message,"Range");
     data[1] = new NM(message,"Numeric threshold");
     data[2] = new ST(message,"Change computation");
     data[3] = new NM(message,"Length of time-days");
 }
Example #18
0
File: RP.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a RP.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public RP(Message message, string description)
     : base(message, description)
 {
     data = new Type[4];
     data[0] = new ST(message,"Pointer");
     data[1] = new HD(message,"Application ID");
     data[2] = new ID(message, 0,"Type of data");
     data[3] = new ID(message, 0,"Subtype");
 }
Example #19
0
File: SN.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a SN.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public SN(Message message, string description)
     : base(message, description)
 {
     data = new Type[4];
     data[0] = new ST(message,"Comparator");
     data[1] = new NM(message,"Num1");
     data[2] = new ST(message,"Separator/suffix");
     data[3] = new NM(message,"Num2");
 }
Example #20
0
File: ELD.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a ELD.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public ELD(Message message, string description)
     : base(message, description)
 {
     data = new Type[4];
     data[0] = new ST(message,"Segment ID");
     data[1] = new NM(message,"Sequence");
     data[2] = new NM(message,"Field position");
     data[3] = new CE(message,"Code identifying error");
 }
Example #21
0
File: SPD.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a SPD.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public SPD(Message message, string description)
     : base(message, description)
 {
     data = new Type[4];
     data[0] = new ST(message,"Specialty name");
     data[1] = new ST(message,"Governing board");
     data[2] = new ID(message, 0,"Eligible or certified");
     data[3] = new DT(message,"Date of certification");
 }
Example #22
0
File: EI.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a EI.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public EI(Message message, string description)
     : base(message, description)
 {
     data = new Type[4];
     data[0] = new ST(message,"Entity identifier");
     data[1] = new IS(message, 300,"Namespace ID");
     data[2] = new ST(message,"Universal ID");
     data[3] = new ID(message, 301,"Universal ID type");
 }
Example #23
0
File: PLN.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a PLN.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public PLN(Message message, string description)
     : base(message, description)
 {
     data = new Type[4];
     data[0] = new ST(message,"ID number (ST)");
     data[1] = new IS(message, 0,"Type of ID number (IS)");
     data[2] = new ST(message,"State/other qualifying info");
     data[3] = new DT(message,"Expiration date");
 }
Example #24
0
File: QSC.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a QSC.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public QSC(Message message, string description)
     : base(message, description)
 {
     data = new Type[4];
     data[0] = new ST(message,"Segment field name");
     data[1] = new ID(message, 0,"Relational operator");
     data[2] = new ST(message,"Value");
     data[3] = new ID(message, 0,"Relational conjunction");
 }
Example #25
0
File: FN.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a FN.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public FN(Message message, string description)
     : base(message, description)
 {
     data = new Type[5];
     data[0] = new ST(message,"Surname");
     data[1] = new ST(message,"Own surname prefix");
     data[2] = new ST(message,"Own surname");
     data[3] = new ST(message,"Surname prefix from partner/spouse");
     data[4] = new ST(message,"Surname from partner/spouse");
 }
Example #26
0
File: ED.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a ED.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public ED(Message message, string description)
     : base(message, description)
 {
     data = new Type[5];
     data[0] = new HD(message,"Source application");
     data[1] = new ID(message, 191,"Type of data");
     data[2] = new ID(message, 291,"Data");
     data[3] = new ID(message, 299,"Encoding");
     data[4] = new ST(message,"Data2");
 }
Example #27
0
File: PN.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a PN.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public PN(Message message, string description)
     : base(message, description)
 {
     data = new Type[6];
     data[0] = new FN(message,"Family name");
     data[1] = new ST(message,"Given name");
     data[2] = new ST(message,"Second and further given names or initials thereof");
     data[3] = new ST(message,"Suffix (e.g., JR or III)");
     data[4] = new ST(message,"Prefix (e.g., DR)");
     data[5] = new IS(message, 0,"Degree (e.g., MD)");
 }
Example #28
0
File: CE.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a CE.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public CE(Message message, string description)
     : base(message, description)
 {
     data = new Type[6];
     data[0] = new ST(message,"Identifier (ST)");
     data[1] = new ST(message,"Text");
     data[2] = new IS(message, 0,"Name of coding system");
     data[3] = new ST(message,"Alternate identifier (ST)");
     data[4] = new ST(message,"Alternate text");
     data[5] = new IS(message, 0,"Name of alternate coding system");
 }
Example #29
0
File: CSU.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a CSU.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public CSU(Message message, string description)
     : base(message, description)
 {
     data = new Type[7];
     data[0] = new NM(message,"Channel sensitivity");
     data[1] = new ST(message,"Unit of measure identifier");
     data[2] = new ST(message,"Unit of measure description");
     data[3] = new IS(message, 0,"Unit of measure coding system");
     data[4] = new ST(message,"Alternate unit of measure identifier");
     data[5] = new ST(message,"Alternate unit of measure description");
     data[6] = new IS(message, 0,"Alternate unit of measure coding system");
 }
Example #30
0
File: RFR.cs Project: snosrap/nhapi
 ///<summary>
 /// Creates a RFR.
 /// <param name="message">The Message to which this Type belongs</param>
 ///</summary>
 public RFR(Message message, string description)
     : base(message, description)
 {
     data = new Type[7];
     data[0] = new NR(message,"Numeric range");
     data[1] = new IS(message, 0,"Administrative sex");
     data[2] = new NR(message,"Age range");
     data[3] = new NR(message,"Gestational range");
     data[4] = new TX(message,"Species");
     data[5] = new ST(message,"Race/subspecies");
     data[6] = new TX(message,"Conditions");
 }
Example #31
0
 public ResultSortKey()
 {
     this.text = new STImpl();
 }
Example #32
0
 public Subject()
 {
     this.signatureText  = new STImpl();
     this.patientConsent = new BLImpl(false);
 }
Example #33
0
 public Formularies()
 {
     this.id    = new IIImpl();
     this.title = new STImpl();
 }
Example #34
0
        internal V_RISK(SeamlessViewsContext Context, ST ST, bool KGDAvailable, bool KGGAvailable)
            : base(Context)
        {
            var year      = DateTime.Now.Year;
            var eslCutOff = new DateTime(year, 1, 1);

            _FIRST_REG_NO = ST.FIRST_REG_NO;
            _STKEY        = ST.STKEY;
            _ENTRY        = ST.ENTRY?.ToString("MM/dd/yyyy");
            _SCHOOL_YEAR  = ST.SCHOOL_YEAR;
            _HOME_GROUP   = ST.HOME_GROUP;
            _STUDENT      = $"{ST.SURNAME}, {ST.FIRST_NAME}";

            var attendance = ST.
                             STKEY_SXAB_STKEY
                             .Where(sxab => sxab.ABSENCE_DATE.Value.Year == year)
                             .Select(sxab => new
            {
                sxab.STKEY,
                sxab.ABSENCE_DATE,
                AM     = sxab.AM_ACT_TYPE_KCT,
                PM     = sxab.PM_ACT_TYPE_KCT,
                Source = 0         // SXAB
            })
                             .Concat(
                ST.STKEY_SXABCONV_STKEY
                .Where(conv => conv.ABSENCE_DATE.Value.Year == year)
                .Select(conv => new
            {
                conv.STKEY,
                conv.ABSENCE_DATE,
                AM     = conv.AM_TYPE_KCT,
                PM     = conv.PM_TYPE_KCT,
                Source = 1                 // SXABCONV
            }))
                             .GroupBy(
                r => new { r.STKEY, r.ABSENCE_DATE },
                (k, g) => new
            {
                k.STKEY,
                k.ABSENCE_DATE,
                AM = g.Aggregate((r1, r2) => r2.AM.KCTKEY > 0 && (r1.Source == 1 && (r2.Source == 0 || r2.AM.KCTKEY > r1.AM.KCTKEY)) || (r1.Source == 0 && r2.Source == 0 && r2.AM.KCTKEY > r1.AM.KCTKEY) ? r2 : r1).AM,
                PM = g.Aggregate((r1, r2) => r2.PM.KCTKEY > 0 && (r1.Source == 1 && (r2.Source == 0 || r2.PM.KCTKEY > r1.PM.KCTKEY)) || (r1.Source == 0 && r2.Source == 0 && r2.PM.KCTKEY > r1.PM.KCTKEY) ? r2 : r1).PM
            }).ToList();
            var absences   = attendance.Aggregate(0m, (v, r) => (r.AM.KCTKEY >= 200 && r.AM.CURRICULUM == "N" ? .5m : 0m) + (r.PM.KCTKEY >= 200 && r.PM.CURRICULUM == "N" ? .5m : 0m));
            var daysMarked = attendance.Aggregate(0m, (v, r) => (r.AM.KCTKEY > 0 ? .5m : 0m) + (r.PM.KCTKEY > 0 ? .5m : 0m));

            _UNAPPROVED     = attendance.Aggregate(0m, (v, r) => (r.AM.KCTKEY == 208 || r.AM.KCTKEY == 300 || r.AM.KCTKEY == 500 ? .5m : 0m) + (r.PM.KCTKEY == 208 || r.PM.KCTKEY == 300 || r.PM.KCTKEY == 500 ? .5m : 0m));
            _ATTEND_PERCENT = daysMarked > 0m
                ? (daysMarked - absences) / daysMarked * 100m
                : 0m;
            _ENGREA = ST.STKEY_STVDI_SKEY.Where(r => r.VDIMENSION == "ENGREA" && r.SCORE != "NA").Aggregate((STVDI)null, (a, r) => a == null || r.YEAR_SEMESTER.CompareTo(a.YEAR_SEMESTER) > 0 ? r : a)?.SCORE ?? "";
            _ENGWRI = ST.STKEY_STVDI_SKEY.Where(r => r.VDIMENSION == "ENGWRI" && r.SCORE != "NA").Aggregate((STVDI)null, (a, r) => a == null || r.YEAR_SEMESTER.CompareTo(a.YEAR_SEMESTER) > 0 ? r : a)?.SCORE ?? "";
            _MATNUM = ST.STKEY_STVDI_SKEY.Where(r => r.VDIMENSION == "MATNUM" && r.SCORE != "NA").Aggregate((STVDI)null, (a, r) => a == null || r.YEAR_SEMESTER.CompareTo(a.YEAR_SEMESTER) > 0 ? r : a)?.SCORE ?? "";
            _MATSTR = ST.STKEY_STVDI_SKEY.Where(r => r.VDIMENSION == "MATSTR" && r.SCORE != "NA").Aggregate((STVDI)null, (a, r) => a == null || r.YEAR_SEMESTER.CompareTo(a.YEAR_SEMESTER) > 0 ? r : a)?.SCORE ?? "";
            _INTERNAL_SUSPENSION = attendance.Aggregate(0m, (v, r) => (r.AM.KCTKEY == 400 ? .5m : 0m) + (r.PM.KCTKEY == 400 ? .5m : 0m));
            _EXTERNAL_SUSPENSION = attendance.Aggregate(0m, (v, r) => (r.AM.KCTKEY == 401 ? .5m : 0m) + (r.PM.KCTKEY == 401 ? .5m : 0m));
            _OCCUPATION_CODE     = ST.FAMILY_OCCUPATION;
            _ALERTS     = $"{ST.KOORIE ?? "N"}{(ST.BIRTH_COUNTRY_KGT?.REFUGEE == "Y" ? "Y" : (ST.ESL(eslCutOff, 7) == "Y" && ST.VISA_SUBCLASS_KCV?.REFUGEE == "Y" ? "Y" : "N"))}{ST.DISABILITY ?? "N"}{ST.INTEGRATION ?? "N"}{ST.YOUTH_ALLOW ?? "N"}{ST.ACCESS_ALERT ?? "N"}{ST.RISK_ALERT ?? "N"}{ST.MEDICAL_ALERT ?? "N"}";
            _GENDER     = ST.GENDER;
            _LIVING_ARR = ST.LIVING_ARR;
            _EXIT_DATE  = ST.EXIT_DATE?.ToString("dd/MM/yyyy");

            // KGD isn't currently included in any typical eduHub services
            if (KGDAvailable)
            {
                _EXIT_0 = ST.STATUS == "LEFT"
                    ? (ST.SCHOOL_YEAR.CompareTo("09") < 0 || ST.SCHOOL_YEAR == "UG"
                        ? ST.NEXT_SCHOOL_SKGS?.NAME ?? ""
                        : ST.EXIT_DEST01_KGD?.DESCRIPTION ?? "")
                    : "";
            }
            else
            {
                _EXIT_0 = ST.STATUS == "LEFT"
                    ? ST.NEXT_SCHOOL_SKGS?.NAME ?? ""
                    : "";
            }

            // KGG isn't currently included in any typical eduHub services
            if (KGGAvailable)
            {
                _EXIT_6 = ST.EXIT_CAT01_KGG?.DESCRIPTION;
            }
            else
            {
                _EXIT_6 = null;
            }
        }
Example #35
0
 public RoutingInstructionLines()
 {
     this.keyWordText = new STImpl();
     this.value       = new STImpl();
 }
Example #36
0
 public Issues()
 {
     this.code = new CVImpl();
     this.text = new STImpl();
 }
Example #37
0
        public override void Serialize(XmlDocument dom, XmlElement node)
        {
            base.Serialize(dom, node);

            if (!string.IsNullOrEmpty(this.Hyperlink))
            {
                node.SetAttribute("hyperlink", this.Hyperlink);
            }
            if (this.Folded)
            {
                node.SetAttribute("folded", this.Folded.ToString());
            }

            if (this.CustomWidth.HasValue)
            {
                node.SetAttribute("custom_width", this.CustomWidth.Value.ToString());
            }
            if (this.CustomHeight.HasValue)
            {
                node.SetAttribute("custom_height", this.CustomHeight.Value.ToString());
            }

            //
            if (!TextBounds.IsEmpty)
            {
                node.SetAttribute("text_b", ST.ToString(TextBounds));
            }
            if (!RemarkIconBounds.IsEmpty)
            {
                node.SetAttribute("remark_b", ST.ToString(RemarkIconBounds));
            }
            if (FoldingButtonVisible && !FoldingButton.IsEmpty)
            {
                node.SetAttribute("fold_btn_b", ST.ToString(FoldingButton));
            }

            var styleNode = dom.CreateElement("style");

            this.Style.Serialize(dom, styleNode);
            if (styleNode.Attributes.Count > 0 || styleNode.ChildNodes.Count > 0)
            {
                node.AppendChild(styleNode);
            }

            // links
            if (!this.Links.IsEmpty)
            {
                var links = dom.CreateElement("links");
                foreach (Link link in this.Links)
                {
                    if (link.Target == null || link.Target == link.From)
                    {
                        continue;
                    }

                    var linkNode = dom.CreateElement(Link._XmlElementName);
                    link.Serialize(dom, linkNode);
                    links.AppendChild(linkNode);
                }

                if (links.ChildNodes.Count != 0)
                {
                    node.AppendChild(links);
                }
            }

            // widgets
            if (!this.Widgets.IsEmpty)
            {
                var widgets = dom.CreateElement("widgets");
                foreach (var widget in this.Widgets)
                {
                    var widgetNode = dom.CreateElement(Widget._XmlElementName);
                    //widgetNode.SetAttribute("type", widget.GetTypeID());
                    widget.Serialize(dom, widgetNode);
                    widgets.AppendChild(widgetNode);
                }

                if (widgets.ChildNodes.Count != 0)
                {
                    node.AppendChild(widgets);
                }
            }

            // sub-nodes
            if (!this.Children.IsEmpty)
            {
                var nodes = dom.CreateElement("nodes");
                node.AppendChild(nodes);
                foreach (var subTopic in this.Children)
                {
                    var subNode = dom.CreateElement(XmlElementName);//
                    subTopic.Serialize(dom, subNode);
                    nodes.AppendChild(subNode);
                }

                //
                var lines = dom.CreateElement("lines");
                node.AppendChild(lines);
                foreach (var line in this.Lines)
                {
                    var lineNode = dom.CreateElement("line");
                    line.Serialize(dom, lineNode);
                    lines.AppendChild(lineNode);
                }
            }
        }
Example #38
0
 public Notes()
 {
     this.text         = new STImpl();
     this.languageCode = new CVImpl();
 }
Example #39
0
 public MonitoringPrograms()
 {
     this.code  = new CVImpl();
     this.title = new STImpl();
 }
Example #40
0
 public OtherIndications()
 {
     this.code = new CVImpl();
     this.text = new STImpl();
 }
Example #41
0
 public Notes()
 {
     this.text       = new STImpl();
     this.authorTime = new TSImpl();
 }
Example #42
0
 public Keyword()
 {
     this.authorSignatureText   = new STImpl();
     this.subjectRecordTypeCode = new List <CV>();
 }
Example #43
0
 public Organization()
 {
     this.id   = new IIImpl();
     this.name = new STImpl();
     this.addr = new ADImpl();
 }
Example #44
0
 public IssueManagements_1()
 {
     this.code       = new CVImpl();
     this.text       = new STImpl();
     this.authorTime = new TSImpl();
 }
Example #45
0
 public Organization()
 {
     this.id   = new IIImpl();
     this.name = new STImpl();
     this.addr = new SETImpl <AD, PostalAddress>(typeof(ADImpl));
 }
Example #46
0
        static void SaveMindMap(XmlElement parent, Topic topic, MindMap mindMap)
        {
            if (parent == null || topic == null)
            {
                return;
            }

            XmlElement node = parent.OwnerDocument.CreateElement("node");

            if (!topic.BackColor.IsEmpty)
            {
                node.SetAttribute("BACKGROUND_COLOR", ST.ToWebColor(topic.BackColor));
            }
            else if (!mindMap.NodeBackColor.IsEmpty)
            {
                node.SetAttribute("BACKGROUND_COLOR", ST.ToWebColor(mindMap.NodeBackColor));
            }

            if (!topic.ForeColor.IsEmpty)
            {
                node.SetAttribute("COLOR", ST.ToWebColor(topic.ForeColor));
            }
            else if (!mindMap.NodeForeColor.IsEmpty)
            {
                node.SetAttribute("COLOR", ST.ToWebColor(mindMap.NodeForeColor));
            }

            if (topic.Folded)
            {
                node.SetAttribute("FOLDED", "true");
            }

            if (!string.IsNullOrEmpty(topic.ID))
            {
                node.SetAttribute("ID", topic.ID);
            }

            if (topic.Vector == Blumind.Controls.Vector4.Left)
            {
                node.SetAttribute("POSITION", "left");
            }
            else if (topic.Vector == Blumind.Controls.Vector4.Right)
            {
                node.SetAttribute("POSITION", "right");
            }

            node.SetAttribute("TEXT", topic.Text);

            node.SetAttribute("HGAP", topic.Padding.Left.ToString());
            node.SetAttribute("VGAP", topic.Padding.Right.ToString());

            if (!string.IsNullOrEmpty(topic.Remark))
            {
                SerializeRemark(node, topic.Remark);
            }

            // Links
            if (topic.Links.Count > 0)
            {
                foreach (Link link in topic.Links)
                {
                    SaveLink(node, link, mindMap);
                }
            }

            // Hyperlink
            if (!string.IsNullOrEmpty(topic.Hyperlink))
            {
                node.SetAttribute("LINK", topic.Hyperlink);
            }

            //
            parent.AppendChild(node);

            // children
            if (topic.Children.Count > 0)
            {
                foreach (Topic subTopic in topic.Children)
                {
                    SaveMindMap(node, subTopic, mindMap);
                }
            }
        }
Example #47
0
 public Underwriter()
 {
     this.id = new IIImpl();
     this.underwritingOrganizationName = new STImpl();
 }
Example #48
0
 public AdditionalSIGInstruction()
 {
     this.moodCode = new CSImpl();
     this.text     = new STImpl();
 }
Example #49
0
 public Antigens()
 {
     this.code = new CVImpl();
     this.name = new STImpl();
 }
Example #50
0
 public AssignedEntity()
 {
     this.assignedOrganizationName = new STImpl();
 }
Example #51
0
        public override void Deserialize(Version documentVersion, System.Xml.XmlElement node)
        {
            base.Deserialize(documentVersion, node);

            Hyperlink = node.GetAttribute("hyperlink");
            Folded    = ST.GetBoolDefault(node.GetAttribute("folded"));

            //
            if (documentVersion >= Document.DV_3) // 新
            {
                CustomWidth  = ST.GetInt(node.GetAttribute("custom_width"));
                CustomHeight = ST.GetInt(node.GetAttribute("custom_height"));
            }
            else
            {
                CustomWidth  = ST.GetInt(node.GetAttribute("width"));
                CustomHeight = ST.GetInt(node.GetAttribute("height"));
            }

            TextBounds       = ST.GetRectangle(node.GetAttribute("text_b"), TextBounds);
            RemarkIconBounds = ST.GetRectangle(node.GetAttribute("remark_b"), RemarkIconBounds);
            FoldingButton    = ST.GetRectangle(node.GetAttribute("fold_btn_b"), FoldingButton);

            XmlElement styleNode = node.SelectSingleNode("style") as XmlElement;

            if (styleNode != null)
            {
                Style.Deserialize(documentVersion, styleNode);
            }

            //
            var linkNodes = node.SelectNodes("links/link");

            foreach (XmlElement linkNode in linkNodes)
            {
                Link link = new Link();
                link.Deserialize(documentVersion, linkNode);
                Links.Add(link);
            }

            //
            var widgetNodes = node.SelectNodes("widgets/widget");

            foreach (XmlElement widgetNode in widgetNodes)
            {
                var widget = Widget.DeserializeWidget(documentVersion, widgetNode);
                if (widget != null)
                {
                    Widgets.Add(widget);
                }
            }

            //
            XmlNodeList nodes = node.SelectNodes("nodes/node");

            foreach (XmlElement subNode in nodes)
            {
                Topic subTopic = new Topic();
                subTopic.Deserialize(documentVersion, subNode);
                Children.Add(subTopic);
            }

            //
            if (!Children.IsNullOrEmpty())
            {
                XmlNodeList lines = node.SelectNodes("lines/line");
                foreach (XmlElement lineNode in lines)
                {
                    var line = new TopicLine();
                    line.Deserialize(documentVersion, lineNode);

                    var targetID = lineNode.GetAttribute("target");
                    var target   = Children.Find(c => StringComparer.OrdinalIgnoreCase.Equals(c.ID, targetID));
                    if (target != null)
                    {
                        line.SetTarget(target);
                        Lines.Add(line);
                    }
                }
            }

            //
        }
Example #52
0
 public AppearanceCharacteristics()
 {
     this.code  = new CVImpl();
     this.value = new STImpl();
 }
Example #53
0
 public Application()
 {
     this.id = new IIImpl();
     this.assignedDeviceManufacturerModelName = new STImpl();
 }
Example #54
0
 public IssueManagements_2()
 {
     this.code = new CVImpl();
     this.text = new STImpl();
 }
Example #55
0
 public PatientIdentifyingCharacteristics()
 {
     this.code  = new CVImpl();
     this.value = new STImpl();
 }
Example #56
0
        public static Document Load(XmlDocument dom)
        {
            if (dom.DocumentElement == null)
            {
                return(null);
            }

            // version
            var documentVersion = Document.DocumentVersion;

            if (dom.DocumentElement.HasAttribute("document_version"))
            {
                documentVersion = new Version(dom.DocumentElement.GetAttribute("document_version"));
            }
            else if (dom.DocumentElement.HasAttribute("editor_version"))
            {
                documentVersion = new Version(dom.DocumentElement.GetAttribute("editor_version"));
                if (documentVersion.Major == 3) // 3.0早期的beta版本没有 documentVersion, 而其editor_version 可能略大 DocumentVersion
                {
                    documentVersion = Document.DV_3;
                }
            }
            if (documentVersion > DocumentVersion)
            {
                throw new Exception("Unsupport Document Version");
            }

            // old version document, one chart in a document, 1.5.0 or earlier
            if (dom.DocumentElement.Name == "map")
            {
                return(LoadSingleMindMap(documentVersion, dom));
            }

            // new document, multi-charts in a document
            if (dom.DocumentElement.Name != "document")
            {
                return(null);
            }

            //
            var doc = new Document();

            // information
            var infos = dom.DocumentElement.SelectSingleNode("information") as XmlElement;

            if (infos != null)
            {
                if (documentVersion < Document.DV_3) // 老式的写法
                {
                    doc.Author      = ST.ReadTextNode(infos, "Author");
                    doc.Company     = ST.ReadTextNode(infos, "Company");
                    doc.Version     = ST.ReadTextNode(infos, "Version");
                    doc.Description = ST.ReadTextNode(infos, "Description");
                }
                else
                {
                    doc.Author      = ST.ReadTextNode(infos, "author");
                    doc.Company     = ST.ReadTextNode(infos, "company");
                    doc.Version     = ST.ReadTextNode(infos, "version");
                    doc.Description = ST.ReadTextNode(infos, "description");
                }
            }

            // attributes
            var attrs = dom.DocumentElement.SelectSingleNode("attributes") as XmlElement;

            if (attrs != null)
            {
                foreach (XmlNode attr in attrs.ChildNodes)
                {
                    if (!(attr is XmlElement))
                    {
                        continue;
                    }
                    XmlElement attr_e = (XmlElement)attr;
                    if (attr_e.Name != "item")
                    {
                        continue;
                    }

                    doc.Attributes[attr_e.GetAttribute("name")] = attr_e.InnerText;
                }
            }

            // charts
            var charts = dom.DocumentElement.SelectSingleNode("charts") as XmlElement;

            if (charts != null)
            {
                foreach (XmlNode chart in charts)
                {
                    if (!(chart is XmlElement))
                    {
                        continue;
                    }
                    XmlElement chart_e = (XmlElement)chart;
                    if (chart_e.Name != "chart")
                    {
                        continue;
                    }

                    ChartPage cdoc = LoadChartDocument(documentVersion, chart_e);
                    if (cdoc != null)
                    {
                        doc.Charts.Add(cdoc);
                    }
                }

                doc.ActiveChartIndex = ST.GetIntDefault(charts.GetAttribute("active_chart"));
            }

            doc.Modified = false;
            return(doc);
        }
Example #57
0
        XmlDocument SaveAsXml()
        {
            XmlDocument dom = new XmlDocument();

            dom.AppendChild(dom.CreateXmlDeclaration("1.0", "utf-8", null));

            XmlElement root = dom.CreateElement("document");

            root.SetAttribute("type", "BLUMIND");
            root.SetAttribute("editor_version", ProductInfo.Version);
            root.SetAttribute("document_version", Document.DocumentVersion.ToString());
            dom.AppendChild(root);

            //
            XmlComment comment = dom.CreateComment("Create by Blumind, you can download it free from http://www.blumind.org");

            root.AppendChild(comment);

            // information
            XmlElement infos = dom.CreateElement("information");

            ST.WriteTextNode(infos, "author", Author);
            ST.WriteTextNode(infos, "company", Company);
            ST.WriteTextNode(infos, "version", Version);
            ST.WriteTextNode(infos, "description", Description);
            root.AppendChild(infos);

            // attributes
            XmlElement attrs = dom.CreateElement("attributes");

            foreach (KeyValuePair <string, object> attr in Attributes)
            {
                XmlElement attr_e = dom.CreateElement("item");
                attr_e.SetAttribute("name", attr.Key);
                if (attr.Value != null)
                {
                    attr_e.InnerText = attr.Value.ToString();
                }
                attrs.AppendChild(attr_e);
            }
            root.AppendChild(attrs);

            // charts
            XmlElement charts = dom.CreateElement("charts");

            charts.SetAttribute("active_chart", ActiveChartIndex.ToString());
            foreach (ChartPage cdoc in Charts)
            {
                var chart_e = dom.CreateElement("chart");
                cdoc.Serialize(dom, chart_e);

                //switch (cdoc.Type)
                //{
                //    case ChartType.MindMap:
                //        MindMapIO.SaveAsXml((MindMap)cdoc, chart_e);
                //        break;
                //    default:
                //        continue;
                //}
                charts.AppendChild(chart_e);
            }
            root.AppendChild(charts);

            return(dom);
        }
Example #58
0
 public AdministrationPrecondition()
 {
     this.text = new STImpl();
 }
Example #59
0
 public ImmunizationReason()
 {
     this.text       = new STImpl();
     this.reasonCode = new CVImpl();
 }
Example #60
0
        static Topic LoadNodes(XmlElement xmlNode)
        {
            if (xmlNode == null || xmlNode.Name != "node")
            {
                return(null);
            }

            // topic
            Topic topic = new Topic();

            topic.Text      = xmlNode.GetAttribute("TEXT");
            topic.ID        = xmlNode.GetAttribute("ID");
            topic.BackColor = ST.GetColor(xmlNode.GetAttribute("BACKGROUND_COLOR"), topic.BackColor);
            topic.ForeColor = ST.GetColor(xmlNode.GetAttribute("COLOR"), topic.BackColor);
            topic.Folded    = ST.GetBool(xmlNode.GetAttribute("FOLDED"), topic.Folded);
            topic.Padding   = new Padding(ST.GetInt(xmlNode.GetAttribute("HGAP"), 0),
                                          ST.GetInt(xmlNode.GetAttribute("VGAP"), 0),
                                          ST.GetInt(xmlNode.GetAttribute("HGAP"), 0),
                                          ST.GetInt(xmlNode.GetAttribute("VGAP"), 0));

            // font
            XmlElement node = xmlNode.SelectSingleNode("font") as XmlElement;

            if (node != null)
            {
                FontStyle fs = FontStyle.Regular;
                if (ST.GetBoolDefault(node.GetAttribute("BOLD")))
                {
                    fs |= FontStyle.Bold;
                }
                if (ST.GetBoolDefault(node.GetAttribute("ITALIC")))
                {
                    fs |= FontStyle.Italic;
                }
                topic.Font = new Font(node.GetAttribute("NAME"), ST.GetFloat(node.GetAttribute("SIZE"), 0), fs);
            }

            // note
            XmlElement noteNode = xmlNode.SelectSingleNode("richcontent[@TYPE='NOTE']") as XmlElement;

            if (noteNode != null)
            {
                topic.Remark = DeserializeRemark(noteNode);
            }

            // arrowlink
            XmlNodeList links = xmlNode.SelectNodes("arrowlink");

            foreach (XmlElement linkNode in links)
            {
                Link link = DeserializeLink(linkNode);
                topic.Links.Add(link);
            }

            // children
            XmlNodeList list = xmlNode.SelectNodes("node");

            foreach (XmlElement element in list)
            {
                Topic subTopic = LoadNodes(element);
                if (subTopic != null)
                {
                    topic.Children.Add(subTopic);
                }
            }

            return(topic);
        }