Esempio n. 1
0
        public FhirModel.Organization GetResource()
        {
            var Resource = new FhirModel.Organization();

            Resource.Id = GetResourceId();

            IPyroFhirServerCodeSystem.SetProtectedMetaTag(Resource);
            Resource.Meta.LastUpdated = MasterLastUpdated;
            Resource.Identifier       = new List <FhirModel.Identifier>()
            {
                IPyroHealthCodeSystem.GetIdentifier(CodeSystems.PyroHealth.Codes.PyroHealth)
            };
            Resource.Active = true;
            Resource.Name   = GetResourceId();
            var AngusContactDetails = Elements.PyroHealthContactDetailAngusMillar.GetContactDetail();

            Resource.Telecom  = AngusContactDetails.Telecom;
            Resource.Endpoint = new List <FhirModel.ResourceReference>()
            {
                new FhirModel.ResourceReference("https://pyrohealth.net/")
            };
            Resource.Contact = new List <FhirModel.Organization.ContactComponent>();
            var ContactComponent = new FhirModel.Organization.ContactComponent();

            Resource.Contact.Add(ContactComponent);
            ContactComponent.Name      = new FhirModel.HumanName();
            ContactComponent.Name.Text = AngusContactDetails.Name;
            ContactComponent.Telecom   = AngusContactDetails.Telecom;

            return(Resource);
        }
Esempio n. 2
0
        public void CreateEditDelete()
        {
            var furore = new Organization
            {
                Name = "Furore",
                Identifier = new List<Identifier> { new Identifier("http://hl7.org/test/1", "3141") },
                Telecom = new List<Contact> { new Contact { System = Contact.ContactSystem.Phone, Value = "+31-20-3467171" } }
            };

            FhirClient client = new FhirClient(testEndpoint);
            var tags = new List<Tag> { new Tag("http://nu.nl/testname", Tag.FHIRTAGNS, "TestCreateEditDelete") };

            var fe = client.Create(furore,tags);

            Assert.IsNotNull(furore);
            Assert.IsNotNull(fe);
            Assert.IsNotNull(fe.Id);
            Assert.IsNotNull(fe.SelfLink);
            Assert.AreNotEqual(fe.Id,fe.SelfLink);
            Assert.IsNotNull(fe.Tags);
            Assert.AreEqual(1, fe.Tags.Count());
            Assert.AreEqual(fe.Tags.First(), tags[0]);
            createdTestOrganization = fe.Id;

            fe.Resource.Identifier.Add(new Identifier("http://hl7.org/test/2", "3141592"));

            var fe2 = client.Update(fe);

            Assert.IsNotNull(fe2);
            Assert.AreEqual(fe.Id, fe2.Id);
            Assert.AreNotEqual(fe.SelfLink, fe2.SelfLink);
            Assert.IsNotNull(fe2.Tags);
            Assert.AreEqual(1, fe2.Tags.Count());
            Assert.AreEqual(fe2.Tags.First(), tags[0]);

            client.Delete(fe2.Id);

            try
            {
                fe = client.Read<Organization>(ResourceLocation.GetIdFromResourceId(fe.Id));
                Assert.Fail();
            }
            catch
            {
                Assert.IsTrue(client.LastResponseDetails.Result == HttpStatusCode.Gone);
            }

            Assert.IsNull(fe);
        }
