Esempio n. 1
0
        /// <summary>
        /// Creates a patient structure
        /// </summary>
        /// <param name="id">The unique identifier</param>
        /// <param name="name">The name of the patient</param>
        /// <param name="addr">The primary address</param>
        /// <param name="telecom">A primary telecom</param>
        /// <returns>A constructed patient structure</returns>
        public static Patient CreatePatient(
                II id,
                EN name,
                AD addr,
                TEL telecom
            )
        {
            // Instantiate the object
            var retVal = new Patient();

            // Populate address
            retVal.Addr = BAG<AD>.CreateBAG(addr);

            // Confidentiality Code
            retVal.ConfidentialityCode = "N";

            // Effective Time of the types
            // High is populated as "Not Applicable"
            retVal.EffectiveTime = new IVL<TS>(
                (TS)DateTime.Now,
                new TS() { NullFlavor = NullFlavor.NotApplicable }
                );

            // Telecom address
            retVal.Telecom = BAG<TEL>.CreateBAG(telecom);

            // Populate the ID
            retVal.Id = SET<II>.CreateSET(id);

            // Status Code
            retVal.StatusCode = RoleStatus.Active;

            // Return result
            return retVal;
        }
Esempio n. 2
0
        public void TELExample7Test01()
        {
            var tel = new TEL("tel:+13335551212;postd=2345",
                              new CS <TelecommunicationAddressUse>[] {
                TelecommunicationAddressUse.WorkPlace,
                TelecommunicationAddressUse.Direct
            }
                              );

            tel.Capabilities  = null;
            tel.UseablePeriod = null;
            Assert.IsTrue(tel.Validate());
        }
Esempio n. 3
0
        public void TELExample7Test03()
        {
            var tel = new TEL("",
                              new CS <TelecommunicationAddressUse>[] {
                TelecommunicationAddressUse.WorkPlace,
                TelecommunicationAddressUse.Direct
            }
                              );

            tel.Value = "tel:+13335551212;postd=2345";
            tel.Use   = null;
            Assert.IsTrue(tel.Validate());
        }
Esempio n. 4
0
        public void R2TELBasicSerializationTest()
        {
            var tel = new TEL("tel:+13335551212;postd=2345",
                              new CS <TelecommunicationAddressUse>[] {
                TelecommunicationAddressUse.WorkPlace,
                TelecommunicationAddressUse.Direct
            }
                              );
            var expectedXml = @"<test xmlns=""urn:hl7-org:v3"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" value=""tel:+13335551212;postd=2345"" use=""WP DIR""/>";
            var actualXml   = R2SerializationHelper.SerializeAsString(tel);

            R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
        }
Esempio n. 5
0
        /// <summary>
        /// Example 68
        /// Creates a patient structure
        /// </summary>
        /// <param name="id">The unique identifier</param>
        /// <param name="name">The name of the patient</param>
        /// <param name="addr">The primary address</param>
        /// <param name="telecom">A primary telecom</param>
        /// <returns>A constructed patient structure</returns>
        public Patient CreatePatient(
            II id,
            EN name,
            AD addr,
            TEL telecom
            )
        {
            // Instantiate the object
            var retVal = new Patient();

            // return a value in a unit test
            // will result in Not Runnable
            return(retVal);
        }
Esempio n. 6
0
        public virtual void WriteAllgemeineInfo()
        {
            Console.WriteLine("Kuerzel: " + _kuerzel);
            _maPerson.WritePersonInfo();
            foreach (Telefon TEL in _maTelefone)
            {
                TEL.WriteTelefonInfo();
            }

            foreach (Computer CP in _maComputer)
            {
                CP.WriteComputerInfo();
            }
        }
        /// <summary>
        /// Create an Everest TEL from the data model TEL
        /// </summary>
        public TEL CreateTEL(TelecommunicationsAddress tel)
        {
            var retVal = new TEL()
            {
                Value = tel.Value
            };

            if (tel.Use != null)
            {
                retVal.Use = new SET <CS <TelecommunicationAddressUse> >(
                    (CS <TelecommunicationAddressUse>)Util.FromWireFormat(tel.Use, typeof(CS <TelecommunicationAddressUse>)),
                    CS <TelecommunicationAddressUse> .Comparator);
            }
            return(retVal);
        }
Esempio n. 8
0
        /// <summary>
        /// Create an Everest TEL from the data model TEL
        /// </summary>
        public TEL CreateTEL(TelecommunicationsAddress tel, List <IResultDetail> dtls)
        {
            var retVal = new TEL()
            {
                Value = tel.Value
            };

            if (!String.IsNullOrEmpty(tel.Use))
            {
                retVal.Use = new SET <CS <TelecommunicationAddressUse> >(
                    (CS <TelecommunicationAddressUse>)Util.FromWireFormat(tel.Use, typeof(CS <TelecommunicationAddressUse>)),
                    CS <TelecommunicationAddressUse> .Comparator);
            }
            return(retVal);
        }
Esempio n. 9
0
        /// <summary>
        /// Creates a patient structure
        /// </summary>
        /// <param name="id">The unique identifier</param>
        /// <param name="name">The name of the patient</param>
        /// <param name="addr">The primary address</param>
        /// <param name="telecom">A primary telecom</param>
        /// <returns>A constructed patient structure</returns>

        public static Patient CreatePatient(
            II id,
            EN name,
            AD addr,
            TEL telecom
            )
        {
            // Instantiate the object
            var retVal = new Patient();

            // Populate address
            retVal.Addr = BAG <AD> .CreateBAG(addr);

            // Confidentiality Code
            retVal.ConfidentialityCode = "N";

            // Effective Time of the types
            // High is populated as "Not Applicable"
            retVal.EffectiveTime = new IVL <TS>(
                (TS)DateTime.Now,
                new TS()
            {
                NullFlavor = NullFlavor.NotApplicable
            }
                );

            // Telecom address
            retVal.Telecom = BAG <TEL> .CreateBAG(telecom);

            // Populate the ID
            retVal.Id = SET <II> .CreateSET(id);

            // Status Code
            retVal.StatusCode = RoleStatus.Active;

            // Set entity choice
            retVal.SetPatientEntityChoiceSubject(
                new Person()
            {
                AdministrativeGenderCode = AdministrativeGender.Male,
                Name      = BAG <EN> .CreateBAG(name),
                BirthTime = DateTime.Now
            }
                );

            // Return result
            return(retVal);
        }
Esempio n. 10
0
        public void R2TELParseTest1()
        {
            TEL telType = new TEL("http://www.temp.org.example/234232");

            telType.Capabilities  = null;
            telType.ValidTimeLow  = null;
            telType.ValidTimeHigh = null;
            telType.NullFlavor    = null;
            telType.UpdateMode    = null;
            telType.UseablePeriod = null;

            var actualXml = R2SerializationHelper.SerializeAsString(telType);
            var set2      = R2SerializationHelper.ParseString <TEL>(actualXml);

            Assert.AreEqual(telType, set2);
        }
Esempio n. 11
0
        public TEL ToTEL()
        {
            TEL tempTel = new TEL();

            if (string.IsNullOrWhiteSpace(this.NullFlavor))
            {
                tempTel.value = this.Number;
                tempTel.use   = new string[] { this.UsageCode };
            }
            else
            {
                tempTel.nullFlavor = this.NullFlavor;
            }

            return(tempTel);
        }
