예제 #1
0
 private static Contact Create(ClientStage client, ClientStageRelationship relationship)
 {
     return(new Contact
     {
         Id = client.Id,
         Serial = client.Serial,
         FirstName = client.FirstName,
         MiddleName = client.MiddleName,
         LastName = client.LastName,
         DateOfBirth = client.DateOfBirth,
         Sex = client.Sex,
         Relation = null != relationship ? relationship.RelationName : string.Empty
     });
 }
        public async Task <IEnumerable <ClientStageRelationship> > Extract(Guid?htsClientId = null)
        {
            _clientStageRelationshipRepository.Clear();

            var subscriber = await _subscriberSystemRepository.GetDefaultAsync();

            if (null == subscriber)
            {
                throw new Exception("Default EMR NOT SET");
            }
            var clients = new List <ClientStageRelationship>();

            var indexRelations = _clientRelationshipRepository.GetIndexRelations();

            foreach (var relationship in indexRelations)
            {
                clients.Add(ClientStageRelationship.Create(relationship, subscriber));
            }

            return(clients.Where(x => !x.Id.IsNullOrEmpty()));
        }
예제 #3
0
 public static Contact CreateSecondary(ClientStage client, ClientStageRelationship relationship)
 {
     return(Create(client, relationship));
 }