예제 #1
0
            public AttributListeType ToAttributListeType(WS_AS78205.EnglishAS78205Response addressResponse)
            {
                return(new AttributListeType()
                {
                    Egenskab = new EgenskabType[]
                    {
                        ToEgenskaberType()
                    },
                    RegisterOplysning = new RegisterOplysningType[]
                    {
                        ToRegisterOplysningType(addressResponse)
                    },

                    // Health information not implemented
                    SundhedOplysning = null,

                    // No extensions at the moment
                    LokalUdvidelse = null
                });
            }
예제 #2
0
        public RegistreringType1 ToRegistreringType1(Func <string, Guid> cpr2uuidFunc)
        {
            var addressResponse = new WS_AS78205.EnglishAS78205Response(AS78205Response);
            var detailsResponse = new WS_AS78207.EnglishAS78207Response(AS78207Response);

            var ret = new RegistreringType1()
            {
                AttributListe = detailsResponse.ToAttributListeType(addressResponse),
                TilstandListe = detailsResponse.ToTilstandListeType(),
                RelationListe = ToRelationListeType(detailsResponse, cpr2uuidFunc),

                AktoerRef        = Constants.Actor,
                CommentText      = Constants.CommentText,
                LivscyklusKode   = LivscyklusKodeType.Rettet,
                Tidspunkt        = TidspunktType.Create(detailsResponse.GetRegistrationDate()),
                Virkning         = null,
                SourceObjectsXml = Strings.SerializeObject(this)
            };

            ret.CalculateVirkning();
            return(ret);
        }
예제 #3
0
            public RegisterOplysningType ToRegisterOplysningType(WS_AS78205.EnglishAS78205Response addressResponse)
            {
                var ret = new RegisterOplysningType()
                {
                    Item     = null,
                    Virkning = VirkningType.Create(null, null)
                };

                // TODO: Always return CprBorgerType !!!!
                if (string.Equals(NationalityCode, Constants.DanishNationalityCode))
                {
                    ret.Item = new CprBorgerType()
                    {
                        PersonCivilRegistrationIdentifier = PNR,
                        PersonNationalityCode             = Schemas.Part.CountryIdentificationCodeType.Create(CprBroker.Schemas.Part._CountryIdentificationSchemeType.imk, NationalityCode),
                        FolkeregisterAdresse = addressResponse.ToAdresseType(),
                        // Research protection
                        ForskerBeskyttelseIndikator = Protection.Equals(Constants.ResearchProtection),
                        // Name and address protection
                        NavneAdresseBeskyttelseIndikator = Protection.Equals(Constants.AddressProtection),
                        // Church membership
                        // TODO: Shall this be ChurchRelationship = 'F'?
                        FolkekirkeMedlemIndikator = ChurchRelationship.Length > 0,
                        // No address note
                        AdresseNoteTekst = null,
                        //PNR validity status
                        // TODO: Shall this be set as other providers, false if status is 30,50,60 ?
                        PersonNummerGyldighedStatusIndikator = int.Parse(ReturnCode) < 10,

                        // TODO: Check if this is correct
                        TelefonNummerBeskyttelseIndikator = Protection.Equals(Constants.AddressProtection),
                    };
                    ret.Virkning.FraTidspunkt = TidspunktType.Create(Utilities.GetMaxDate(AddressDate, RelocationDate, ImmigrationDate));
                }
                else if (!string.IsNullOrEmpty(NationalityCode))
                {
                    // TODO: Validate all data in this structure
                    ret.Item = new UdenlandskBorgerType()
                    {
                        // Birth country.Not in KMD
                        FoedselslandKode = null,
                        // TODO: What is that?
                        PersonIdentifikator = "",
                        // Languages. Not implemented here
                        SprogKode = new CprBroker.Schemas.Part.CountryIdentificationCodeType[0],
                        // Citizenships
                        PersonNationalityCode = new CprBroker.Schemas.Part.CountryIdentificationCodeType[] { CprBroker.Schemas.Part.CountryIdentificationCodeType.Create(CprBroker.Schemas.Part._CountryIdentificationSchemeType.imk, NationalityCode) },
                        PersonCivilRegistrationReplacementIdentifier = PNR,
                    };
                    ret.Virkning.FraTidspunkt = TidspunktType.Create(Utilities.GetMaxDate(ImmigrationDate, AbroadDate));
                }
                else
                {
                    // TODO: Validate all data in this structure
                    ret.Item = new UkendtBorgerType()
                    {
                        PersonCivilRegistrationReplacementIdentifier = PNR,
                    };
                    ret.Virkning.FraTidspunkt = TidspunktType.Create(Utilities.GetMaxDate(AbroadDate, AddressDate, DisempowermentDate, ImmigrationDate, PaternityDate, RelocationDate, StatusDate));
                }
                return(ret);
            }