Esempio n. 12
0
        public void R2TELSerializationTest1()
        {
            TEL telType = new TEL("http://www.temp.org.example/234232");

            telType.Capabilities  = null;
            telType.ValidTimeLow  = null;
            telType.ValidTimeHigh = null;
            telType.NullFlavor    = null;
            telType.UpdateMode    = null;
            telType.UseablePeriod = null;

            var expectedXml = @"<test xmlns=""urn:hl7-org:v3"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" value=""http://www.temp.org.example/234232""/>";
            var actualXml   = R2SerializationHelper.SerializeAsString(telType);

            R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
        }
Esempio n. 13
0
        /// <param name="id">The unique identifier</param>
        /// <param name="name">The name of the patient</param>
        /// <param name="addr">The primary address</param>
        /// <param name="telecom">A primary telecom</param>
        /// <returns>A constructed patient structure</returns>
        public Patient CreatePatient(
            II id,
            EN name,
            AD addr,
            TEL telecom
            )
        {
            try
            {
                // Instantiate the object
                var retVal = new Patient();

                // Populate address
                retVal.Addr = BAG <AD> .CreateBAG(addr);

                // Confidentiality Code
                retVal.ConfidentialityCode = "N";

                // Effective Time of the types
                // High is populated as "Not Applicable"
                retVal.EffectiveTime = new IVL <TS>(
                    (TS)DateTime.Now,
                    new TS()
                {
                    NullFlavor = NullFlavor.NotApplicable
                }
                    );

                // Telecom address
                retVal.Telecom = BAG <TEL> .CreateBAG(telecom);

                // Populate the ID
                retVal.Id = SET <II> .CreateSET(id);

                // Status Code
                retVal.StatusCode = RoleStatus.Active;

                // cannot return result for unit test purposes
                return(retVal);
            }
            catch
            {
                Console.WriteLine("Unit tests must not return a value, but Patient must be returned..");
                return(new Patient());
            }
        }
Esempio n. 14
0
        public void R2TELParseTest4()
        {
            TEL telType = new TEL("tel:+1(555)6755745;postd=545",
                                  new CS <TelecommunicationAddressUse>[] {
                TelecommunicationAddressUse.WorkPlace,
            });

            telType.Capabilities  = null;
            telType.ValidTimeLow  = null;
            telType.ValidTimeHigh = null;
            telType.NullFlavor    = null;
            telType.UpdateMode    = null;
            telType.UseablePeriod = null;

            var actualXml = R2SerializationHelper.SerializeAsString(telType);
            var set2      = R2SerializationHelper.ParseString <TEL>(actualXml);

            Assert.AreEqual(telType, set2);
        }
Esempio n. 15
0
        public void R2TELSerializationTest3()
        {
            TEL telType = new TEL("tel:",
                                  new CS <TelecommunicationAddressUse>[] {
                TelecommunicationAddressUse.Home,
            });

            telType.Capabilities  = null;
            telType.ValidTimeLow  = null;
            telType.ValidTimeHigh = null;
            telType.NullFlavor    = new CS <NullFlavor>(NullFlavor.Unknown);
            telType.UpdateMode    = null;
            telType.UseablePeriod = null;

            var expectedXml = @"<test xmlns=""urn:hl7-org:v3"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" nullFlavor=""UNK""/>";
            var actualXml   = R2SerializationHelper.SerializeAsString(telType);

            R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
        }
Esempio n. 16
0
        public void R2TELSerializationTest4()
        {
            TEL telType = new TEL("tel:+1(555)6755745;postd=545",
                                  new CS <TelecommunicationAddressUse>[] {
                TelecommunicationAddressUse.WorkPlace,
            });

            telType.Capabilities  = null;
            telType.ValidTimeLow  = null;
            telType.ValidTimeHigh = null;
            telType.NullFlavor    = null;
            telType.UpdateMode    = null;
            telType.UseablePeriod = null;

            var expectedXml = @"<test xmlns=""urn:hl7-org:v3"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" value=""tel:+1(555)6755745;postd=545"" use=""WP""/>";
            var actualXml   = R2SerializationHelper.SerializeAsString(telType);

            R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
        }
Esempio n. 17
0
        /// <summary>
        /// Graph the object <paramref name="o"/> onto stream <paramref name="s"/>
        /// </summary>
        /// <param name="s">The XmlWriter to graph object to</param>
        /// <param name="o">The object to graph</param>
        public override void Graph(System.Xml.XmlWriter s, object o, DatatypeFormatterGraphResult result)
        {
            // Get an instance ref
            TEL instance_tel = (TEL)o;

            // Do a base format
            base.Graph(s, o, result);

            // Null flavor
            if (((ANY)o).NullFlavor != null)
            {
                return;
            }

            // Attributes
            if (instance_tel.Value != null)
            {
                s.WriteAttributeString("value", instance_tel.Value);
            }
            if (instance_tel.Use != null && instance_tel.Use.Items != null &&
                instance_tel.Use.Items.Count > 0)
            {
                s.WriteAttributeString("use", Util.ToWireFormat(instance_tel.Use));
            }
            if (instance_tel.Capabilities != null)
            {
                result.AddResultDetail(new UnsupportedDatatypeR1PropertyResultDetail(
                                           ResultDetailType.Warning, "Capabilities", "TEL", s.ToString()));
            }

            // Elements
            if (instance_tel.UseablePeriod != null)
            {
                s.WriteStartElement("useablePeriod", "urn:hl7-org:v3");
                GTSFormatter formatterHelper = new GTSFormatter();
                formatterHelper.Host = this.Host;
                formatterHelper.Graph(s, instance_tel.UseablePeriod, result);
                s.WriteEndElement(); // usable period
            }
        }
Esempio n. 18
0
        /// <summary>
        /// Graph <paramref name="o"/> onto <paramref name="s"/>
        /// </summary>
        public void Graph(System.Xml.XmlWriter s, object o, DatatypeR2FormatterGraphResult result)
        {
            ANYFormatter baseFormatter = new ANYFormatter();

            // Graph
            baseFormatter.Graph(s, o, result);

            // Null ?
            IAny anyInstance = o as IAny;
            TEL  tel         = o as TEL;

            // Null flavor
            if (anyInstance.NullFlavor != null)
            {
                return;
            }

            // Format attributes
            if (tel.Value != null) // Value
            {
                s.WriteAttributeString("value", tel.Value);
            }
            if (tel.Use != null) // Use
            {
                s.WriteAttributeString("use", Util.ToWireFormat(tel.Use));
            }
            if (tel.Capabilities != null) // Capabilities
            {
                s.WriteAttributeString("capabilities", Util.ToWireFormat(tel.Capabilities));
            }

            // format elements
            if (tel.UseablePeriod != null)
            {
                s.WriteStartElement("useablePeriod", "urn:hl7-org:v3");
                var hostResult = this.Host.Graph(s, tel.UseablePeriod);
                result.AddResultDetail(hostResult.Details);
                s.WriteEndElement();
            }
        }