Esempio n. 3
0
        internal static Organization CreateOrganizationResource()
        {
            // Create new Organization resource
            Organization res = new Organization();

            // Allocate the logical resource Id - this is what the resource is referenced by
            res.Id = "13daadee-26e1-4d6a-9e6a-7f4af9b58878";

            // Add the profile for this resource (from the FGM DMS)
            Meta metadata = new Meta();
            metadata.Profile = new string[] { "urn:fhir.nhs.uk:profile/NHS-FGM-Organization" };
            res.Meta = metadata;

            // Add the business idetifier for the organisation, plus the organisation name
            res.Identifier = new List<Identifier>();
            Identifier id = new Identifier("urn:fhir.nhs.uk/id/ODSOrganisationCode", "RKE");
            res.Identifier.Add(id);
            res.Name = "THE WHITTINGTON HOSPITAL NHS TRUST";

            return res;
        }
        public void CreateDynamic()
        {
            Resource furore = new Organization
            {
                Name = "Furore",
                Identifier = new List<Identifier> { new Identifier("http://hl7.org/test/1", "3141") },
                Telecom = new List<ContactPoint> { 
                    new ContactPoint { System = ContactPoint.ContactPointSystem.Phone, Value = "+31-20-3467171", Use = ContactPoint.ContactPointUse.Work },
                    new ContactPoint { System = ContactPoint.ContactPointSystem.Fax, Value = "+31-20-3467172" } 
                }
            };

            FhirClient client = new FhirClient(testEndpoint);

            var fe = client.Create(furore);
            Assert.IsNotNull(fe);
        }
		public void CreateEditDeleteAsync()
		{
			var furore = new Organization
			{
				Name = "Furore",
				Identifier = new List<Identifier> { new Identifier("http://hl7.org/test/1", "3141") },
				Telecom = new List<Contact> { new Contact { System = Contact.ContactSystem.Phone, Value = "+31-20-3467171" } }
			};

			FhirClient client = new FhirClient(testEndpoint);
			var tags = new List<Tag> { new Tag("http://nu.nl/testname", Tag.FHIRTAGSCHEME_GENERAL, "TestCreateEditDelete") };

			var fe = client.CreateAsync<Organization>(furore, tags: tags, refresh: true).Result;

			Assert.IsNotNull(furore);
			Assert.IsNotNull(fe);
			Assert.IsNotNull(fe.Id);
			Assert.IsNotNull(fe.SelfLink);
			Assert.AreNotEqual(fe.Id, fe.SelfLink);
			Assert.IsNotNull(fe.Tags);
			Assert.AreEqual(1, fe.Tags.Count(), "Tag count on new organization record don't match");
			Assert.AreEqual(fe.Tags.First(), tags[0]);
			createdTestOrganizationUrl = fe.Id;

			fe.Resource.Identifier.Add(new Identifier("http://hl7.org/test/2", "3141592"));
			var fe2 = client.UpdateAsync(fe, refresh: true).Result;

			Assert.IsNotNull(fe2);
			Assert.AreEqual(fe.Id, fe2.Id);
			Assert.AreNotEqual(fe.SelfLink, fe2.SelfLink);
			Assert.AreEqual(2, fe2.Resource.Identifier.Count);

			Assert.IsNotNull(fe2.Tags);
			Assert.AreEqual(1, fe2.Tags.Count(), "Tag count on updated organization record don't match");
			Assert.AreEqual(fe2.Tags.First(), tags[0]);

			fe.Resource.Identifier.Add(new Identifier("http://hl7.org/test/3", "3141592"));
			var fe3 = client.UpdateAsync(fe2.Id, fe.Resource, refresh: true).Result;
			Assert.IsNotNull(fe3);
			Assert.AreEqual(3, fe3.Resource.Identifier.Count);

			client.DeleteAsync(fe3).Wait();

			try
			{
				// Get most recent version
				fe = client.ReadAsync<Organization>(new ResourceIdentity(fe.Id)).Result;
				Assert.Fail();
			}
			catch
			{
				Assert.IsTrue(client.LastResponseDetails.Result == HttpStatusCode.Gone);
			}
		}
        /// <summary>
        /// Parse Organization
        /// </summary>
        public static Hl7.Fhir.Model.Organization ParseOrganization(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Organization existingInstance = null)
        {
            Hl7.Fhir.Model.Organization result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Organization();
            string currentElementName          = reader.CurrentElementName;

            reader.EnterElement();

            while (reader.HasMoreElements())
            {
                var atName = reader.CurrentElementName;
                // Parse element extension
                if (atName == "extension")
                {
                    result.Extension = new List <Hl7.Fhir.Model.Extension>();
                    reader.EnterArray();

                    while (ParserUtils.IsAtArrayElement(reader, "extension"))
                    {
                        result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));
                    }

                    reader.LeaveArray();
                }

                // Parse element language
                else if (atName == "language")
                {
                    result.LanguageElement = CodeParser.ParseCode(reader, errors);
                }

                // Parse element text
                else if (atName == "text")
                {
                    result.Text = NarrativeParser.ParseNarrative(reader, errors);
                }

                // Parse element contained
                else if (atName == "contained")
                {
                    result.Contained = new List <Hl7.Fhir.Model.Resource>();
                    reader.EnterArray();

                    while (ParserUtils.IsAtArrayElement(reader, "contained"))
                    {
                        result.Contained.Add(ParserUtils.ParseContainedResource(reader, errors));
                    }

                    reader.LeaveArray();
                }

                // Parse element _id
                else if (atName == "_id")
                {
                    result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));
                }

                // Parse element identifier
                else if (atName == "identifier")
                {
                    result.Identifier = new List <Hl7.Fhir.Model.Identifier>();
                    reader.EnterArray();

                    while (ParserUtils.IsAtArrayElement(reader, "identifier"))
                    {
                        result.Identifier.Add(IdentifierParser.ParseIdentifier(reader, errors));
                    }

                    reader.LeaveArray();
                }

                // Parse element name
                else if (atName == "name")
                {
                    result.NameElement = FhirStringParser.ParseFhirString(reader, errors);
                }

                // Parse element type
                else if (atName == "type")
                {
                    result.Type = CodeableConceptParser.ParseCodeableConcept(reader, errors);
                }

                // Parse element telecom
                else if (atName == "telecom")
                {
                    result.Telecom = new List <Hl7.Fhir.Model.Contact>();
                    reader.EnterArray();

                    while (ParserUtils.IsAtArrayElement(reader, "telecom"))
                    {
                        result.Telecom.Add(ContactParser.ParseContact(reader, errors));
                    }

                    reader.LeaveArray();
                }

                // Parse element address
                else if (atName == "address")
                {
                    result.Address = new List <Hl7.Fhir.Model.Address>();
                    reader.EnterArray();

                    while (ParserUtils.IsAtArrayElement(reader, "address"))
                    {
                        result.Address.Add(AddressParser.ParseAddress(reader, errors));
                    }

                    reader.LeaveArray();
                }

                // Parse element partOf
                else if (atName == "partOf")
                {
                    result.PartOf = ResourceReferenceParser.ParseResourceReference(reader, errors);
                }

                // Parse element contact
                else if (atName == "contact")
                {
                    result.Contact = new List <Hl7.Fhir.Model.Organization.OrganizationContactComponent>();
                    reader.EnterArray();

                    while (ParserUtils.IsAtArrayElement(reader, "contact"))
                    {
                        result.Contact.Add(OrganizationParser.ParseOrganizationContactComponent(reader, errors));
                    }

                    reader.LeaveArray();
                }

                // Parse element active
                else if (atName == "active")
                {
                    result.ActiveElement = FhirBooleanParser.ParseFhirBoolean(reader, errors);
                }

                else
                {
                    errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
                    reader.SkipSubElementsFor(currentElementName);
                    result = null;
                }
            }

            reader.LeaveElement();
            return(result);
        }
