Exemplo n.º 1
0
        public async Task <OrganizationCreationResponse> CreateAsync(OrganizationForCreation org)
        {
            var Result = new OrganizationCreationResponse {
                Data = new NewOrganization()
            };
            Organization organization = new Organization
            {
                Name    = org.name,
                Address = GetFHIROrgAddresses(org),
                Telecom = GetFHIROrgTelecoms(org),
                Type    = GetFHIROrgType(org)
            };

            Organization FHIROrganization = await _client.CreateAsync(organization).ConfigureAwait(false);

            Result.Data.OrganizationId = FHIROrganization.Id;//1ce02b5e-a9ae-4f4a-a2b9-cc0a8d4c987b

            return(Result);
        }
Exemplo n.º 2
0
        public async Task <OrganizationCreationResponse> UpdateAsync(Guid id, OrganizationForCreation org)
        {
            var Result = new OrganizationCreationResponse {
                Data = new NewOrganization()
            };

            Organization organization = await GetOrganizationFromFHIRAsync(id.ToString()).ConfigureAwait(false);

            organization.Name    = org.name;
            organization.Address = GetFHIROrgAddresses(org);
            organization.Telecom = GetFHIROrgTelecoms(org);
            organization.Type    = GetFHIROrgType(org);

            Organization FHIROrganization = await _client.UpdateAsync(organization).ConfigureAwait(false);

            Result.Data.OrganizationId = FHIROrganization.Id;//48fc2852-f0c3-4e94-af17-2bf57917eeb9

            return(Result);
        }