Esempio n. 19
0
        public void TELExample8Test02()
        {
            var tel      = new TEL("tel:+190555525485");
            var weekdays = new PIVL <TS>(
                new IVL <TS>(DateTime.Parse("08-15-2011"), DateTime.Parse("08-19-2011")),
                new PQ(-1, "wk")
                );

            var nineToFive = new PIVL <TS>(
                // given low, high, and inaccurate width
                new IVL <TS>(DateTime.Parse("08-15-2011 09:00 AM"),
                             DateTime.Parse("08-19-2011 05:00 PM")),
                new PQ(-1, "d")
                )
            {
                Operator = SetOperator.Intersect
            };

            tel.UseablePeriod = null;
            tel.Use           = null;
            Assert.IsTrue(tel.Validate());
        }
Esempio n. 20
0
 public void TELExample7Test01()
 {
     var tel = new TEL("tel:+13335551212;postd=2345",
         new CS<TelecommunicationAddressUse>[]{
             TelecommunicationAddressUse.WorkPlace,
             TelecommunicationAddressUse.Direct
         }
     );
     tel.Capabilities = null;
     tel.UseablePeriod = null;
     Assert.IsTrue(tel.Validate());
 }
Esempio n. 21
0
 public void TELValidURIFlavorTest()
 {
     TEL tel = new TEL();
     tel.Value = "file:blah/blah";
     tel.NullFlavor = null;
     Assert.IsTrue(TEL.IsValidUriFlavor(tel));
 }
Esempio n. 22
0
 internal void SetTelecom(TEL tel)
 {
     this.telecom = new List<TEL>();
     this.AddTelecom(tel);
 }
Esempio n. 23
0
    protected void Btinput_Click(object sender, EventArgs e)
    {
        string strbranchID = ""; //经办单位ID
        string strBenfactorType; //捐助人类型
        string strTEL;           //手机号
        string strBenfactorID;   //捐助人ID

        //string selectBranchID = "select handlingunitID from e_handlingunit where benfactorFrom='" + ddlBranch.Text.ToString() + "'";
        //MySqlDataReader mysqlread1 = msq.getmysqlread(selectBranchID);
        //while (mysqlread1.Read())
        switch (int.Parse(benfactorType.SelectedValue))
        {
        case 1:
            if (benfactorName.Text.Trim() == "")
            {
                labError.Text           = "公益组织名称不能为空!";
                benfactorName.BackColor = Color.FromArgb((int)0xFFE1FF);
                benfactorName.Focus();
                return;
            }
            else
            {
                benfactorName.BackColor = Color.White;
            }
            if (Contacts.Text.Trim() == "")
            {
                labError.Text      = "联系人姓名不能为空!";
                Contacts.BackColor = Color.FromArgb((int)0xFFE1FF);
                Contacts.Focus();
                return;
            }
            else
            {
                Contacts.BackColor = Color.White;
            }
            if (Contacts.Text.Trim() == "")
            {
                labError.Text      = "联系人姓名不能为空!";
                Contacts.BackColor = Color.FromArgb((int)0xFFE1FF);
                Contacts.Focus();
                return;
            }
            else
            {
                Contacts.BackColor = Color.White;
            }
            break;

        case 2:
            if (benfactorName.Text.Trim() == "")
            {
                labError.Text           = "单位名称不能为空!";
                benfactorName.BackColor = Color.FromArgb((int)0xFFE1FF);
                benfactorName.Focus();
                return;
            }
            else
            {
                benfactorName.BackColor = Color.White;
            }
            break;

        case 3:
            if (benfactorName.Text.Trim() == "")
            {
                labError.Text           = "姓名不能为空!";
                benfactorName.BackColor = Color.FromArgb((int)0xFFE1FF);
                benfactorName.Focus();
                return;
            }
            else
            {
                benfactorName.BackColor = Color.White;
            }
            break;

        case 4:
            if (benfactorName.Text.Trim() == "")
            {
                labError.Text           = "募捐箱名称不能为空!";
                benfactorName.BackColor = Color.FromArgb((int)0xFFE1FF);
                benfactorName.Focus();
                return;
            }
            else
            {
                benfactorName.BackColor = Color.White;
            }
            break;

        case 5:
            if (benfactorName.Text.Trim() == "")
            {
                labError.Text           = "冠名慈善捐助金名称不能为空!";
                benfactorName.BackColor = Color.FromArgb((int)0xFFE1FF);
                benfactorName.Focus();
                return;
            }
            else
            {
                benfactorName.BackColor = Color.White;
            }
            break;
        }


        //使用正则表达式验证11位手机号是由11位数字组成
        Regex mobileReg = new Regex("^[0-9]{11,11}$");

        if (TEL.Text.Trim() == "")
        {
            labError.Text = "请输入手机号";
            TEL.BackColor = Color.FromArgb((int)0xFFE1FF);
            TEL.Focus();
            return;
        }
        else if (TEL.Text.Trim().Length != 11)
        {
            labError.Text = "11位手机号位数不对";
            TEL.BackColor = Color.FromArgb((int)0xFFE1FF);
            TEL.Focus();
            return;
        }
        else if (mobileReg.IsMatch(TEL.Text.Trim()))
        {    //验证通过
            TEL.BackColor = Color.White;
        }
        else
        {
            labError.Text = "手机号由11位数字组成";
            TEL.BackColor = Color.FromArgb((int)0xFFE1FF);
            TEL.Focus();
            return;
        }

        strbranchID = ddlBranch.SelectedValue.ToString();
        if (strbranchID == "")
        {
            labError.Text = "未找到该经办单位的ID!";
            return;
        }

        strBenfactorType = benfactorType.SelectedValue;
        strTEL           = TEL.Text.ToString();
        strBenfactorID   = strbranchID + strBenfactorType + strTEL;

        try
        {
            string strName = Regex.Replace(benfactorName.Text.ToString(), @"\s", "");
            if (benfactorType.SelectedValue == "1")    //公益组织
            {
                string strgongyi = string.Format("insert into e_benfactor (benfactorID,benfactorName,handlingunitID,benfactorFrom,benfactorType,Contacts,TEL,email,remainMoney) values('{0}','{1}',{2},'{3}',{4},'{5}','{6}','{7}',{8})", strBenfactorID, strName, strbranchID, ddlBranch.SelectedItem.Text.ToString(), strBenfactorType, Contacts.Text.ToString(), strTEL, email.Text.ToString(), "0");
                msq.getmysqlcom(strgongyi);
                if (rdbNaming.Checked)
                {
                    string strUpdNaming = "update e_benfactor set naming=1,namingSelected='" + ddlNaming.SelectedItem.Text.ToString() + "' where benfactorID='" + strBenfactorID + "'";
                    msq.getmysqlcom(strUpdNaming);
                }
                if (rdbDirect.Checked)
                {
                    string strUpdDirect = "update e_benfactor set direction=1,recipientsType='" + recipientsType.SelectedItem.Text.ToString() + "',recipientsDescription='" + description.Text.ToString() + "' where benfactorID='" + strBenfactorID + "'";
                    msq.getmysqlcom(strUpdDirect);
                }
            }
            if (benfactorType.SelectedValue == "2")    //单位
            {
                string strfaren = string.Format("insert into e_benfactor (benfactorID,benfactorName,handlingunitID,benfactorFrom,benfactorType,Contacts,TEL,email,remainMoney) values('{0}','{1}',{2},'{3}',{4},'{5}','{6}','{7}',{8})", strBenfactorID, strName, strbranchID, ddlBranch.SelectedItem.Text.ToString(), strBenfactorType, Contacts.Text.ToString(), strTEL, email.Text.ToString(), "0");
                msq.getmysqlcom(strfaren);
                if (rdbNaming.Checked)
                {
                    string strUpdNaming = "update e_benfactor set naming=1,namingSelected='" + ddlNaming.SelectedItem.Text.ToString() + "',recipientsDescription='" + description.Text.ToString() + "' where benfactorID='" + strBenfactorID + "'";
                    msq.getmysqlcom(strUpdNaming);
                }
                if (rdbDirect.Checked)
                {
                    string strUpdDirect = "update e_benfactor set direction=1,recipientsType='" + recipientsType.SelectedItem.Text.ToString() + "' where benfactorID='" + strBenfactorID + "'";
                    msq.getmysqlcom(strUpdDirect);
                }
            }
            if (benfactorType.SelectedValue == "3")    //个人
            {
                string strziran = string.Format("insert into e_benfactor (benfactorID,benfactorName,handlingunitID,benfactorFrom,benfactorType,sex,TEL,email,remainMoney) values('{0}','{1}',{2},'{3}',{4},'{5}','{6}','{7}',{8})", strBenfactorID, strName, strbranchID, ddlBranch.SelectedItem.Text.ToString(), strBenfactorType, ddlSex.SelectedItem.Text.ToString(), strTEL, email.Text.ToString(), "0");
                msq.getmysqlcom(strziran);
                if (rdbNaming.Checked)
                {
                    string strUpdNaming = "update e_benfactor set naming=1,namingSelected='" + ddlNaming.SelectedItem.Text.ToString() + "' where benfactorID='" + strBenfactorID + "'";
                    msq.getmysqlcom(strUpdNaming);
                }
                if (rdbDirect.Checked)
                {
                    string strUpdDirect = "update e_benfactor set direction=1,recipientsType='" + recipientsType.SelectedItem.Text.ToString() + "',recipientsDescription='" + description.Text.ToString() + "' where benfactorID='" + strBenfactorID + "'";
                    msq.getmysqlcom(strUpdDirect);
                }
            }
            if (benfactorType.SelectedValue == "4")    //募捐箱
            {
                string strmujuan = string.Format("insert into e_benfactor (benfactorID,benfactorName,handlingunitID,benfactorFrom,benfactorType,Contacts,TEL,email,moneyboxNo,remainMoney) values('{0}','{1}',{2},'{3}',{4},'{5}','{6}','{7}','{8}',{9})", strBenfactorID, strName, strbranchID, ddlBranch.SelectedItem.Text.ToString(), strBenfactorType, Contacts.Text.ToString(), strTEL, email.Text.ToString(), moneyboxNo.Text.ToString(), "0");
                msq.getmysqlcom(strmujuan);
                if (rdbNaming.Checked)
                {
                    string strUpdNaming = "update e_benfactor set naming=1,namingSelected='" + ddlNaming.SelectedItem.Text.ToString() + "' where benfactorID='" + strBenfactorID + "'";
                    msq.getmysqlcom(strUpdNaming);
                }
                if (rdbDirect.Checked)
                {
                    string strUpdDirect = "update e_benfactor set direction=1,recipientsType='" + recipientsType.SelectedItem.Text.ToString() + "',recipientsDescription='" + description.Text.ToString() + "' where benfactorID='" + strBenfactorID + "'";
                    msq.getmysqlcom(strUpdDirect);
                }
            }
            if (benfactorType.SelectedValue == "5")    //冠名捐助金
            {
                string strgongyi = string.Format("insert into e_benfactor (benfactorID,benfactorName,handlingunitID,benfactorFrom,benfactorType,Contacts,TEL,email,namingAge,deadline,bftRange,bftRemark,remainMoney) values('{0}','{1}',{2},'{3}',{4},'{5}','{6}','{7}',{8},'{9}','{10}','{11}',{12})", strBenfactorID, strName, strbranchID, ddlBranch.SelectedItem.Text.ToString(), strBenfactorType, Contacts.Text.ToString(), strTEL, email.Text.ToString(), ddlAge.Text.ToString(), ViewState["deadline"].ToString(), txtRange.Text.ToString(), txtRemark.Text.ToString(), "0");
                msq.getmysqlcom(strgongyi);
                if (ddlCycle.SelectedValue != "0")
                {
                    string strRemind = string.Format("insert into e_remind (benfactorID,cycle,flag) values ('{0}',{1},{2})", strBenfactorID, ddlCycle.SelectedValue.ToString(), ddlAge.SelectedValue.ToString());
                    msq.getmysqlcom(strRemind);
                }
            }
            NLogTest nlog = new NLogTest();
            string   sss  = "添加了捐赠人:" + strName;
            nlog.WriteLog(Session["UserName"].ToString(), sss);
            tbReset();
            labError.Text = "添加成功!";
            //loadPage();
            //foreach (System.Web.UI.Control stl in this.Form.Controls)
            //{
            //    if (stl is System.Web.UI.WebControls.TextBox)
            //    {
            //        TextBox tb = (TextBox)stl;
            //        tb.Text = "";
            //    }
            //}
        }
        catch
        {
            labError.Text = "添加失败,手机号重复!";
        }
    }