Esempio n. 7
0
        public static void SerializeOrganization(Hl7.Fhir.Model.Organization value, IFhirWriter writer, bool summary)
        {
            writer.WriteStartRootObject("Organization");
            writer.WriteStartComplexContent();

            // Serialize element _id
            if (value.LocalIdElement != null)
            {
                writer.WritePrimitiveContents("_id", value.LocalIdElement, XmlSerializationHint.Attribute);
            }

            // Serialize element extension
            if (value.Extension != null && !summary && value.Extension.Count > 0)
            {
                writer.WriteStartArrayElement("extension");
                foreach (var item in value.Extension)
                {
                    writer.WriteStartArrayMember("extension");
                    ExtensionSerializer.SerializeExtension(item, writer, summary);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element language
            if (value.LanguageElement != null && !summary)
            {
                writer.WriteStartElement("language");
                CodeSerializer.SerializeCode(value.LanguageElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element text
            if (value.Text != null && !summary)
            {
                writer.WriteStartElement("text");
                NarrativeSerializer.SerializeNarrative(value.Text, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element contained
            if (value.Contained != null && !summary && value.Contained.Count > 0)
            {
                writer.WriteStartArrayElement("contained");
                foreach (var item in value.Contained)
                {
                    writer.WriteStartArrayMember("contained");
                    FhirSerializer.SerializeResource(item, writer, summary);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element identifier
            if (value.Identifier != null && !summary && value.Identifier.Count > 0)
            {
                writer.WriteStartArrayElement("identifier");
                foreach (var item in value.Identifier)
                {
                    writer.WriteStartArrayMember("identifier");
                    IdentifierSerializer.SerializeIdentifier(item, writer, summary);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element name
            if (value.NameElement != null && !summary)
            {
                writer.WriteStartElement("name");
                FhirStringSerializer.SerializeFhirString(value.NameElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element type
            if (value.Type != null && !summary)
            {
                writer.WriteStartElement("type");
                CodeableConceptSerializer.SerializeCodeableConcept(value.Type, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element telecom
            if (value.Telecom != null && !summary && value.Telecom.Count > 0)
            {
                writer.WriteStartArrayElement("telecom");
                foreach (var item in value.Telecom)
                {
                    writer.WriteStartArrayMember("telecom");
                    ContactSerializer.SerializeContact(item, writer, summary);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element address
            if (value.Address != null && !summary && value.Address.Count > 0)
            {
                writer.WriteStartArrayElement("address");
                foreach (var item in value.Address)
                {
                    writer.WriteStartArrayMember("address");
                    AddressSerializer.SerializeAddress(item, writer, summary);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element partOf
            if (value.PartOf != null && !summary)
            {
                writer.WriteStartElement("partOf");
                ResourceReferenceSerializer.SerializeResourceReference(value.PartOf, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element contact
            if (value.Contact != null && !summary && value.Contact.Count > 0)
            {
                writer.WriteStartArrayElement("contact");
                foreach (var item in value.Contact)
                {
                    writer.WriteStartArrayMember("contact");
                    OrganizationSerializer.SerializeOrganizationContactComponent(item, writer, summary);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element active
            if (value.ActiveElement != null && !summary)
            {
                writer.WriteStartElement("active");
                FhirBooleanSerializer.SerializeFhirBoolean(value.ActiveElement, writer, summary);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
            writer.WriteEndRootObject();
        }
Esempio n. 8
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as ProcessResponse;

            if (dest == null)
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }

            base.CopyTo(dest);
            if (Identifier != null)
            {
                dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
            }
            if (StatusElement != null)
            {
                dest.StatusElement = (Code <Hl7.Fhir.Model.FinancialResourceStatusCodes>)StatusElement.DeepCopy();
            }
            if (CreatedElement != null)
            {
                dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy();
            }
            if (Organization != null)
            {
                dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy();
            }
            if (Request != null)
            {
                dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy();
            }
            if (Outcome != null)
            {
                dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy();
            }
            if (DispositionElement != null)
            {
                dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy();
            }
            if (RequestProvider != null)
            {
                dest.RequestProvider = (Hl7.Fhir.Model.ResourceReference)RequestProvider.DeepCopy();
            }
            if (RequestOrganization != null)
            {
                dest.RequestOrganization = (Hl7.Fhir.Model.ResourceReference)RequestOrganization.DeepCopy();
            }
            if (Form != null)
            {
                dest.Form = (Hl7.Fhir.Model.CodeableConcept)Form.DeepCopy();
            }
            if (ProcessNote != null)
            {
                dest.ProcessNote = new List <Hl7.Fhir.Model.ProcessResponse.ProcessNoteComponent>(ProcessNote.DeepCopy());
            }
            if (Error != null)
            {
                dest.Error = new List <Hl7.Fhir.Model.CodeableConcept>(Error.DeepCopy());
            }
            if (CommunicationRequest != null)
            {
                dest.CommunicationRequest = new List <Hl7.Fhir.Model.ResourceReference>(CommunicationRequest.DeepCopy());
            }
            return(dest);
        }
Esempio n. 9
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as ProcessRequest;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (ActionElement != null)
                {
                    dest.ActionElement = (Code <Hl7.Fhir.Model.ProcessRequest.ActionList>)ActionElement.DeepCopy();
                }
                if (Identifier != null)
                {
                    dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
                }
                if (Ruleset != null)
                {
                    dest.Ruleset = (Hl7.Fhir.Model.Coding)Ruleset.DeepCopy();
                }
                if (OriginalRuleset != null)
                {
                    dest.OriginalRuleset = (Hl7.Fhir.Model.Coding)OriginalRuleset.DeepCopy();
                }
                if (CreatedElement != null)
                {
                    dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy();
                }
                if (Target != null)
                {
                    dest.Target = (Hl7.Fhir.Model.ResourceReference)Target.DeepCopy();
                }
                if (Provider != null)
                {
                    dest.Provider = (Hl7.Fhir.Model.ResourceReference)Provider.DeepCopy();
                }
                if (Organization != null)
                {
                    dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy();
                }
                if (Request != null)
                {
                    dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy();
                }
                if (Response != null)
                {
                    dest.Response = (Hl7.Fhir.Model.ResourceReference)Response.DeepCopy();
                }
                if (NullifyElement != null)
                {
                    dest.NullifyElement = (Hl7.Fhir.Model.FhirBoolean)NullifyElement.DeepCopy();
                }
                if (ReferenceElement != null)
                {
                    dest.ReferenceElement = (Hl7.Fhir.Model.FhirString)ReferenceElement.DeepCopy();
                }
                if (Item != null)
                {
                    dest.Item = new List <Hl7.Fhir.Model.ProcessRequest.ItemsComponent>(Item.DeepCopy());
                }
                if (IncludeElement != null)
                {
                    dest.IncludeElement = new List <Hl7.Fhir.Model.FhirString>(IncludeElement.DeepCopy());
                }
                if (ExcludeElement != null)
                {
                    dest.ExcludeElement = new List <Hl7.Fhir.Model.FhirString>(ExcludeElement.DeepCopy());
                }
                if (Period != null)
                {
                    dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy();
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }
Esempio n. 10
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as ProcessResponse;

            if (dest == null)
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }

            base.CopyTo(dest);
            if (Identifier != null)
            {
                dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
            }
            if (Request != null)
            {
                dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy();
            }
            if (Outcome != null)
            {
                dest.Outcome = (Hl7.Fhir.Model.Coding)Outcome.DeepCopy();
            }
            if (DispositionElement != null)
            {
                dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy();
            }
            if (Ruleset != null)
            {
                dest.Ruleset = (Hl7.Fhir.Model.Coding)Ruleset.DeepCopy();
            }
            if (OriginalRuleset != null)
            {
                dest.OriginalRuleset = (Hl7.Fhir.Model.Coding)OriginalRuleset.DeepCopy();
            }
            if (CreatedElement != null)
            {
                dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy();
            }
            if (Organization != null)
            {
                dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy();
            }
            if (RequestProvider != null)
            {
                dest.RequestProvider = (Hl7.Fhir.Model.ResourceReference)RequestProvider.DeepCopy();
            }
            if (RequestOrganization != null)
            {
                dest.RequestOrganization = (Hl7.Fhir.Model.ResourceReference)RequestOrganization.DeepCopy();
            }
            if (Form != null)
            {
                dest.Form = (Hl7.Fhir.Model.Coding)Form.DeepCopy();
            }
            if (Notes != null)
            {
                dest.Notes = new List <Hl7.Fhir.Model.ProcessResponse.NotesComponent>(Notes.DeepCopy());
            }
            if (Error != null)
            {
                dest.Error = new List <Hl7.Fhir.Model.Coding>(Error.DeepCopy());
            }
            return(dest);
        }
Esempio n. 11
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as PaymentReconciliation;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (Identifier != null)
                {
                    dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
                }
                if (Request != null)
                {
                    dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy();
                }
                if (OutcomeElement != null)
                {
                    dest.OutcomeElement = (Code <Hl7.Fhir.Model.RemittanceOutcome>)OutcomeElement.DeepCopy();
                }
                if (DispositionElement != null)
                {
                    dest.DispositionElement = (Hl7.Fhir.Model.FhirString)DispositionElement.DeepCopy();
                }
                if (Ruleset != null)
                {
                    dest.Ruleset = (Hl7.Fhir.Model.Coding)Ruleset.DeepCopy();
                }
                if (OriginalRuleset != null)
                {
                    dest.OriginalRuleset = (Hl7.Fhir.Model.Coding)OriginalRuleset.DeepCopy();
                }
                if (CreatedElement != null)
                {
                    dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy();
                }
                if (Period != null)
                {
                    dest.Period = (Hl7.Fhir.Model.Period)Period.DeepCopy();
                }
                if (Organization != null)
                {
                    dest.Organization = (Hl7.Fhir.Model.ResourceReference)Organization.DeepCopy();
                }
                if (RequestProvider != null)
                {
                    dest.RequestProvider = (Hl7.Fhir.Model.ResourceReference)RequestProvider.DeepCopy();
                }
                if (RequestOrganization != null)
                {
                    dest.RequestOrganization = (Hl7.Fhir.Model.ResourceReference)RequestOrganization.DeepCopy();
                }
                if (Detail != null)
                {
                    dest.Detail = new List <Hl7.Fhir.Model.PaymentReconciliation.DetailsComponent>(Detail.DeepCopy());
                }
                if (Form != null)
                {
                    dest.Form = (Hl7.Fhir.Model.Coding)Form.DeepCopy();
                }
                if (Total != null)
                {
                    dest.Total = (Hl7.Fhir.Model.Money)Total.DeepCopy();
                }
                if (Note != null)
                {
                    dest.Note = new List <Hl7.Fhir.Model.PaymentReconciliation.NotesComponent>(Note.DeepCopy());
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }