Beispiel #1
0
 public personObject(amountType amount, personType guf, timeType time, genderType gender, string word)
 {
     this.Amount = amount;
     this.Guf    = guf;
     this.Time   = time;
     this.Gender = gender;
     this.Word   = word;
 }
Beispiel #2
0
        public static string BuildMessage(personType patient, params transaction[] transactions)
        {
            //Create new message
            var kmehrMsg = Builder.message(Builder.header(ServiceLocator.Current.GetInstance<IGlobalData>().HOSPITALhcparty, ServiceLocator.Current.GetInstance<IGlobalData>().GZOhcparty, null, null, null), null);

            var folder = BuildFolder(patient, transactions);

            // add folder to message
            Builder.add(kmehrMsg, folder);

            return Serializer.toXML(kmehrMsg);
        }
Beispiel #3
0
        public static folder BuildFolder(personType patient, params transaction[] transactions)
        {
            //create tranasaction folder
            var folder = Builder.folder(patient, null, null);

            //add transactionlist
            foreach (var transaction in transactions)
            {
                if (transaction != null)
                    Builder.add(folder, transaction);
            }
            return folder;
        }
        public KmehrPersonBuilder New(string id, string familyName, string[] firstNameLst, DateTime?birthDate = null, CDSEXvalues?sex = null)
        {
            _personType = new personType
            {
                id = new IDPATIENT[1]
                {
                    new IDPATIENT
                    {
                        S     = IDPATIENTschemes.IDPATIENT,
                        SV    = KmehrConstant.ReferenceVersion.ID_KMEHR_VERSION,
                        Value = id
                    }
                },
                firstname  = firstNameLst,
                familyname = familyName
            };
            if (birthDate != null)
            {
                _personType.birthdate = new dateType
                {
                    Items = new object[1]
                    {
                        birthDate.Value.ToString("yyyy-mm-dd")
                    },
                    ItemsElementName = new ItemsChoiceType1[1]
                    {
                        ItemsChoiceType1.date
                    }
                };
            }

            if (sex != null)
            {
                _personType.sex = new sexType
                {
                    cd = new CDSEX
                    {
                        SV    = KmehrConstant.ReferenceVersion.CD_SEX_VERSION,
                        S     = KmehrConstant.ReferenceNames.SEX,
                        Value = sex.Value
                    }
                };
            }

            return(this);
        }
Beispiel #5
0
        private static personType ReadPerson( XElement element )
        {
            element.RequireArgument<XElement>( "element" ).NotNull<XElement>();

            XNamespace ns = element.Name.Namespace;
            personType person = new personType();
            if( element.Element( ns + "name" ) != null )
                person.name = element.Element( ns + "name" ).Value;
            if( element.Element( ns + "link" ) != null )
                person.link = ReadLink(element.Element( ns + "link" ) );
            if( element.Element( ns + "email" ) != null )
                person.email = ReadEmail(element.Element( ns + "email" ) );

            return person;
        }