Esempio n. 24
0
 public void TELInvalidEMailFlavorTest()
 {
     TEL tel = new TEL();
     tel.Value = "no emails thank you";
     tel.NullFlavor = null;
     Assert.IsFalse(TEL.IsValidEMailFlavor(tel));
     Assert.IsFalse(TEL.IsValidPersonFlavor(tel));
 }
Esempio n. 25
0
 public void TELNullFlavorTest()
 {
     TEL tel = new TEL();
     tel.Value = null;
     tel.NullFlavor = NullFlavor.NotAsked;
     Assert.IsTrue(tel.Validate());
 }
Esempio n. 26
0
 public void TELInvalidURIFlavorTest()
 {
     TEL tel = new TEL();
     tel.Value = "nothing here";
     tel.NullFlavor = null;
     Assert.IsFalse(TEL.IsValidUriFlavor(tel));
 }
Esempio n. 27
0
 public void TELValidURLFlavorTest()
 {
     TEL tel = new TEL();
     tel.Value = "http://www.nintendo.com";
     tel.NullFlavor = null;
     Assert.IsTrue(TEL.IsValidUrlFlavor(tel));
 }
Esempio n. 28
0
        /// <summary>
        /// Method used to add a property to the instance. Will be placed in the correct class Property.
        /// </summary>
        /// <param name="input">The vCard.Property to add.</param>
        public void AddProperty(Props.IProperty input)
        {
            if (input == null || input.IsValueNull)
            {
                return;
            }

            switch (input.Property)
            {
            case KnownProperties.ADR:
                ADR.AddIfNotNull(input as Props.ADR);
                break;

            case KnownProperties.ANNIVERSARY:
                ANNIVERSARY = input as Props.ANNIVERSARY;
                break;

            case KnownProperties.BDAY:
                BDAY = input as Props.BDAY;
                break;

            case KnownProperties.CALADRURI:
                CALADRURI.AddIfNotNull(input as Props.CALADRURI);
                break;

            case KnownProperties.CALURI:
                CALURI.AddIfNotNull(input as Props.CALURI);
                break;

            case KnownProperties.CATEGORIES:
                CATEGORIES.AddIfNotNull(input as Props.CATEGORIES);
                break;

            case KnownProperties.CLIENTPIDMAP:
                CLIENTPIDMAP.AddIfNotNull(input as Props.CLIENTPIDMAP);
                break;

            case KnownProperties.EMAIL:
                EMAIL.AddIfNotNull(input as Props.EMAIL);
                break;

            case KnownProperties.FBURL:
                FBURL.AddIfNotNull(input as Props.FBURL);
                break;

            case KnownProperties.FN:
                FN.AddIfNotNull(input as Props.FN);
                break;

            case KnownProperties.GENDER:
                GENDER = input as Props.GENDER;
                break;

            case KnownProperties.GEO:
                GEO.AddIfNotNull(input as Props.GEO);
                break;

            case KnownProperties.IMPP:
                IMPP.AddIfNotNull(input as Props.IMPP);
                break;

            case KnownProperties.KEY:
                KEY.AddIfNotNull(input as Props.KEY);
                break;

            case KnownProperties.KIND: {
                char k = (input as Props.KIND).Value.ToLower()[0];
                if (k == 'i')
                {
                    KIND = Kinds.Individual;
                }
                else if (k == 'g')
                {
                    KIND = Kinds.Group;
                }
                else if (k == 'o')
                {
                    KIND = Kinds.Org;
                }
                else if (k == 'l')
                {
                    KIND = Kinds.Location;
                }
                else
                {
                    KIND = Kinds.Individual;
                }
                break;
            }

            case KnownProperties.LANG:
                LANG.AddIfNotNull(input as Props.LANG);
                break;

            case KnownProperties.LOGO:
                LOGO.AddIfNotNull(input as Props.LOGO);
                break;

            case KnownProperties.MEMBER:
                MEMBER.AddIfNotNull(input as Props.MEMBER);
                break;

            case KnownProperties.N:
                N = input as Props.N;
                break;

            case KnownProperties.NICKNAME:
                NICKNAME.AddIfNotNull(input as Props.NICKNAME);
                break;

            case KnownProperties.NOTE:
                NOTE.AddIfNotNull(input as Props.NOTE);
                break;

            case KnownProperties.ORG:
                ORG.AddIfNotNull(input as Props.ORG);
                break;

            case KnownProperties.PHOTO:
                PHOTO.AddIfNotNull(input as Props.PHOTO);
                break;

            case KnownProperties.PRODID:
                PRODID = input as Props.PRODID;
                break;

            case KnownProperties.RELATED:
                RELATED.AddIfNotNull(input as Props.RELATED);
                break;

            case KnownProperties.REV:
                REV = input as Props.REV;
                break;

            case KnownProperties.ROLE:
                ROLE.AddIfNotNull(input as Props.ROLE);
                break;

            case KnownProperties.SOUND:
                SOUND.AddIfNotNull(input as Props.SOUND);
                break;

            case KnownProperties.SOURCE:
                SOURCE.AddIfNotNull(input as Props.SOURCE);
                break;

            case KnownProperties.TEL:
                TEL.AddIfNotNull(input as Props.TEL);
                break;

            case KnownProperties.TITLE:
                TITLE.AddIfNotNull(input as Props.TITLE);
                break;

            case KnownProperties.TZ:
                TZ.AddIfNotNull(input as Props.TZ);
                break;

            case KnownProperties.UID:
                UID = input as Props.UID;
                break;

            case KnownProperties.URL:
                URL.AddIfNotNull(input as Props.URL);
                break;

            case KnownProperties.VERSION:
                VERSION = input as Props.VERSION;
                break;

            case KnownProperties.XML:
                XML.AddIfNotNull(input as Props.XML);
                break;

            default:
                return;
            }
        }
Esempio n. 29
0
 public GuarantorPerformerAssignedEntity()
 {
     this.addr    = new ADImpl();
     this.telecom = new TELImpl();
 }
Esempio n. 30
0
 public void TELInvalidPhoneFlavorTest()
 {
     TEL tel = new TEL();
     tel.Value = "519-456-3423";
     tel.NullFlavor = null;
     Assert.IsFalse(TEL.IsValidPhoneFlavor(tel));
     Assert.IsFalse(TEL.IsValidPersonFlavor(tel));
 }
Esempio n. 31
0
 public void TELValidPhoneFlavorTest()
 {
     TEL tel = new TEL();
     tel.Value = "tel://519-555-2345";
     tel.NullFlavor = null;
     Assert.IsTrue(TEL.IsValidPhoneFlavor(tel));
     Assert.IsTrue(TEL.IsValidPersonFlavor(tel));
 }
Esempio n. 32
0
 public void TELValueNullFlavorTest()
 {
     TEL tel = new TEL();
     tel.Value = "*****@*****.**";
     tel.NullFlavor = NullFlavor.NotApplicable;
     Assert.IsFalse(tel.Validate());
 }
Esempio n. 33
0
 public Form()
 {
     this.telecom = new TELImpl();
 }
Esempio n. 34
0
        /// <summary>
        /// Parse the object from stream <paramref name="s"/>
        /// </summary>
        /// <param name="s">The XmlReader to parse from</param>
        public override object Parse(System.Xml.XmlReader s, DatatypeFormatterParseResult result)
        {
            // Parse TS
            TEL retVal = base.Parse <TEL>(s, result);

            // Now parse our data out... Attributes
            if (s.GetAttribute("value") != null)
            {
                retVal.Value = s.GetAttribute("value");
            }
            if (s.GetAttribute("use") != null)
            {
                retVal.Use = (SET <CS <TelecommunicationAddressUse> >)(Util.FromWireFormat(s.GetAttribute("use"), typeof(SET <CS <TelecommunicationAddressUse> >)));
            }

            // Elements
            #region Elements
            if (!s.IsEmptyElement)
            {
                int    sDepth = s.Depth;
                string sName  = s.Name;

                s.Read();
                // string Name
                while (!(s.NodeType == System.Xml.XmlNodeType.EndElement && s.Depth == sDepth && s.Name == sName))
                {
                    string oldName = s.Name; // Name
                    try
                    {
                        if (s.LocalName == "useablePeriod") // Usable Period, since this is an SXCM
                        {
                            // Useable period doesn't exist
                            //if (retVal.UseablePeriod == null) retVal.UseablePeriod = new SET<SXCM<TS>>();
                            //retVal.UseablePeriod.Add(this.Host.ParseObject(s, typeof(SXCM<TS>)) as SXCM<TS>);
                            GTSFormatter formatter = new GTSFormatter();
                            formatter.Host       = this.Host;
                            retVal.UseablePeriod = formatter.Parse(s, result) as GTS;
                        }
                    }
                    catch (MessageValidationException e)
                    {
                        result.AddResultDetail(new MARC.Everest.Connectors.ResultDetail(MARC.Everest.Connectors.ResultDetailType.Error, e.Message, s.ToString(), e));
                    }
                    finally
                    {
                        if (s.Name == oldName)
                        {
                            s.Read();
                        }
                    }
                }
            }
            #endregion

            // Validate
            string pathName = s is XmlStateReader ? (s as XmlStateReader).CurrentPath : s.Name;
            base.Validate(retVal, pathName, result);


            return(retVal);
        }
