Beispiel #1
0
        private static StudySubjectWithIdentifiers Person(
            string subjectIdentifier,
            string firstName     = null,
            string lastname      = null,
            DateTime?dateOfBirth = null,
            params IIdentifierValueDto[] otherIdentifiers
            )
        {
            var identifiers = new List <IIdentifierValueDto>(otherIdentifiers);

            if (firstName != null || lastname != null)
            {
                identifiers.Add(ClientIdentifierValues.Name(firstName, lastname));
            }

            if (dateOfBirth != null)
            {
                identifiers.Add(KnownIdentifiers.DateOfBirth.Value(dateOfBirth.Value));
            }

            return(new StudySubjectWithIdentifiers
            {
                subjectIdentifier = subjectIdentifier,
                identifiers = identifiers
            });
        }
Beispiel #2
0
        public void CanParseNameIdentifier()
        {
            var parser = CreateParser(Identifiers.Definitions.Name);

            var identifierValue = parser.Parse(
                IdentifierElement("name",
                                  IdentifierElement("given", "Fred"),
                                  IdentifierElement("family", "Whitton")
                                  )
                );

            identifierValue.Should().BeEquivalentTo(ClientIdentifierValues.Name("Fred", "Whitton"));
        }