Esempio n. 35
0
 public void R2TELBasicSerializationTest()
 {
     var tel = new TEL("tel:+13335551212;postd=2345",
         new CS<TelecommunicationAddressUse>[] {
             TelecommunicationAddressUse.WorkPlace, 
             TelecommunicationAddressUse.Direct
         }
     );
     var expectedXml = @"<test xmlns=""urn:hl7-org:v3"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" value=""tel:+13335551212;postd=2345"" use=""WP DIR""/>";
     var actualXml = R2SerializationHelper.SerializeAsString(tel);
     R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
 }
Esempio n. 36
0
 public void TELValidEMailFlavorTest()
 {
     TEL tel = new TEL();
     tel.Value = "mailto:[email protected]";
     tel.NullFlavor = null;
     Assert.IsTrue(TEL.IsValidEMailFlavor(tel));
     Assert.IsTrue(TEL.IsValidPersonFlavor(tel));
 }
Esempio n. 37
0
 public void TELValidValueTest()
 {
     TEL tel = new TEL();
     tel.Value = "mailto:[email protected]";
     tel.NullFlavor = null;
     Assert.IsTrue(tel.Validate());
 }
Esempio n. 38
0
 public void TELNullTest()
 {
     TEL tel = new TEL();
     tel.Value = null;
     tel.NullFlavor = null;
     Assert.IsFalse(tel.Validate());
 }
Esempio n. 39
0
        public void R2TELParseTest4()
        {
            TEL telType = new TEL("tel:+1(555)6755745;postd=545",
                new CS<TelecommunicationAddressUse>[]{
                    TelecommunicationAddressUse.WorkPlace, 
                });

            telType.Capabilities = null;
            telType.ValidTimeLow = null;
            telType.ValidTimeHigh = null;
            telType.NullFlavor = null;
            telType.UpdateMode = null;
            telType.UseablePeriod = null;

            var actualXml = R2SerializationHelper.SerializeAsString(telType);
            var set2 = R2SerializationHelper.ParseString<TEL>(actualXml);
            Assert.AreEqual(telType, set2);
        }
Esempio n. 40
0
        /// <summary>
        /// Parse <paramref name="s"/>
        /// </summary>
        public object Parse(System.Xml.XmlReader s, DatatypeR2FormatterParseResult result)
        {
            // Parse base (ANY) from the stream
            ANYFormatter baseFormatter = new ANYFormatter();

            // Parse TEL
            TEL retVal = baseFormatter.Parse <TEL>(s);

            // Get the value
            if (s.GetAttribute("value") != null)
            {
                retVal.Value = s.GetAttribute("value");
            }
            if (s.GetAttribute("use") != null)
            {
                retVal.Use = Util.Convert <SET <CS <TelecommunicationAddressUse> > >(s.GetAttribute("use"));
            }
            if (s.GetAttribute("capabilities") != null)
            {
                retVal.Capabilities = Util.Convert <SET <CS <TelecommunicationCabability> > >(s.GetAttribute("capabilities"));
            }

            // Elements
            #region Elements
            if (!s.IsEmptyElement)
            {
                int    sDepth = s.Depth;
                string sName  = s.Name;

                s.Read();
                // string Name
                while (!(s.NodeType == System.Xml.XmlNodeType.EndElement && s.Depth == sDepth && s.Name == sName))
                {
                    string oldName = s.Name; // Name
                    try
                    {
                        // Numerator
                        if (s.LocalName == "useablePeriod")
                        {
                            var parseResult = this.Host.Parse(s, typeof(GTS));
                            result.Code = parseResult.Code;
                            result.AddResultDetail(parseResult.Details);
                            retVal.UseablePeriod = Util.Convert <GTS>(parseResult.Structure);
                        }
                        else if (s.NodeType == System.Xml.XmlNodeType.Element)
                        {
                            result.AddResultDetail(new NotImplementedElementResultDetail(ResultDetailType.Warning, s.LocalName, s.NamespaceURI, s.ToString(), null));
                        }
                    }
                    catch (MessageValidationException e)
                    {
                        result.AddResultDetail(new ResultDetail(MARC.Everest.Connectors.ResultDetailType.Error, e.Message, e));
                    }
                    finally
                    {
                        if (s.Name == oldName)
                        {
                            s.Read();
                        }
                    }
                }
            }
            #endregion

            // Base formatter
            baseFormatter.Validate(retVal, s.ToString(), result);

            return(retVal);
        }
Esempio n. 41
0
 public OwnerPerson()
 {
     this.name    = new PNImpl();
     this.telecom = new TELImpl();
 }
Esempio n. 42
0
 public ToBeRespondedToBy()
 {
     this.telecom  = new TELImpl();
     this.deviceId = new IIImpl();
 }
Esempio n. 43
0
        internal void AddTelecom(TEL tel)
        {
            if (this.telecom == null)
            {
                this.telecom = new List<TEL>();
            }

            this.telecom.Add(tel);
        }
Esempio n. 44
0
        public void R2TELParseTest1()
        {
            TEL telType = new TEL("http://www.temp.org.example/234232");

            telType.Capabilities = null;
            telType.ValidTimeLow = null;
            telType.ValidTimeHigh = null;
            telType.NullFlavor = null;
            telType.UpdateMode = null;
            telType.UseablePeriod = null;            

            var actualXml = R2SerializationHelper.SerializeAsString(telType);
            var set2 = R2SerializationHelper.ParseString<TEL>(actualXml);
            Assert.AreEqual(telType, set2);
        }
Esempio n. 45
0
 public void TELConstructionTest4()
 {
     TEL mail = new TEL("mailtoXYZ:[email protected]",
         new CS<TelecommunicationAddressUse>[]{
             TelecommunicationAddressUse.WorkPlace,
             TelecommunicationAddressUse.Direct
     }
     );
     mail.NullFlavor = null;
     Assert.IsFalse(TEL.IsValidEMailFlavor(mail));
 }
Esempio n. 46
0
 public void TELInvalidURLFlavorTest()
 {
     TEL tel = new TEL();
     tel.Value = "www.xbox.com";
     tel.NullFlavor = null;
     Assert.IsFalse(TEL.IsValidUrlFlavor(tel));
 }
Esempio n. 47
0
        protected void btyes_Click(object sender, EventArgs e)
        {
            labError.Text = "";
            string strID = txtID.Text.Trim();

            if (strID == "")
            {
                labError.ForeColor = System.Drawing.Color.Red;
                labError.Text      = "请输入用户名";
                txtID.BackColor    = Color.FromArgb((int)0xFFE1FF);
                txtID.Focus();
                return;
            }
            else
            {
                txtID.BackColor = Color.White;
            }

            string errMsg = "";

            if (!luyunfei.lyf_validate.isAZaz09_(strID, 5, 8, out errMsg))
            {
                labError.Text   = "用户名由5~8位的数字、英文字母或下划线组成!";
                txtID.BackColor = Color.FromArgb((int)0xFFE1FF);
                txtID.Focus();
                return;
            }
            else
            {
                txtID.BackColor = Color.White;
            }

            //bool isMatch = lyf_validate.isIDorPwd(strID);
            //if (!isMatch)
            //{
            //    labError.ForeColor = System.Drawing.Color.Red;
            //    labError.Text = "输入的用户名格式不正确!用户ID只能包含字母、数字、下划线,且不能以数字开头,5~16位。";
            //    benfactorFrom.BackColor = Color.FromArgb((int)0xFFE1FF);
            //    benfactorFrom.Focus();
            //    return;
            //}

            string strName = txtName.Text.Trim();

            if (strName == "")
            {
                labError.ForeColor = System.Drawing.Color.Red;
                labError.Text      = "请输入姓名";
                txtName.BackColor  = Color.FromArgb((int)0xFFE1FF);
                txtName.Focus();
                return;
            }
            else
            {
                txtName.BackColor = Color.White;
            }

            string strUserRole = ddlRole.SelectedValue.ToString();

            if (ddlRole.SelectedValue == "请选择")
            {
                labError.ForeColor = System.Drawing.Color.Red;
                labError.Text      = "请选择权限";
                return;
            }

            string strTEL = TEL.Text.Trim();

            if (strTEL == "")
            {
                labError.ForeColor = System.Drawing.Color.Red;
                labError.Text      = "请输入联系方式";
                TEL.BackColor      = Color.FromArgb((int)0xFFE1FF);
                TEL.Focus();
                return;
            }
            else
            {
                TEL.BackColor = Color.White;
            }

            string strPwd = txtPWD.Text.Trim();

            if (strPwd == "")
            {
                labError.ForeColor = System.Drawing.Color.Red;
                labError.Text      = "请输入密码";
                txtPWD.BackColor   = Color.FromArgb((int)0xFFE1FF);
                txtPWD2.BackColor  = Color.White;
                txtPWD.Focus();
                return;
            }
            else
            {
                txtPWD.BackColor = Color.White;
            }

            if (!luyunfei.lyf_validate.isAZaz09_(strPwd, 5, 20, out errMsg))
            {
                labError.Text    = "密码由5~20位的数字、英文字母或下划线组成!";
                txtPWD.BackColor = Color.FromArgb((int)0xFFE1FF);
                txtPWD.Focus();
                return;
            }
            else
            {
                txtPWD.BackColor = Color.White;
            }

            string strPwd2 = txtPWD2.Text.Trim();

            if (strPwd2 == "")
            {
                labError.ForeColor = System.Drawing.Color.Red;
                labError.Text      = "请再次输入密码";
                txtPWD.BackColor   = Color.FromArgb((int)0xFFE1FF);
                txtPWD2.BackColor  = Color.FromArgb((int)0xFFE1FF);
                txtPWD.Focus();
                return;
            }
            else
            {
                txtPWD.BackColor  = Color.White;
                txtPWD2.BackColor = Color.White;
            }

            if (strPwd != strPwd2)
            {
                labError.ForeColor = System.Drawing.Color.Red;
                labError.Text      = "两次输入的密码不一致!";
                txtPWD.BackColor   = Color.FromArgb((int)0xFFE1FF);
                txtPWD2.BackColor  = Color.FromArgb((int)0xFFE1FF);
                txtPWD.Focus();
                return;
            }
            else
            {
                txtPWD.BackColor  = Color.White;
                txtPWD2.BackColor = Color.White;
            }

            string           strFrom = benfactorFrom.Text.Trim();
            HybridDictionary hd      = new HybridDictionary();

            hd.Add(sPMS_CTG_ID, strID);
            //      dtUsers = entityUsers.ExecuteDataTable2(CommandType.Text, "SelectById", hd);
            string sqldate = string.Format("select * from e_user where user='******'", strID);

            mysqlconn        mys = new mysqlconn();
            MySqlDataAdapter sda = new MySqlDataAdapter(sqldate, mys.getmysqlcon());
            DataSet          ds  = MySqlHelper.ExecuteDataset(mys.getmysqlcon(), sqldate);
            DataView         dv  = new DataView(ds.Tables[0]);

            if (dv.Count > 0)
            {
                labError.ForeColor = System.Drawing.Color.Red;
                labError.Text      = "该用户已存在!";
                return;
            }
            try
            {
                //DataTable schemaMeter = entityUsers.GetSchema();
                //DataRow dr = schemaMeter.NewRow();
                //dr[sPMS_CTG_ID] = strID;
                //dr[sPMS_CTG_NAME] = strName;
                //dr[sUSE_IDT] = 0;//用户标记为未启用
                //dr[sPwd] = strPwd;
                //dr[sDES] = "";
                //dr[sCRT_DATE] = DateTime.Now;
                string sqldate1 = string.Format("insert into e_user(user,password,benfactorFrom,name,TEL,userRole) values('{0}','{1}','{2}','{3}','{4}',{5})", strID, strPwd, strFrom, strName, strTEL, strUserRole);
                //     bool result = Convert.ToBoolean(entityUsers.Insert(dr));

                int result1 = mys.getmysqlcom(sqldate1);

                if (result1 > 0)
                {
                    labError.ForeColor = System.Drawing.Color.Red;
                    labError.Text      = "注册成功!";
                    //  wl.WriteLogData(PAGE_NAME, "创建", strName, System.Diagnostics.EventLogEntryType.Information);
                    NLogTest nlog = new NLogTest();
                    string   sss  = "管理员创建了新用户:" + strID + "(" + strName + ")";
                    nlog.WriteLog(Session["UserName"].ToString(), sss);
                }
                else
                {
                    labError.ForeColor = System.Drawing.Color.Red;
                    labError.Text      = "注册失败!";
                    //  wl.WriteLogData(PAGE_NAME, "创建", strName, System.Diagnostics.EventLogEntryType.Warning);
                }
            }
            catch (Exception ex)
            {
                labError.ForeColor = System.Drawing.Color.Red;
                labError.Text      = "添加记录失败" + ui.ExceptionMsg(ex);
                //   wl.WriteLogData(PAGE_NAME, "创建", strName + ":" + ex.Message + ex.StackTrace, System.Diagnostics.EventLogEntryType.Error);
            }
        }
Esempio n. 48
0
 public void TELExample7Test03()
 {
     var tel = new TEL("",
         new CS<TelecommunicationAddressUse>[]{
             TelecommunicationAddressUse.WorkPlace,
             TelecommunicationAddressUse.Direct
         }
     );
     tel.Value = "tel:+13335551212;postd=2345";
     tel.Use = null;
     Assert.IsTrue(tel.Validate());
 }
Esempio n. 49
0
        public void TELCastFromStringTest()
        {
            TEL email = "mailto:[email protected]";

            Assert.AreEqual("mailto:[email protected]", email.Value);
        }
Esempio n. 50
0
 public void TELConstructionTest1()
 {
     // 
     TEL phone = new TEL("tel:+13335551212;postd=2345",
         new CS<TelecommunicationAddressUse>[]{
             TelecommunicationAddressUse.WorkPlace,
             TelecommunicationAddressUse.Direct
     }
     );
     phone.NullFlavor = null;
     Assert.IsTrue(phone.Validate());
 }
Esempio n. 51
0
        /// <summary>
        /// Example 69
        /// Creates a patient structure
        /// </summary>
        /// <param name="id">The unique identifier</param>
        /// <param name="name">The name of the patient</param>
        /// <param name="addr">The primary address</param>
        /// <param name="telecom">A primary telecom</param>
        /// <returns>A constructed patient structure</returns>
        public Patient CreatePatient(
                II id,
                EN name,
                AD addr,
                TEL telecom
            )
        {
            try
            {
                // Instantiate the object
                var retVal = new Patient();

                // Populate address
                retVal.Addr = BAG<AD>.CreateBAG(addr);

                // Confidentiality Code
                retVal.ConfidentialityCode = "N";

                // Effective Time of the types
                // High is populated as "Not Applicable"
                retVal.EffectiveTime = new IVL<TS>(
                    (TS)DateTime.Now,
                    new TS() { NullFlavor = NullFlavor.NotApplicable }
                    );

                // Telecom address
                retVal.Telecom = BAG<TEL>.CreateBAG(telecom);

                // Populate the ID
                retVal.Id = SET<II>.CreateSET(id);

                // Status Code
                retVal.StatusCode = RoleStatus.Active;

                // Set entity choice
                retVal.SetPatientEntityChoiceSubject(
                    new Person()
                    {
                        AdministrativeGenderCode = AdministrativeGender.Male,
                        Name = BAG<EN>.CreateBAG(name),
                        BirthTime = DateTime.Now
                    }
                    );

                // cannot return result for unit test purposes
                return retVal;
            }
            catch
            {
                Console.WriteLine("Unit tests must not return a value, but Patient must be returned..");
                return new Patient();
            }
        }
Esempio n. 52
0
        public void R2TELSerializationTest4()
        {
            TEL telType = new TEL("tel:+1(555)6755745;postd=545",
                new CS<TelecommunicationAddressUse>[]{
                    TelecommunicationAddressUse.WorkPlace, 
                });

            telType.Capabilities = null;
            telType.ValidTimeLow = null;
            telType.ValidTimeHigh = null;
            telType.NullFlavor = null;
            telType.UpdateMode = null;
            telType.UseablePeriod = null;

            var expectedXml = @"<test xmlns=""urn:hl7-org:v3"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" value=""tel:+1(555)6755745;postd=545"" use=""WP""/>";
            var actualXml = R2SerializationHelper.SerializeAsString(telType);
            R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
        }
Esempio n. 53
0
 public void TELConstructionTest8()
 {
     TEL uri = new TEL("fileXYZ://www.google.com",
         new CS<TelecommunicationAddressUse>[]{
             TelecommunicationAddressUse.WorkPlace,
             TelecommunicationAddressUse.Direct
     }
     );
     uri.NullFlavor = null;
     Assert.IsFalse(TEL.IsValidUriFlavor(uri));
 }
Esempio n. 54
0
        public void R2TELUseablePeriodParseTest()
        {
            var tel = new TEL("tel:+190555525485");

            // This PIVL<TS> selects the week of Aug 15 2011 - Aug 19 2011
            var weekdays = new PIVL<TS>(
                new IVL<TS>(DateTime.Parse("08-15-2011"), DateTime.Parse("08-19-2011")),
                new PQ(1, "wk")
            );

            // This PIVL<TS> selects the hours of 9-5
            var nineToFive = new PIVL<TS>(
                new IVL<TS>(DateTime.Parse("08-15-2011 09:00 AM"), DateTime.Parse("08-15-2011 05:00 PM")),
                new PQ(1, "d")
            );

            // We set the usable period to a set of
            // 1. All weekdays
            // 2. intersect with times from 9-5 daily
            tel.UseablePeriod = new GTS(QSI<TS>.CreateQSI(
                weekdays,
                nineToFive 
            ));

            var actualXml = R2SerializationHelper.SerializeAsString(tel);
            var inti = R2SerializationHelper.ParseString<TEL>(actualXml);
            Assert.AreEqual(tel, inti);
        }
Esempio n. 55
0
 public void TELExample7Test02()
 {
     var tel = new TEL("+13335551212;postd=2345",
         new CS<TelecommunicationAddressUse>[]{
             TelecommunicationAddressUse.WorkPlace,
             TelecommunicationAddressUse.Direct
         }
     );
     Assert.IsFalse(TEL.IsValidPhoneFlavor(tel));
 }
Esempio n. 56
0
        /// <summary>
        /// Example 68
        /// Creates a patient structure
        /// </summary>
        /// <param name="id">The unique identifier</param>
        /// <param name="name">The name of the patient</param>
        /// <param name="addr">The primary address</param>
        /// <param name="telecom">A primary telecom</param>
        /// <returns>A constructed patient structure</returns>
        public Patient CreatePatient(
                II id,
                EN name,
                AD addr,
                TEL telecom
            )
        {
            // Instantiate the object
            var retVal = new Patient();

            // return a value in a unit test
            // will result in Not Runnable
            return retVal;
        }
Esempio n. 57
0
        public void TELExample8Test02()
        {
            var tel = new TEL("tel:+190555525485");
            var weekdays = new PIVL<TS>(
                new IVL<TS>(DateTime.Parse("08-15-2011"), DateTime.Parse("08-19-2011")),
                new PQ(-1, "wk")
            );

            var nineToFive = new PIVL<TS>(
                // given low, high, and inaccurate width
                new IVL<TS>(DateTime.Parse("08-15-2011 09:00 AM"),
                    DateTime.Parse("08-19-2011 05:00 PM")),
                    new PQ(-1, "d")
                )
            {
                Operator = SetOperator.Intersect
            };
            tel.UseablePeriod = null;
            tel.Use = null;
            Assert.IsTrue(tel.Validate());
        }
Esempio n. 58
0
 public EHRRepository()
 {
     this.assignedRepositoryLocationName        = new STImpl();
     this.assignedRepositoryLocationTelecom     = new TELImpl();
     this.representedRepositoryJurisdictionName = new STImpl();
 }
Esempio n. 59
0
 internal void SetTelecom(TEL tel)
 {
     this.telecom = new List <TEL>();
     this.AddTelecom(tel);
 }
Esempio n. 60
0
        public void R2TELSerializationTest3()
        {
            TEL telType = new TEL("tel:",
                new CS<TelecommunicationAddressUse>[]{
                    TelecommunicationAddressUse.Home,
                });

            telType.Capabilities = null;
            telType.ValidTimeLow = null;
            telType.ValidTimeHigh = null;
            telType.NullFlavor = new CS<NullFlavor>(NullFlavor.Unknown);
            telType.UpdateMode = null;
            telType.UseablePeriod = null;

            var expectedXml = @"<test xmlns=""urn:hl7-org:v3"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" nullFlavor=""UNK""/>";
            var actualXml = R2SerializationHelper.SerializeAsString(telType);
            R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
        }