/// <summary>
        /// Create Addressee Organisation
        /// </summary>
        /// <returns>(IParticipationAddressee) Addressee</returns>
        private static IParticipationAddressee CreateAddresseeOrganisation(Boolean mandatorySectionsOnly)
        {
            var addressee = SpecialistLetter.CreateAddressee();

            addressee.Participant = SpecialistLetter.CreateParticipantAddressee();

            addressee.Participant.Organisation             = BaseCDAModel.CreateOrganisation();
            addressee.Participant.Organisation.Name        = "Bay Hill Hospital";
            addressee.Participant.Organisation.NameUsage   = OrganisationNameUsage.Other;
            addressee.Participant.Organisation.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, "8003620000045562")
            };
            addressee.Participant.Organisation.Department = "Some department organisation";

            var address = BaseCDAModel.CreateAddress();

            address.AddressPurpose                 = AddressPurpose.Business;
            address.AustralianAddress              = BaseCDAModel.CreateAustralianAddress();
            address.AustralianAddress.PostCode     = "4012";
            address.AustralianAddress.StreetName   = "Johnson St";
            address.AustralianAddress.StreetNumber = 12;
            address.AustralianAddress.StreetSuffix = StreetSuffix.South;
            address.AustralianAddress.StreetType   = StreetType.Street;

            addressee.Participant.Addresses = new List <IAddress>
            {
                address
            };

            addressee.Participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail>
            {
                BaseCDAModel.CreateElectronicCommunicationDetail("*****@*****.**", ElectronicCommunicationMedium.Email, ElectronicCommunicationUsage.WorkPlace),
                BaseCDAModel.CreateElectronicCommunicationDetail("134567891", ElectronicCommunicationMedium.Telephone, new List <ElectronicCommunicationUsage>
                {
                    //ElectronicCommunicationUsage.PrimaryHome, ElectronicCommunicationUsage.MobileContact
                    ElectronicCommunicationUsage.WorkPlace
                }),
                BaseCDAModel.CreateElectronicCommunicationDetail("675675675676", ElectronicCommunicationMedium.Telephone, new List <ElectronicCommunicationUsage>
                {
                    //ElectronicCommunicationUsage.MobileContact
                    ElectronicCommunicationUsage.WorkPlace
                }),
            };

            if (!mandatorySectionsOnly)
            {
                addressee.Role = BaseCDAModel.CreateRole(HealthcareFacilityTypeCodes.GeneralPractice);
            }
            else
            {
                addressee.Role = BaseCDAModel.CreateRole(HealthcareFacilityTypeCodes.RetailPharmacy);
            }

            return(addressee);
        }
        private static IParticipationAcdCustodian CreateAcdCustodianOrganisation(string name, string department, string id,
                                                                                 string addressLine, string phone, bool mandatoryOnly)
        {
            var custodianParticipation = AcdCustodianRecord.CreateParticipationAcdCustodian();

            custodianParticipation.ParticipationPeriod = BaseCDAModel.CreateInterval(
                new ISO8601DateTime(DateTime.Now.AddDays(-50)),
                new ISO8601DateTime(DateTime.Now));

            custodianParticipation.Role        = BaseCDAModel.CreateRole(Occupation.GeneralMedicalPractitioner);
            custodianParticipation.Participant = AcdCustodianRecord.CreateAcdCustodian();

            IOrganisation organisation = BaseCDAModel.CreateOrganisation();

            organisation.Name        = name;
            organisation.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, id)
            };

            custodianParticipation.Participant.Organisation = organisation;

            if (!mandatoryOnly)
            {
                organisation.Department = department;
                organisation.NameUsage  = OrganisationNameUsage.EnterpriseName;

                // Address
                IAddressAustralian address1 = BaseCDAModel.CreateAddress();
                address1.AddressPurpose    = AddressPurpose.Residential;
                address1.AustralianAddress = BaseCDAModel.CreateAustralianAddress();
                address1.AustralianAddress.UnstructuredAddressLines = new List <string> {
                    addressLine
                };
                address1.AustralianAddress.SuburbTownLocality = "Nehtaville";
                address1.AustralianAddress.State             = AustralianState.QLD;
                address1.AustralianAddress.PostCode          = "5555";
                address1.AustralianAddress.DeliveryPointId   = 32568931;
                custodianParticipation.Participant.Addresses = new List <IAddressAustralian> {
                    address1
                };

                // Communication
                var electronicCommunicationDetail = BaseCDAModel.CreateElectronicCommunicationDetail
                                                    (
                    phone,
                    ElectronicCommunicationMedium.Telephone,
                    ElectronicCommunicationUsage.WorkPlace
                                                    );
                custodianParticipation.Participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail> {
                    electronicCommunicationDetail
                };
            }

            return(custodianParticipation);
        }
コード例 #3
0
        /// <summary>
        /// Creates and Hydrates an IParticipationHealthcareFacility
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated IParticipationHealthcareFacility</returns>
        public static IParticipationHealthcareFacility PopulateHealthcareFacility(bool mandatoryOnly)
        {
            var participation = Nehta.VendorLibrary.CDA.Common.PCML.CreateHealthcareFacility();

            participation.ParticipationPeriod = BaseCDAModel.CreateInterval(new ISO8601DateTime(DateTime.Now), new ISO8601DateTime(DateTime.Now));

            participation.Participant = BaseCDAModel.CreateParticipantForHealthcareFacility();
            participation.Participant.Organisation = BaseCDAModel.CreateOrganisation();

            participation.Role = BaseCDAModel.CreateCodableText(NullFlavour.NoInformation);

            // HealthcareFacility > Participant > Entity Identifier
            participation.Participant.Organisation.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateIdentifier("HealthcareFacility", null, null, "1.2.3.4.5.66666", null),
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, "8003620833333789")
            };

            // Organisation Name
            participation.Participant.Organisation.Name = "West End Healthiness";

            // HealthcareFacility > Address
            var address1 = BaseCDAModel.CreateAddress();

            address1.AddressPurpose    = AddressPurpose.Business;
            address1.AustralianAddress = BaseCDAModel.CreateAustralianAddress();
            address1.AustralianAddress.UnstructuredAddressLines = new List <string> {
                "1 Clinician Street"
            };
            address1.AustralianAddress.SuburbTownLocality = "Nehtaville";
            address1.AustralianAddress.State           = AustralianState.QLD;
            address1.AustralianAddress.PostCode        = "5555";
            address1.AustralianAddress.DeliveryPointId = 32568931;

            participation.Participant.Addresses = new List <IAddress> {
                address1
            };

            if (!mandatoryOnly)
            {
                // Electronic Communication Details
                participation.Participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail>
                {
                    BaseCDAModel.CreateElectronicCommunicationDetail("0712341234", ElectronicCommunicationMedium.Telephone, ElectronicCommunicationUsage.WorkPlace),
                    BaseCDAModel.CreateElectronicCommunicationDetail("0712341236", ElectronicCommunicationMedium.Fax, ElectronicCommunicationUsage.WorkPlace),
                };

                // Organisation Continued
                participation.Participant.Organisation.NameUsage  = OrganisationNameUsage.LocallyUsedName;
                participation.Participant.Organisation.Department = "General Health";
            }

            return(participation);
        }
        /// <summary>
        /// Creates and Hydrates an IParticipationHealthcareFacility
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated IParticipationHealthcareFacility</returns>
        public static void HydrateHealthcareFacility(IParticipationHealthcareFacility participation, bool mandatoryOnly)
        {
            participation.ParticipationPeriod = BaseCDAModel.CreateInterval(new ISO8601DateTime(DateTime.Now), new ISO8601DateTime(DateTime.Now));

            participation.Participant = BaseCDAModel.CreateParticipantForHealthcareFacility();
            participation.Participant.Organisation = BaseCDAModel.CreateOrganisation();

            // HealthcareFacility > Participant > Entity Identifier
            participation.Participant.Organisation.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateIdentifier("Test Authority", null, null, "2.999.1234567890", null),
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, "8003620833333789")
            };

            // Organisation Name
            participation.Participant.Organisation.Name = "West End Healthiness";

            // HealthcareFacility > Address
            var address1 = BaseCDAModel.CreateAddress();

            address1.AddressPurpose    = AddressPurpose.Business;
            address1.AustralianAddress = BaseCDAModel.CreateAustralianAddress();
            address1.AustralianAddress.UnstructuredAddressLines = new List <string> {
                "1 Clinician Street"
            };
            address1.AustralianAddress.SuburbTownLocality = "Nehtaville";
            address1.AustralianAddress.State    = AustralianState.QLD;
            address1.AustralianAddress.PostCode = "5555";

            participation.Participant.Addresses = new List <IAddress> {
                address1
            };

            if (!mandatoryOnly)
            {
                // Role
                participation.Role = BaseCDAModel.CreateRole(Occupation.Legislatorsnfd);

                // Organisation Continued
                participation.Participant.Organisation.NameUsage  = OrganisationNameUsage.LocallyUsedName;
                participation.Participant.Organisation.Department = "General Health";

                participation.Participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail>
                {
                    BaseCDAModel.CreateElectronicCommunicationDetail("0712341234", ElectronicCommunicationMedium.Telephone, ElectronicCommunicationUsage.WorkPlace),
                    BaseCDAModel.CreateElectronicCommunicationDetail("0712341236", ElectronicCommunicationMedium.Fax, ElectronicCommunicationUsage.WorkPlace),
                };
            }
        }
コード例 #5
0
        /// <summary>
        /// Creates a PathologyMetadata instance for this sample.
        /// </summary>
        /// <returns></returns>
        public static PathologyMetadata CreateRequiredMetadataForPathologyCdaTransform()
        {
            PathologyMetadata metadata = new PathologyMetadata();

            // Author organisation HPIO
            metadata.AuthorOrganisationHpio = "8003628233352432";

            // Report identifier
            metadata.ReportIdentifier = BaseCDAModel.CreateIdentifier("1.2.36.1.2001.1005.54.8003628233352432", "HOM07051718571.7841");

            // Requester order identifier
            metadata.RequesterOrderIdentifier = BaseCDAModel.CreateIdentifier("1.2.36.1.2001.1005.52.8003628233352432", "100041");

            // Reporting pathologist
            metadata.ReportingPathologist                  = new ReportingPathologist();
            metadata.ReportingPathologist.Hpii             = "8003610102030405"; // Hpii must be set here, or provided in OBR-32 of HL7 V2 report
            metadata.ReportingPathologist.OrganisationHpio = "8003628233352432";
            metadata.ReportingPathologist.Role             = Occupation.Pathologist;

            // Reporting pathologist - address
            var address = BaseCDAModel.CreateAddress();

            address.AddressPurpose    = AddressPurpose.Business;
            address.AustralianAddress = BaseCDAModel.CreateAustralianAddress();
            address.AustralianAddress.UnstructuredAddressLines = new List <string> {
                "400 George Street"
            };
            address.AustralianAddress.PostCode    = "4000";
            address.AustralianAddress.State       = AustralianState.QLD;
            metadata.ReportingPathologist.Address = new List <IAddress>()
            {
                address
            };

            // Reporting pathologist - contact details
            var coms = BaseCDAModel.CreateElectronicCommunicationDetail(
                "(08) 8888 6666",
                ElectronicCommunicationMedium.Telephone,
                ElectronicCommunicationUsage.WorkPlace);

            metadata.ReportingPathologist.ContactDetails = new List <ElectronicCommunicationDetail>()
            {
                coms
            };

            return(metadata);
        }
コード例 #6
0
        /// <summary>
        /// Creates an AustralianAddress instance from an XAD instance.
        /// </summary>
        /// <param name="name">The HL7 V2 XAD instance.</param>
        /// <returns></returns>
        internal static IAddress GetAustralianAddress(XAD xad)
        {
            AustralianState addressState;
            var             addressStateSpecified = Enum.TryParse(xad.stateorprovince, out addressState);

            var address = BaseCDAModel.CreateAddress();

            address.AustralianAddress          = BaseCDAModel.CreateAustralianAddress();
            address.AustralianAddress.PostCode = xad.ziporpostalcode;
            address.AustralianAddress.UnstructuredAddressLines = new List <string> {
                xad.streetaddress
            };
            address.AustralianAddress.SuburbTownLocality = xad.city;
            address.AustralianAddress.State = AustralianState.QLD;
            if (addressStateSpecified)
            {
                address.AustralianAddress.State = addressState;
            }

            address.AddressPurpose = AddressPurpose.NotStatedUnknownInadequatelyDescribed;
            switch (xad.addresstype)
            {
            case "H":
            case "P":
            case "BR":
                address.AddressPurpose = AddressPurpose.Residential;
                break;

            case "B":
            case "RH":
            case "O":
            case "L":
                address.AddressPurpose = AddressPurpose.Business;
                break;

            case "M":
                address.AddressPurpose = AddressPurpose.MailingOrPostal;
                break;

            case "C":
                address.AddressPurpose = AddressPurpose.TemporaryAccommodation;
                break;
            }

            return(address);
        }
コード例 #7
0
        /// <summary>
        /// Creates and Hydrates a custodian
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <param name="mandatorySectionsOnly">Only show mandatory fields</param>
        /// <returns>A Hydrated IParticipationCustodian </returns>
        internal static IParticipationCustodian CreateCustodian(Boolean mandatorySectionsOnly, Guid custodianId)
        {
            var participationCustodian = BaseCDAModel.CreateCustodian();
            var custodian = BaseCDAModel.CreateParticipantCustodian();

            custodian.UniqueIdentifier = custodianId;

            // custodian/assignedCustodian
            participationCustodian.Participant = custodian;

            // custodian/assignedCustodian/representedCustodianOrganization
            custodian.Organisation = BaseCDAModel.CreateOrganisationName();

            // custodian/assignedCustodian/representedCustodianOrganization/<Entity Identifier>
            custodian.Organisation.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, "8003620833333789")
            };

            // custodian/assignedCustodian/representedCustodianOrganization/name
            custodian.Organisation.Name = "West End Healthiness";

            if (!mandatorySectionsOnly)
            {
                // custodian/assignedCustodian/representedCustodianOrganization/<Address>
                var address1 = BaseCDAModel.CreateAddress();
                address1.AddressPurpose    = AddressPurpose.Business;
                address1.AustralianAddress = BaseCDAModel.CreateAustralianAddress();
                address1.AustralianAddress.UnstructuredAddressLines = new List <string> {
                    "1 Clinician Street"
                };
                address1.AustralianAddress.SuburbTownLocality = "Nehtaville";
                address1.AustralianAddress.State           = AustralianState.QLD;
                address1.AustralianAddress.PostCode        = "5555";
                address1.AustralianAddress.DeliveryPointId = 32568931;

                custodian.Address = address1;

                // custodian/assignedCustodian/representedCustodianOrganization/<Electronic Communication Detail>
                var coms1 = BaseCDAModel.CreateElectronicCommunicationDetail("0712341234", ElectronicCommunicationMedium.Telephone, ElectronicCommunicationUsage.WorkPlace);
                custodian.ElectronicCommunicationDetail = coms1;
            }

            return(participationCustodian);
        }
        /// <summary>
        /// Creates and Hydrates a custodian
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Custodian</returns>
        public static void HydrateCustodian(IParticipationCustodian participationCustodian, bool mandatoryOnly)
        {
            var custodian = BaseCDAModel.CreateParticipantCustodian();

            // custodian/assignedCustodian
            participationCustodian.Participant = custodian;

            // custodian/assignedCustodian/representedCustodianOrganization
            custodian.Organisation      = BaseCDAModel.CreateOrganisationName();
            custodian.Organisation.Name = "Burrill Lake Medical Centre";
            // custodian/assignedCustodian/representedCustodianOrganization/<Entity Identifier>
            custodian.Organisation.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, "8003620833333789")
            };


            if (!mandatoryOnly)
            {
                // custodian/assignedCustodian/representedCustodianOrganization/name


                // custodian/assignedCustodian/representedCustodianOrganization/<Address>
                var address1 = BaseCDAModel.CreateAddress();
                address1.AddressPurpose    = AddressPurpose.Residential;
                address1.AustralianAddress = BaseCDAModel.CreateAustralianAddress();
                address1.AustralianAddress.UnstructuredAddressLines = new List <string> {
                    "1 Custodian Street"
                };
                address1.AustralianAddress.SuburbTownLocality = "Nehtaville";
                address1.AustralianAddress.State           = AustralianState.QLD;
                address1.AustralianAddress.PostCode        = "5555";
                address1.AustralianAddress.DeliveryPointId = 32568931;

                custodian.Address = address1;

                // custodian/assignedCustodian/representedCustodianOrganization/<Electronic Communication Detail>
                var coms1 = BaseCDAModel.CreateElectronicCommunicationDetail(
                    "0345754566",
                    ElectronicCommunicationMedium.Telephone,
                    ElectronicCommunicationUsage.WorkPlace);
                custodian.ElectronicCommunicationDetail = coms1;
            }
        }
        /// <summary>
        /// Creates and Hydrates a Service Provider Organisation
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated IParticipationHealthProfessional object</returns>
        private static IParticipationServiceProvider CreateServiceProviderOrganisation(Boolean mandatorySectionsOnly)
        {
            var serviceProvider = BaseCDAModel.CreateServiceProvider();

            serviceProvider.Participant = BaseCDAModel.CreateParticipantForServiceProvider();

            serviceProvider.Participant.Organisation             = BaseCDAModel.CreateOrganisation();
            serviceProvider.Participant.Organisation.Name        = "Bay Hill Hospital";
            serviceProvider.Participant.Organisation.NameUsage   = OrganisationNameUsage.Other;
            serviceProvider.Participant.Organisation.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, "8003620000045562")
            };

            var electronicCommunicationDetail = BaseCDAModel.CreateElectronicCommunicationDetail(
                "0345754566",
                ElectronicCommunicationMedium.Telephone,
                ElectronicCommunicationUsage.WorkPlace);

            serviceProvider.Participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail> {
                electronicCommunicationDetail
            };

            var address = BaseCDAModel.CreateAddress();

            address.AddressPurpose    = AddressPurpose.Residential;
            address.AustralianAddress = BaseCDAModel.CreateAustralianAddress();
            address.AustralianAddress.UnstructuredAddressLines = new List <string> {
                "1 Clinician Street"
            };
            address.AustralianAddress.SuburbTownLocality = "Nehtaville";
            address.AustralianAddress.State           = AustralianState.QLD;
            address.AustralianAddress.PostCode        = "5555";
            address.AustralianAddress.DeliveryPointId = 32568931;

            serviceProvider.Role = !mandatorySectionsOnly?BaseCDAModel.CreateRole(Occupation.GeneralMedicalPractitioner) : BaseCDAModel.CreateRole(NullFlavour.NotAsked);

            serviceProvider.Participant.Addresses = new List <IAddress> {
                address
            };

            return(serviceProvider);
        }
        /// <summary>
        /// Creates and Hydrates a Referee
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated Referee object</returns>
        private static IParticipationReferrer CreateReferrer(Boolean mandatorySectionsOnly)
        {
            var referrer = SpecialistLetter.CreateReferrer();

            referrer.Role = BaseCDAModel.CreateRole(Occupation.GeneralMedicalPractitioner);

            referrer.ParticipationPeriod = BaseCDAModel.CreateInterval(
                new ISO8601DateTime(DateTime.Now, ISO8601DateTime.Precision.Day),
                new ISO8601DateTime(DateTime.Now.AddDays(200), ISO8601DateTime.Precision.Day));

            var participant = SpecialistLetter.CreateParticipantForReferrer();

            var personName = BaseCDAModel.CreatePersonName();

            personName.GivenNames = new List <string> {
                "Referrer"
            };
            personName.FamilyName = "1";
            personName.NameUsages = new List <NameUsage> {
                NameUsage.Legal
            };
            personName.Titles = new List <string> {
                "Doctor"
            };

            var person = BaseCDAModel.CreatePersonWithOrganisation();

            person.Identifiers = new List <Identifier>
            {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPII, "8003610000021101")
            };

            person.PersonNames = new List <IPersonName>();
            person.PersonNames.Add(personName);

            participant.Person = person;

            var address = BaseCDAModel.CreateAddress();

            address.AddressPurpose    = AddressPurpose.Business;
            address.AustralianAddress = BaseCDAModel.CreateAustralianAddress();
            address.AustralianAddress.UnstructuredAddressLines = new List <string> {
                "1 Clinician Street"
            };
            address.AustralianAddress.SuburbTownLocality = "Nehtaville";
            address.AustralianAddress.State           = AustralianState.QLD;
            address.AustralianAddress.PostCode        = "5555";
            address.AustralianAddress.DeliveryPointId = 32568931;

            var addressList = new List <IAddress> {
                address
            };

            participant.Addresses = addressList;

            var electronicCommunicationDetail = BaseCDAModel.CreateElectronicCommunicationDetail
                                                (
                "0345754566",
                ElectronicCommunicationMedium.Telephone,
                ElectronicCommunicationUsage.WorkPlace
                                                );

            participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail> {
                electronicCommunicationDetail
            };

            var organisation = BaseCDAModel.CreateEmploymentOrganisation();

            organisation.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, "8003620000020052")
            };
            organisation.Name      = "Burrill Lake Medical Centre";
            organisation.NameUsage = OrganisationNameUsage.LocallyUsedName;

            organisation.Addresses = new List <IAddress> {
                address
            };
            organisation.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail> {
                electronicCommunicationDetail
            };

            person.Organisation = organisation;

            referrer.Participant = participant;

            return(referrer);
        }
        /// <summary>
        /// Creates and Hydrates a UsualGP
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated UsualGP object</returns>
        private static IParticipationUsualGP CreateUsualGPPerson(Boolean mandatorySectionsOnly)
        {
            var usualGP = SpecialistLetter.CreateUsualGP();

            var participant = SpecialistLetter.CreateParticipantForUsualGP();

            var personName = BaseCDAModel.CreatePersonName();

            personName.GivenNames = new List <string> {
                "Information (UsualGPPerson)"
            };
            personName.FamilyName = "Recipient";
            personName.Titles     = new List <string> {
                "Doctor"
            };
            personName.NameUsages = new List <NameUsage> {
                NameUsage.Legal
            };

            var person = BaseCDAModel.CreatePersonWithOrganisation();

            person.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPII, "8003610000021101")
            };

            person.PersonNames = new List <IPersonName>();
            person.PersonNames.Add(personName);

            participant.Person = person;

            var address = BaseCDAModel.CreateAddress();

            address.AddressPurpose    = AddressPurpose.Business;
            address.AustralianAddress = BaseCDAModel.CreateAustralianAddress();
            address.AustralianAddress.UnstructuredAddressLines = new List <string> {
                "1 Clinician Street"
            };
            address.AustralianAddress.SuburbTownLocality = "Nehtaville";
            address.AustralianAddress.State           = AustralianState.QLD;
            address.AustralianAddress.PostCode        = "5555";
            address.AustralianAddress.DeliveryPointId = 32568931;

            var addressList = new List <IAddress>
            {
                address
            };

            participant.Addresses = addressList;

            var electronicCommunicationDetail = BaseCDAModel.CreateElectronicCommunicationDetail
                                                (
                "0345754566",
                ElectronicCommunicationMedium.Telephone,
                ElectronicCommunicationUsage.WorkPlace
                                                );

            participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail> {
                electronicCommunicationDetail
            };

            if (!mandatorySectionsOnly)
            {
                usualGP.Role = BaseCDAModel.CreateRole(Occupation.GeneralMedicalPractitioner);
            }
            else
            {
                usualGP.Role = BaseCDAModel.CreateRole(NullFlavour.NoInformation);
            }

            var organisation = BaseCDAModel.CreateEmploymentOrganisation();

            organisation.Name      = "Bay hill hospital";
            organisation.NameUsage = OrganisationNameUsage.LocallyUsedName;

            participant.Person.Organisation             = organisation;
            participant.Person.Organisation.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, "8003620000020052")
            };
            participant.Person.Organisation.Addresses = new List <IAddress> {
                address
            };
            participant.Person.Organisation.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail> {
                electronicCommunicationDetail
            };
            usualGP.Participant = participant;

            return(usualGP);
        }
コード例 #12
0
        /// <summary>
        /// Creates and Hydrates an Participation Dispenser(IParticipationDispenser).
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <param name="mandatorySectionsOnly">Only show mandatory fields</param>
        /// <param name="dispenserId">The identifier of the dispenser</param>
        /// <returns>A Hydrated IParticipationDispenser </returns>
        internal static IParticipationDispenser CreateDispenser(Boolean mandatorySectionsOnly, Guid dispenserId)
        {
            var dispenser = BaseCDAModel.CreateDispenser();

            dispenser.Participant = BaseCDAModel.CreateParticipantForDispenser();
            dispenser.Participant.UniqueIdentifier = dispenserId;

            dispenser.Role = BaseCDAModel.CreateRole(Occupation.HospitalPharmacist);

            // Date Time Authored
            dispenser.Time = new ISO8601DateTime(DateTime.Now);

            // Person
            dispenser.Participant.Person = BaseCDAModel.CreatePersonForDispenser();

            // Dispenser > Participant > Entity Identifier
            dispenser.Participant.Person.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPII, "8003615833334118")
            };

            //LegalAuthenticator/assignedEntity/assignedPerson/<Person Name>
            var name1 = BaseCDAModel.CreatePersonName();

            name1.GivenNames = new List <string> {
                "Good"
            };
            name1.FamilyName = "Doctor";
            name1.Titles     = new List <string> {
                "Doctor"
            };
            name1.NameUsages = new List <NameUsage> {
                NameUsage.Legal
            };

            var name2 = BaseCDAModel.CreatePersonName();

            name2.GivenNames = new List <string> {
                "Davey"
            };
            name2.FamilyName = "Wong";
            name2.Titles     = new List <string> {
                "Brother"
            };
            name2.NameUsages = new List <NameUsage> {
                NameUsage.NewbornName
            };

            dispenser.Participant.Person.PersonNames = new List <IPersonName> {
                name1, name2
            };

            if (!mandatorySectionsOnly)
            {
                // Dispenser > Participant > Address
                var address1 = BaseCDAModel.CreateAddress();
                address1.AddressPurpose    = AddressPurpose.Business;
                address1.AustralianAddress = BaseCDAModel.CreateAustralianAddress();
                address1.AustralianAddress.UnstructuredAddressLines = new List <string> {
                    "1 Clinician Street"
                };
                address1.AustralianAddress.SuburbTownLocality = "Nehtaville";
                address1.AustralianAddress.State           = AustralianState.QLD;
                address1.AustralianAddress.PostCode        = "5555";
                address1.AustralianAddress.DeliveryPointId = 32568931;

                dispenser.Participant.Addresses = new List <IAddress> {
                    address1
                };

                // Dispenser > Participant > Electronic Communication Detail
                var coms1 = BaseCDAModel.CreateElectronicCommunicationDetail(
                    "0345754566",
                    ElectronicCommunicationMedium.Telephone,
                    ElectronicCommunicationUsage.WorkPlace);

                var coms2 = BaseCDAModel.CreateElectronicCommunicationDetail(
                    "*****@*****.**",
                    ElectronicCommunicationMedium.Email,
                    ElectronicCommunicationUsage.WorkPlace);

                dispenser.Participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail> {
                    coms1, coms2
                };

                dispenser.Participant.Person.Qualifications = "M.B.B.S., F.R.A.C.S.";
            }

            return(dispenser);
        }
        /// <summary>
        /// Creates and Hydrates the Participation Author Healthcare Provider
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated IParticipationAuthorHealthcareProvider object</returns>
        public static void HydrateAuthorHealthcareProvider(IParticipationAuthorHealthcareProvider author, bool mandatoryOnly)
        {
            // Document Author > Participation Period
            author.AuthorParticipationPeriodOrDateTimeAuthored = BaseCDAModel.CreateParticipationPeriod(new ISO8601DateTime(DateTime.Now));

            // Document Author > Role
            author.Role = BaseCDAModel.CreateRole(Occupation.MedicalLaboratoryScientist);

            // Document Author > Participant
            author.Participant = BaseCDAModel.CreateParticipantForAuthorHealthcareProvider();

            var person = BaseCDAModel.CreatePersonHealthcareProvider();

            // Document Author > Participant > Person or Organisation or Device > Person > Person Name
            var name1 = BaseCDAModel.CreatePersonName();

            name1.FamilyName = "Doctor";

            var name2 = BaseCDAModel.CreatePersonName();

            name2.FamilyName = "Wong";

            person.PersonNames = new List <IPersonName> {
                name1, name2
            };

            // Document Author > Participant > Address
            var address1 = BaseCDAModel.CreateAddress();

            address1.AddressPurpose    = AddressPurpose.Residential;
            address1.AustralianAddress = BaseCDAModel.CreateAustralianAddress();

            var address2 = BaseCDAModel.CreateAddress();

            address2.AddressPurpose    = AddressPurpose.Business;
            address2.AustralianAddress = BaseCDAModel.CreateAustralianAddress();

            var addressList = new List <IAddress> {
                address1, address2
            };

            address1.AustralianAddress.UnstructuredAddressLines = new List <string> {
                "1 Clinician Street"
            };
            address1.AustralianAddress.SuburbTownLocality = "Nehtaville";
            address1.AustralianAddress.State           = AustralianState.QLD;
            address1.AustralianAddress.PostCode        = "5555";
            address1.AustralianAddress.DeliveryPointId = 32568931;

            address2.AustralianAddress.UnstructuredAddressLines = new List <string> {
                "2 Clinician Street"
            };
            address2.AustralianAddress.SuburbTownLocality = "Nehtaville";
            address2.AustralianAddress.State           = AustralianState.QLD;
            address2.AustralianAddress.PostCode        = "5555";
            address2.AustralianAddress.DeliveryPointId = 32568931;

            author.Participant.Addresses = addressList;


            // Document Author > Participant > Entity Identifier
            person.Identifiers = new List <Identifier> {
                //BaseCDAModel.CreateIdentifier("AuthorHealthcareProvider", null, null, "1.2.3.4.5.66666", null),
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPII, "8003615833334118"),
            };


            person.Organisation           = BaseCDAModel.CreateEmploymentOrganisation();
            person.Organisation.Name      = "Hay Bill Hospital";
            person.Organisation.NameUsage = OrganisationNameUsage.Other;

            person.Organisation.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, "8003620833333789"),
                //BaseCDAModel.CreateIdentifier("SampleAuthority", null, null, "1.2.3.4.5.66666", null)
            };

            person.Organisation.Department             = "Some department service provider";
            person.Organisation.EmploymentType         = BaseCDAModel.CreateCodableText(null, null, null, "Casual", null);
            person.Organisation.Occupation             = BaseCDAModel.CreateRole(Occupation.GeneralMedicalPractitioner);
            person.Organisation.PositionInOrganisation = BaseCDAModel.CreateCodableText(null, null, null, "Manager", null);

            if (!mandatoryOnly)
            {
                name1.GivenNames = new List <string> {
                    "Good"
                };
                name1.Titles = new List <string> {
                    "Doctor"
                };
                name1.NameUsages = new List <NameUsage> {
                    NameUsage.Legal
                };

                name2.GivenNames = new List <string> {
                    "Davey"
                };
                name2.Titles = new List <string> {
                    "Brother"
                };
                name2.NameUsages = new List <NameUsage> {
                    NameUsage.NewbornName
                };



                // Document Author > Participant > Elec-tronic Communication Detail
                var coms1 = BaseCDAModel.CreateElectronicCommunicationDetail(
                    "0345754566",
                    ElectronicCommunicationMedium.Telephone,
                    ElectronicCommunicationUsage.WorkPlace);
                var coms2 = BaseCDAModel.CreateElectronicCommunicationDetail(
                    "*****@*****.**",
                    ElectronicCommunicationMedium.Email,
                    ElectronicCommunicationUsage.WorkPlace);

                author.Participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail> {
                    coms1, coms2
                };


                // Prescriber > Participant > Entitlement
                var entitlement1 = BaseCDAModel.CreateEntitlement();

                var code = BaseCDAModel.CreateCodableText("11", CodingSystem.NCTISEntitlementTypeValues, "Medicare Pharmacy Approval Number", null, null);

                entitlement1.Id = BaseCDAModel.CreateIdentifier("pharmacy",
                                                                null,
                                                                "1234567892",
                                                                "1.2.36.174030967.1.3.2.1",
                                                                code);

                entitlement1.Type             = EntitlementType.MedicarePharmacyApprovalNumber;
                entitlement1.ValidityDuration = BaseCDAModel.CreateInterval("1", TimeUnitOfMeasure.Year);

                person.Entitlements = new List <Entitlement> {
                    entitlement1, entitlement1
                };

                // Qualifications
                person.Qualifications = "M.B.B.S., F.R.A.C.S.";
            }

            author.Participant.Person = person;
        }
        /// <summary>
        /// Creates and Hydrates an SubjectofCare
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated SubjectofCare</returns>
        public static void HydrateSubjectofCare(IParticipationSubjectOfCare subjectOfCare, bool mandatoryOnly)
        {
            var participant = BaseCDAModel.CreateParticipantForSubjectOfCare();

            // Subject of Care > Participant > Person or Organisation or Device > Person
            var person = BaseCDAModel.CreatePersonForSubjectOfCare();

            participant.UniqueIdentifier = Guid.NewGuid();

            // Subject of Care > Participant > Person or Organisation or Device > Person > Person Name
            var name1 = BaseCDAModel.CreatePersonName();

            name1.FamilyName = "Grant";
            name1.GivenNames = new List <string> {
                "Sally", "Wally"
            };
            name1.Titles = new List <string> {
                "Miss"
            };
            name1.NameUsages = new List <NameUsage> {
                NameUsage.Legal
            };

            person.PersonNames = new List <IPersonName> {
                name1
            };

            // Subject of Care > Participant > Person or Organisation or Device > Person > Demographic Data > Sex
            person.Gender = Gender.Female;

            // Subject of Care > Participant > Person or Organisation or Device > Person > Demographic Data > Date of Birth Detail >
            // Date of Birth
            person.DateOfBirth = new ISO8601DateTime(DateTime.Now.AddYears(-57));

            // Subject of Care > Participant > Entity Identifier
            person.Identifiers = new List <Identifier>
            {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.IHI, "8003604444567894")
            };

            var address1 = BaseCDAModel.CreateAddress();

            address1.AddressPurpose    = AddressPurpose.Residential;
            address1.AustralianAddress = BaseCDAModel.CreateAustralianAddress();

            address1.AustralianAddress.UnstructuredAddressLines = new List <string> {
                "1 Clinician Street"
            };
            address1.AustralianAddress.SuburbTownLocality = "Nehtaville";
            address1.AustralianAddress.State           = AustralianState.NSW;
            address1.AustralianAddress.PostCode        = "5555";
            address1.AustralianAddress.DeliveryPointId = 32568931;

            participant.Addresses = new List <IAddress> {
                address1
            };

            person.IndigenousStatus = IndigenousStatus.NeitherAboriginalNorTorresStraitIslanderOrigin;

            if (!mandatoryOnly)
            {
                // Subject of Care > Participant > Address


                // Subject of Care > Participant > Person or Organisation or Device > Person > Demographic Data > Indigenous Status


                // Subject of Care > Participant > Electronic Communication Detail
                var coms1 = BaseCDAModel.CreateElectronicCommunicationDetail(
                    "0345754566",
                    ElectronicCommunicationMedium.Telephone,
                    ElectronicCommunicationUsage.WorkPlace);
                var coms2 = BaseCDAModel.CreateElectronicCommunicationDetail(
                    "*****@*****.**",
                    ElectronicCommunicationMedium.Email,
                    ElectronicCommunicationUsage.WorkPlace);

                participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail> {
                    coms1, coms2
                };



                person.DateOfBirthCalculatedFromAge = true;
                person.DateOfBirthAccuracyIndicator = new DateAccuracyIndicator(true, true, true);
                person.Age = 54;
                person.AgeUnitOfMeasure = AgeUnitOfMeasure.Year;

                person.AgeAccuracyIndicator = true;
                person.BirthPlurality       = 3;
                person.BirthOrder           = 2;

                // Subject of Care > Participant > Entitlement
                var entitlement1 = BaseCDAModel.CreateEntitlement();
                entitlement1.Id               = BaseCDAModel.CreateMedicareNumber(MedicareNumberType.MedicareCardNumber, "1234567881");
                entitlement1.Type             = EntitlementType.MedicareBenefits;
                entitlement1.ValidityDuration = BaseCDAModel.CreateInterval("1", TimeUnitOfMeasure.Year);

                var entitlement2 = BaseCDAModel.CreateEntitlement();
                entitlement2.Id               = BaseCDAModel.CreateMedicareNumber(MedicareNumberType.MedicareCardNumber, "1234567881");
                entitlement2.Type             = EntitlementType.MedicareBenefits;
                entitlement2.ValidityDuration = BaseCDAModel.CreateInterval("1", TimeUnitOfMeasure.Year);

                participant.Entitlements = new List <Entitlement> {
                    entitlement1, entitlement2
                };
            }

            participant.Person        = person;
            subjectOfCare.Participant = participant;
        }
        /// <summary>
        /// Creates and Hydrates a list of recipients
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated list of recipients</returns>
        public static void HydrateRecipient(IParticipationInformationRecipient recipient, RecipientType recipientType, bool mandatoryOnly)
        {
            recipient.Participant = BaseCDAModel.CreateParticipantForInformationRecipient();

            // informationRecipient/@typeCode
            recipient.Participant.RecipientType = recipientType;

            // informationRecipient/intendedRecipient
            recipient.Participant.Person = BaseCDAModel.CreatePerson();

            if (!mandatoryOnly)
            {
                // informationRecipient/intendedRecipient/informationRecipient/<Entity Identifier>
                recipient.Participant.Person.Identifiers = new List <Identifier> {
                    BaseCDAModel.CreateIdentifier("SampleAuthority", null, null, "1.2.3.4.5.6677", null),
                    BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPII, "8003614444567893")
                };

                // informationRecipient/intendedRecipient/<Address>
                var address1 = BaseCDAModel.CreateAddress();
                address1.AddressPurpose    = AddressPurpose.Residential;
                address1.AustralianAddress = BaseCDAModel.CreateAustralianAddress();
                address1.AustralianAddress.UnstructuredAddressLines = new List <string> {
                    "1 Clinician Street"
                };
                address1.AustralianAddress.SuburbTownLocality = "Nehtaville";
                address1.AustralianAddress.State           = AustralianState.QLD;
                address1.AustralianAddress.PostCode        = "5555";
                address1.AustralianAddress.DeliveryPointId = 32568931;

                var address2 = BaseCDAModel.CreateAddress();
                address2.AddressPurpose                   = AddressPurpose.TemporaryAccommodation;
                address2.InternationalAddress             = BaseCDAModel.CreateInternationalAddress();
                address2.InternationalAddress.AddressLine = new List <string> {
                    "1 Overseas Street"
                };
                address2.InternationalAddress.Country       = Country.Albania;
                address2.InternationalAddress.PostCode      = "12345";
                address2.InternationalAddress.StateProvince = "Foreign Land";

                var addressList = new List <IAddress> {
                    address1, address2
                };

                recipient.Participant.Addresses = addressList;

                // informationRecipient/intendedRecipient/<Electronic Communication Detail>
                var coms1 = BaseCDAModel.CreateElectronicCommunicationDetail(
                    "0345754566",
                    ElectronicCommunicationMedium.Telephone,
                    ElectronicCommunicationUsage.WorkPlace);

                var coms2 = BaseCDAModel.CreateElectronicCommunicationDetail(
                    "*****@*****.**",
                    ElectronicCommunicationMedium.Email,
                    ElectronicCommunicationUsage.WorkPlace);

                recipient.Participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail> {
                    coms1, coms2
                };

                // informationRecipient/intendedRecipient/informationRecipient/<Person Name>

                var name1 = BaseCDAModel.CreatePersonName();
                name1.GivenNames = new List <string> {
                    "Information"
                };
                name1.FamilyName = "Recipient";
                name1.Titles     = new List <string> {
                    "Doctor"
                };
                name1.NameUsages = new List <NameUsage> {
                    NameUsage.Legal
                };

                var name2 = BaseCDAModel.CreatePersonName();
                name2.GivenNames = new List <string> {
                    "Information"
                };
                name2.FamilyName = "Recipient";
                name2.Titles     = new List <string> {
                    "Mr"
                };
                name2.NameUsages = new List <NameUsage> {
                    NameUsage.NewbornName
                };

                recipient.Participant.Person.PersonNames = new List <IPersonName> {
                    name1, name2
                };

                // informationRecipient/intendedRecipient/receivedOrganization
                recipient.Participant.Organisation = BaseCDAModel.CreateOrganisationName();

                // informationRecipient/intendedRecipient/receivedOrganization/name
                recipient.Participant.Organisation.Name = "Specialist Clinics";

                recipient.Participant.Organisation.Identifiers = new List <Identifier> {
                    BaseCDAModel.CreateIdentifier("SampleAuthority", null, null, "1.2.3.4.5.6677", null),
                    BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, "8003621231167886")
                };
            }
        }
コード例 #16
0
        /// <summary>
        /// This method populates an PCML model with either the mandatory sections only, or both
        /// the mandatory and optional sections
        /// </summary>
        /// <param name="mandatorySectionsOnly">mandatorySectionsOnly</param>
        /// <returns>PCML</returns>
        public static Nehta.VendorLibrary.CDA.Common.PCML PopulatePCML_1B(Boolean mandatorySectionsOnly)
        {
            var pharmacyCuratedMedsList = Nehta.VendorLibrary.CDA.Common.PCML.CreatePCML();

            // Include Logo
            pharmacyCuratedMedsList.IncludeLogo = false;

            // Set Creation Time
            pharmacyCuratedMedsList.DocumentCreationTime = new ISO8601DateTime(DateTime.Now);

            #region Setup and populate the CDA context model

            // Setup and populate the CDA context model
            var cdaContext = Nehta.VendorLibrary.CDA.Common.PCML.CreateCDAContext();
            // Document Id
            cdaContext.DocumentId = BaseCDAModel.CreateIdentifier(BaseCDAModel.CreateOid(), null);

            // Custodian
            cdaContext.Custodian = BaseCDAModel.CreateCustodian();
            GenericObjectReuseSample.HydrateCustodian(cdaContext.Custodian, mandatorySectionsOnly);


            //Optional sections
            // Legal authenticator
            if (!mandatorySectionsOnly)
            {
                // Set Id
                cdaContext.SetId = BaseCDAModel.CreateIdentifier(BaseCDAModel.CreateOid(), null);
                // CDA Context Version
                cdaContext.Version = "1";

                cdaContext.LegalAuthenticator = BaseCDAModel.CreateLegalAuthenticator();
                GenericObjectReuseSample.HydrateAuthenticator(cdaContext.LegalAuthenticator, mandatorySectionsOnly);
            }

            pharmacyCuratedMedsList.CDAContext = cdaContext;
            #endregion

            #region Setup and Populate the SCS Context model
            // Setup and Populate the SCS Context model

            pharmacyCuratedMedsList.SCSContext = Nehta.VendorLibrary.CDA.Common.PCML.CreateSCSContext();

            var authorHealthcareProvider = BaseCDAModel.CreateAuthorHealthcareProvider();
            GenericObjectReuseSample.HydrateAuthorHealthcareProvider(authorHealthcareProvider, mandatorySectionsOnly);
            pharmacyCuratedMedsList.SCSContext.Author = authorHealthcareProvider;

            //Cannot use as a device : prohibited by CORE Level One
            //healthCheckAssessment.SCSContext.Author = GenericObjectReuseSample.CreateAuthorDevice();

            pharmacyCuratedMedsList.SCSContext.Encounter = new Encounter
            {
                HealthcareFacility = PopulateHealthcareFacility(mandatorySectionsOnly)
            };

            pharmacyCuratedMedsList.SCSContext.SubjectOfCare = BaseCDAModel.CreateSubjectOfCare();
            GenericObjectReuseSample.HydrateSubjectofCare(pharmacyCuratedMedsList.SCSContext.SubjectOfCare, mandatorySectionsOnly);



            IParticipationPersonOrOrganisation person = Nehta.VendorLibrary.CDA.Common.PCML.CreateParticipationPersonOrOrganisation();
            person.Participant        = Nehta.VendorLibrary.CDA.Common.PCML.CreateParticipantPersonOrOrganisation();
            person.Role               = BaseCDAModel.CreateRole(HealthcareFacilityTypeCodes.AgedCareResidentialServices);
            person.Participant.Person = BaseCDAModel.CreatePersonWithOrganisation();



            var name1 = BaseCDAModel.CreatePersonName();
            name1.FamilyName = "Grant";
            name1.GivenNames = new List <string> {
                "Sally", "Wally"
            };
            name1.Titles = new List <string> {
                "Miss"
            };
            name1.NameUsages = new List <NameUsage> {
                NameUsage.Legal
            };

            person.Participant.Person.PersonNames = new List <IPersonName> {
                name1
            };

            // Subject of Care > Participant > Person or Organisation or Device > Person > Demographic Data > Sex

            var address1 = BaseCDAModel.CreateAddress();

            address1.AddressPurpose    = AddressPurpose.Residential;
            address1.AustralianAddress = BaseCDAModel.CreateAustralianAddress();

            address1.AustralianAddress.UnstructuredAddressLines = new List <string> {
                "1 Clinician Street"
            };
            address1.AustralianAddress.SuburbTownLocality = "Nehtaville";
            address1.AustralianAddress.State           = AustralianState.NSW;
            address1.AustralianAddress.PostCode        = "5555";
            address1.AustralianAddress.DeliveryPointId = 32568931;

            person.Participant.Addresses = new List <IAddress> {
                address1
            };


            person.Participant.Person.Organisation = BaseCDAModel.CreateEmploymentOrganisation();


            person.Participant.Person.Organisation           = BaseCDAModel.CreateEmploymentOrganisation();
            person.Participant.Person.Organisation.Name      = "Hay Bill Hospital";
            person.Participant.Person.Organisation.NameUsage = OrganisationNameUsage.Other;

            person.Participant.Person.Organisation.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, "8003620833333789"),
                //BaseCDAModel.CreateIdentifier("SampleAuthority", null, null, "1.2.3.4.5.66666", null)
            };

            if (!mandatorySectionsOnly)
            {
                //populate with full person details

                // Subject of Care > Participant > Address


                // Subject of Care > Participant > Person or Organisation or Device > Person > Demographic Data > Indigenous Status


                // Subject of Care > Participant > Electronic Communication Detail
                var coms1 = BaseCDAModel.CreateElectronicCommunicationDetail(
                    "0345754566",
                    ElectronicCommunicationMedium.Telephone,
                    ElectronicCommunicationUsage.WorkPlace);
                var coms2 = BaseCDAModel.CreateElectronicCommunicationDetail(
                    "*****@*****.**",
                    ElectronicCommunicationMedium.Email,
                    ElectronicCommunicationUsage.WorkPlace);

                person.Participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail> {
                    coms1, coms2
                };


                // Subject of Care > Participant > Entitlement
                var entitlement1 = BaseCDAModel.CreateEntitlement();
                entitlement1.Id               = BaseCDAModel.CreateMedicareNumber(MedicareNumberType.MedicareCardNumber, "1234567881");
                entitlement1.Type             = EntitlementType.MedicareBenefits;
                entitlement1.ValidityDuration = BaseCDAModel.CreateInterval("1", TimeUnitOfMeasure.Year);

                var entitlement2 = BaseCDAModel.CreateEntitlement();
                entitlement2.Id               = BaseCDAModel.CreateMedicareNumber(MedicareNumberType.MedicareCardNumber, "1234567881");
                entitlement2.Type             = EntitlementType.MedicareBenefits;
                entitlement2.ValidityDuration = BaseCDAModel.CreateInterval("1", TimeUnitOfMeasure.Year);

                person.Participant.Entitlements = new List <Entitlement> {
                    entitlement1, entitlement2
                };
            }


            pharmacyCuratedMedsList.SCSContext.Participant = new List <IParticipationPersonOrOrganisation>();
            pharmacyCuratedMedsList.SCSContext.Participant.Add(person);

            #endregion

            #region Setup and populate the SCS Content model
            // Setup and populate the SCS Content model
            pharmacyCuratedMedsList.SCSContent = Nehta.VendorLibrary.CDA.Common.PCML.CreateSCSContent();

            pharmacyCuratedMedsList.SCSContent.EncapsulatedData = BaseCDAModel.CreateEncapsulatedData();

            ExternalData report1 = EventSummary.CreateExternalData();
            //report1.ExternalDataMediaType = MediaType.PDF;
            //report1.Path = StructuredFileAttachment;
            //report1.Caption = "Attachment One";



            //healthCheckAssessment.SCSContent.EncapsulatedData.ExternalData = report1;
            #endregion

            return(pharmacyCuratedMedsList);
        }
コード例 #17
0
        private IAddress GetCdaAddress(Spia.PathologyReportModel.Model.Address Address)
        {
            IAddress CdaAddress = BaseCDAModel.CreateAddress();

            switch (Address.TypeCode)
            {
            case PathologyReportModel.Model.AddressType.FirmBusiness:
                CdaAddress.AddressPurpose = AddressPurpose.Business;
                break;

            case PathologyReportModel.Model.AddressType.BadAddress:
                CdaAddress.AddressPurpose = AddressPurpose.NotStatedUnknownInadequatelyDescribed;
                break;

            case PathologyReportModel.Model.AddressType.BirthDeliveryLocation:
                CdaAddress.AddressPurpose = AddressPurpose.Residential;
                break;

            case PathologyReportModel.Model.AddressType.ResidenceAtbirth:
                CdaAddress.AddressPurpose = AddressPurpose.Residential;
                break;

            case PathologyReportModel.Model.AddressType.CurrentOrTemporary:
                CdaAddress.AddressPurpose = AddressPurpose.TemporaryAccommodation;
                break;

            case PathologyReportModel.Model.AddressType.CountryOfOrigin:
                CdaAddress.AddressPurpose = AddressPurpose.Residential;
                break;

            case PathologyReportModel.Model.AddressType.Home:
                CdaAddress.AddressPurpose = AddressPurpose.Residential;
                break;

            case PathologyReportModel.Model.AddressType.LegalAddress:
                CdaAddress.AddressPurpose = AddressPurpose.MailingOrPostal;
                break;

            case PathologyReportModel.Model.AddressType.Mailing:
                CdaAddress.AddressPurpose = AddressPurpose.MailingOrPostal;
                break;

            case PathologyReportModel.Model.AddressType.Birth:
                CdaAddress.AddressPurpose = AddressPurpose.Residential;
                break;

            case PathologyReportModel.Model.AddressType.Office:
                CdaAddress.AddressPurpose = AddressPurpose.Business;
                break;

            case PathologyReportModel.Model.AddressType.Permanent:
                CdaAddress.AddressPurpose = AddressPurpose.Residential;
                break;

            case PathologyReportModel.Model.AddressType.RegistryHome:
                CdaAddress.AddressPurpose = AddressPurpose.Residential;
                break;

            default:
                throw new ApplicationException($"Unable to convert Address {nameof(Address.TypeCode)} of {Address.TypeCode.ToString()} to a CDA address type");
            }
            CdaAddress.AustralianAddress = BaseCDAModel.CreateAustralianAddress();
            CdaAddress.AustralianAddress.UnstructuredAddressLines = new List <string> {
                Address.LineOne
            };
            if (!string.IsNullOrWhiteSpace(Address.LineTwo))
            {
                CdaAddress.AustralianAddress.UnstructuredAddressLines.Add(Address.LineTwo);
            }
            CdaAddress.AustralianAddress.UnstructuredAddressLines = new List <string> {
                Address.LineOne
            };
            CdaAddress.AustralianAddress.SuburbTownLocality = Address.Suburb;
            CdaAddress.AustralianAddress.PostCode           = Address.PostCode;

            switch (Address.State)
            {
            case Spia.PathologyReportModel.Model.StateType.WA:
                CdaAddress.AustralianAddress.State = AustralianState.WA;
                break;

            case Spia.PathologyReportModel.Model.StateType.NT:
                CdaAddress.AustralianAddress.State = AustralianState.NT;
                break;

            case Spia.PathologyReportModel.Model.StateType.QLD:
                CdaAddress.AustralianAddress.State = AustralianState.QLD;
                break;

            case Spia.PathologyReportModel.Model.StateType.ACT:
                CdaAddress.AustralianAddress.State = AustralianState.ACT;
                break;

            case Spia.PathologyReportModel.Model.StateType.NSW:
                CdaAddress.AustralianAddress.State = AustralianState.NSW;
                break;

            case Spia.PathologyReportModel.Model.StateType.VIC:
                CdaAddress.AustralianAddress.State = AustralianState.VIC;
                break;

            case Spia.PathologyReportModel.Model.StateType.SA:
                CdaAddress.AustralianAddress.State = AustralianState.SA;
                break;

            case Spia.PathologyReportModel.Model.StateType.TAZ:
                CdaAddress.AustralianAddress.State = AustralianState.TAS;
                break;

            default:
                CdaAddress.AustralianAddress.State = AustralianState.Undefined;
                break;
            }
            return(CdaAddress);
        }
        /// <summary>
        /// Creates and Hydrates an Authenticator
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated authenticator</returns>
        internal static IParticipationLegalAuthenticator CreateLegalAuthenticator(Boolean mandatorySectionsOnly, Guid legalAuthenticatorId)
        {
            var authenticator = BaseCDAModel.CreateLegalAuthenticator();

            // LegalAuthenticator/assignedEntity
            authenticator.Participant = BaseCDAModel.CreateParticipantForLegalAuthenticator();

            // set the identifier for the Legal Authenticator
            authenticator.Participant.UniqueIdentifier = legalAuthenticatorId;

            // LegalAuthenticator/time/@value
            authenticator.Participant.DateTimeAuthenticated = new ISO8601DateTime(DateTime.Now, ISO8601DateTime.Precision.Minute);

            // LegalAuthenticator/assignedEntity/assignedPerson
            authenticator.Participant.Person = BaseCDAModel.CreatePerson();

            var localAuthorityCode = BaseCDAModel.CreateCodableText("EI", CodingSystem.HL7IdentifierType, null, null, null);

            // LegalAuthenticator/assignedEntity/<Entity Identifier>
            authenticator.Participant.Person.Identifiers = new List <Identifier>
            {
                BaseCDAModel.CreateIdentifier("Test Authority", null, "66666", "2.999.1234567890", localAuthorityCode),
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPII, "8003615833334118")
            };

            //LegalAuthenticator/assignedEntity/assignedPerson/<Person Name>
            var name1 = BaseCDAModel.CreatePersonName();

            name1.GivenNames = new List <string> {
                "Fitun"
            };
            name1.FamilyName = "Healthy";
            name1.Titles     = new List <string> {
                "Dr"
            };
            name1.NameUsages = new List <NameUsage> {
                NameUsage.Legal
            };

            authenticator.Participant.Person.PersonNames = new List <IPersonName> {
                name1
            };

            if (!mandatorySectionsOnly)
            {
                // LegalAuthenticator/assignedEntity/code
                authenticator.Role = BaseCDAModel.CreateRole(Occupation.GeneralMedicalPractitioner);

                // LegalAuthenticator/assignedEntity/<Address>
                var address1 = BaseCDAModel.CreateAddress();
                address1.AddressPurpose    = AddressPurpose.Residential;
                address1.AustralianAddress = BaseCDAModel.CreateAustralianAddress();
                address1.AustralianAddress.UnstructuredAddressLines = new List <string> {
                    "1 Clinician Street"
                };
                address1.AustralianAddress.SuburbTownLocality = "Nehtaville";
                address1.AustralianAddress.State    = AustralianState.QLD;
                address1.AustralianAddress.PostCode = "5555";

                var addressList = new List <IAddress> {
                    address1
                };

                authenticator.Participant.Addresses = addressList;

                // LegalAuthenticator/assignedEntity/<Electronic Communication Detail>
                var coms1 = BaseCDAModel.CreateElectronicCommunicationDetail(
                    "0345754566",
                    ElectronicCommunicationMedium.Telephone,
                    ElectronicCommunicationUsage.WorkPlace);

                var coms2 = BaseCDAModel.CreateElectronicCommunicationDetail(
                    "*****@*****.**",
                    ElectronicCommunicationMedium.Email,
                    ElectronicCommunicationUsage.WorkPlace);
                authenticator.Participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail> {
                    coms1, coms2
                };

                // LegalAuthenticator/assignedEntity/representedOrganization
                authenticator.Participant.Organisation = BaseCDAModel.CreateOrganisationName();

                // LegalAuthenticator/assignedEntity/representedOrganization/name
                authenticator.Participant.Organisation.Name = "West End Healthiness";

                // LegalAuthenticator/assignedEntity/representedOrganization/<Entity Identifier>
                authenticator.Participant.Organisation.Identifiers = new List <Identifier>
                {
                    BaseCDAModel.CreateIdentifier("Test Authority", null, null, "2.999.1234567890", null),
                    BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, "8003620833333789")
                };
            }

            return(authenticator);
        }
        /// <summary>
        /// Creates and Hydrates an Prescriber Organisation(IParticipationPrescriberOrganisation).
        /// </summary>
        /// <returns>A Hydrated Prescriber Organisation</returns>
        internal static IParticipationPrescriberOrganisation CreatePrescriberOrganisation(Boolean mandatorySectionsOnly, Guid prescriberOrganisationId)
        {
            IParticipationPrescriberOrganisation participation = BaseCDAModel.CreatePrescriberOrganisation();

            participation.Role        = BaseCDAModel.CreateRole(HealthcareFacilityTypeCodes.ChildCareServices);
            participation.Participant = BaseCDAModel.CreateParticipantForPrescriberOrganisation();

            // Prescriber Organisation Identifier
            participation.Participant.UniqueIdentifier = prescriberOrganisationId;

            participation.Participant.Organisation = BaseCDAModel.CreateOrganisation();

            // Prescribe rOrganisation > Participant > Entity Identifier
            participation.Participant.Organisation.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateIdentifier("Test Authority", null, null, "2.999.1234567890", null),
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, "8003620833333789")
            };

            // Organisation Name
            participation.Participant.Organisation.Name = "West End Healthiness";

            if (!mandatorySectionsOnly)
            {
                // Prescriber Organisation > Address
                var address1 = BaseCDAModel.CreateAddress();
                address1.AddressPurpose    = AddressPurpose.Business;
                address1.AustralianAddress = BaseCDAModel.CreateAustralianAddress();
                address1.AustralianAddress.UnstructuredAddressLines = new List <string> {
                    "1 Clinician Street"
                };
                address1.AustralianAddress.SuburbTownLocality = "Nehtaville";
                address1.AustralianAddress.State    = AustralianState.QLD;
                address1.AustralianAddress.PostCode = "5555";

                participation.Participant.Addresses = new List <IAddress> {
                    address1
                };

                participation.Participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail>()
                {
                    BaseCDAModel.CreateElectronicCommunicationDetail("0712341234", ElectronicCommunicationMedium.Telephone, ElectronicCommunicationUsage.WorkPlace)
                };

                var identifier = BaseCDAModel.CreateIdentifier
                                 (
                    "Test Authority",
                    HealthcareIdentifierGeographicArea.StateOrTerritoryIdentifier,
                    "455458",
                    "1.22.333.444.55575",
                    BaseCDAModel.CreateCodableText("1.1.1.1.1.1", CodingSystem.NCTIS, "DisplayName", "Original Text", null)
                                 );

                // Subject of Care > Participant > Entitlement
                var entitlement1 = BaseCDAModel.CreateEntitlement();
                entitlement1.Id               = identifier;
                entitlement1.Type             = EntitlementType.MedicareBenefits;
                entitlement1.ValidityDuration = BaseCDAModel.CreateInterval("1", TimeUnitOfMeasure.Year);

                var entitlement2 = BaseCDAModel.CreateEntitlement();
                entitlement2.Id               = identifier;
                entitlement2.Type             = EntitlementType.MedicareBenefits;
                entitlement2.ValidityDuration = BaseCDAModel.CreateInterval("1", TimeUnitOfMeasure.Year);

                participation.Participant.Entitlements = new List <Entitlement> {
                    entitlement1, entitlement2
                };
            }

            return(participation);
        }
        /// <summary>
        /// Creates and Hydrates an Participation Prescriber(IParticipationPrescriber).
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <param name="mandatorySectionsOnly">Only show mandatory fields</param>
        /// <param name="prescriberId">The Prescriber Id </param>
        /// <returns>A Hydrated IParticipationPrescriber </returns>
        internal static IParticipationPrescriber CreatePrescriber(Boolean mandatorySectionsOnly, Guid prescriberId)
        {
            var prescriber = BaseCDAModel.CreatePrescriber();

            prescriber.Role = BaseCDAModel.CreateRole(Occupation.GeneralMedicalPractitioner);

            // Date Time Prescription Written
            prescriber.Time = new ISO8601DateTime(DateTime.Now);

            prescriber.Participant = BaseCDAModel.CreateParticipantForPrescriber();

            // Prescriber Organisation Identifier
            prescriber.Participant.UniqueIdentifier = prescriberId;

            prescriber.Participant.Person = BaseCDAModel.CreatePersonForPrescriber();

            // Prescriber > Participant > Entity Identifier
            prescriber.Participant.Person.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPII, "8003615833334118")
            };

            //LegalAuthenticator/assignedEntity/assignedPerson/<Person Name>
            var name1 = BaseCDAModel.CreatePersonName();

            name1.GivenNames = new List <string> {
                "Fitun"
            };
            name1.FamilyName = "Healthy";
            name1.Titles     = new List <string> {
                "Dr"
            };
            name1.NameUsages = new List <NameUsage> {
                NameUsage.Legal
            };

            var name2 = BaseCDAModel.CreatePersonName();

            name2.GivenNames = new List <string> {
                "Davey"
            };
            name2.FamilyName = "Wong";
            name2.Titles     = new List <string> {
                "Brother"
            };
            name2.NameUsages = new List <NameUsage> {
                NameUsage.NewbornName
            };

            prescriber.Participant.Person.PersonNames = new List <IPersonName> {
                name1, name2
            };

            prescriber.Participant.Person.Occupation = Occupation.GeneralMedicalPractitioner;

            if (!mandatorySectionsOnly)
            {
                // Prescriber > Participant > Address
                var address1 = BaseCDAModel.CreateAddress();
                address1.AddressPurpose    = AddressPurpose.Business;
                address1.AustralianAddress = BaseCDAModel.CreateAustralianAddress();
                address1.AustralianAddress.UnstructuredAddressLines = new List <string> {
                    "1 Clinician Street"
                };
                address1.AustralianAddress.SuburbTownLocality = "Nehtaville";
                address1.AustralianAddress.State    = AustralianState.QLD;
                address1.AustralianAddress.PostCode = "5555";

                prescriber.Participant.Addresses = new List <IAddress> {
                    address1
                };

                // Prescriber > Participant > Electronic Communication Detail
                var coms1 = BaseCDAModel.CreateElectronicCommunicationDetail(
                    "0345754566",
                    ElectronicCommunicationMedium.Telephone,
                    ElectronicCommunicationUsage.WorkPlace);

                var coms2 = BaseCDAModel.CreateElectronicCommunicationDetail(
                    "*****@*****.**",
                    ElectronicCommunicationMedium.Email,
                    ElectronicCommunicationUsage.WorkPlace);

                prescriber.Participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail> {
                    coms1, coms2
                };

                // Prescriber > Participant > Entitlement
                var entitlement1 = BaseCDAModel.CreateEntitlement();

                entitlement1.Id = BaseCDAModel.CreateIdentifier(IdentifierType.PrescriberNumber.GetAttributeValue <NameAttribute, String>(x => x.Name),
                                                                null,
                                                                "1423444",
                                                                IdentifierType.PrescriberNumber.GetAttributeValue <NameAttribute, String>(x => x.Code),
                                                                null);

                entitlement1.Type             = EntitlementType.MedicarePrescriberNumber;
                entitlement1.ValidityDuration = BaseCDAModel.CreateInterval("1", TimeUnitOfMeasure.Year);

                prescriber.Participant.Person.Entitlements = new List <Entitlement> {
                    entitlement1, entitlement1
                };

                prescriber.Participant.Person.Qualifications = "M.B.B.S., F.R.A.C.S.";
            }

            return(prescriber);
        }
コード例 #21
0
        /// <summary>
        /// Creates and Hydrates an Dispenser Organisation(IParticipationDispenserOrganisation).
        /// </summary>
        /// <returns>A Hydrated Dispenser Organisation</returns>
        internal static IParticipationDispenserOrganisation CreateDispenserOrganisation(Boolean mandatorySectionsOnly, Guid dispenserOrganisationId)
        {
            IParticipationDispenserOrganisation participation = BaseCDAModel.CreateDispenserOrganisation();

            participation.Participant = BaseCDAModel.CreateParticipantForDispenserOrganisation();
            participation.Participant.UniqueIdentifier = dispenserOrganisationId;

            participation.Participant.Organisation = BaseCDAModel.CreateOrganisation();

            // Prescribe rOrganisation > Participant > Entity Identifier
            participation.Participant.Organisation.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateIdentifier("SampleAuthority", null, null, "1.2.3.4.5.66666", null),
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, "8003620833333789")
            };

            // Organisation Name
            participation.Participant.Organisation.Name = "West End Healthiness";

            if (!mandatorySectionsOnly)
            {
                // Organisation Continued
                participation.Participant.Organisation.NameUsage  = OrganisationNameUsage.LocallyUsedName;
                participation.Participant.Organisation.Department = "General Health";

                // Dispenser Organisation > Address
                var address1 = BaseCDAModel.CreateAddress();
                address1.AddressPurpose    = AddressPurpose.Business;
                address1.AustralianAddress = BaseCDAModel.CreateAustralianAddress();
                address1.AustralianAddress.UnstructuredAddressLines = new List <string> {
                    "1 Clinician Street"
                };
                address1.AustralianAddress.SuburbTownLocality = "Nehtaville";
                address1.AustralianAddress.State           = AustralianState.QLD;
                address1.AustralianAddress.PostCode        = "5555";
                address1.AustralianAddress.DeliveryPointId = 32568931;

                participation.Participant.Addresses = new List <IAddress> {
                    address1
                };

                participation.Participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail>
                {
                    BaseCDAModel.CreateElectronicCommunicationDetail("0712341234", ElectronicCommunicationMedium.Telephone, ElectronicCommunicationUsage.WorkPlace)
                };

                // Prescriber > Participant > Entitlement
                var entitlement1 = BaseCDAModel.CreateEntitlement();

                var code = BaseCDAModel.CreateCodableText("11", CodingSystem.NCTISEntitlementTypeValues,
                                                          "Medicare Pharmacy Approval Number", null, null);


                entitlement1.Id = BaseCDAModel.CreateIdentifier("AGIMO (Australian Government Information Management Office)",
                                                                null,
                                                                "1234567892",
                                                                "1.2.36.174030967.1.3.2.1",
                                                                code);

                entitlement1.Type             = EntitlementType.MedicarePharmacyApprovalNumber;
                entitlement1.ValidityDuration = BaseCDAModel.CreateInterval("1", TimeUnitOfMeasure.Year);

                participation.Participant.Entitlements = new List <Entitlement> {
                    entitlement1
                };
            }
            return(participation);
        }
        /// <summary>
        /// Create Address Organisation
        /// </summary>
        /// <returns>(IParticipationAddressee) Addressee</returns>
        private static IParticipationAddressee CreateAddresseePerson(Boolean mandatorySectionsOnly)
        {
            var addressee = SpecialistLetter.CreateAddressee();

            addressee.Participant = SpecialistLetter.CreateParticipantAddressee();

            var personName = BaseCDAModel.CreatePersonName();

            personName.GivenNames = new List <string> {
                "Tom"
            };
            personName.FamilyName = "Smith";
            personName.Titles     = new List <string> {
                "Dr"
            };
            personName.NameUsages = new List <NameUsage> {
                NameUsage.Legal
            };

            var person = BaseCDAModel.CreatePersonWithOrganisation();

            person.PersonNames = new List <IPersonName> {
                personName
            };

            addressee.Participant.Person             = person;
            addressee.Participant.Person.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPII, "8003610000021101")
            };

            var address = BaseCDAModel.CreateAddress();

            address.AddressPurpose                 = AddressPurpose.Business;
            address.AustralianAddress              = BaseCDAModel.CreateAustralianAddress();
            address.AustralianAddress.PostCode     = "4012";
            address.AustralianAddress.StreetName   = "Johnson St";
            address.AustralianAddress.StreetNumber = 12;
            address.AustralianAddress.StreetSuffix = StreetSuffix.South;
            address.AustralianAddress.StreetType   = StreetType.Street;

            addressee.Participant.Addresses = new List <IAddress> {
                address
            };

            var electronicCommunicationDetails = new List <ElectronicCommunicationDetail>
            {
                BaseCDAModel.CreateElectronicCommunicationDetail("134567891", ElectronicCommunicationMedium.Telephone, ElectronicCommunicationUsage.WorkPlace),
                BaseCDAModel.CreateElectronicCommunicationDetail("*****@*****.**", ElectronicCommunicationMedium.Email, ElectronicCommunicationUsage.WorkPlace)
            };

            addressee.Participant.ElectronicCommunicationDetails = electronicCommunicationDetails;

            if (!mandatorySectionsOnly)
            {
                addressee.Role = BaseCDAModel.CreateRole(Occupation.GeneralMedicalPractitioner);
            }
            else
            {
                addressee.Role = BaseCDAModel.CreateRole(NullFlavour.NotApplicable);
            }

            // Employment detail
            addressee.Participant.Person.Organisation             = BaseCDAModel.CreateEmploymentOrganisation();
            addressee.Participant.Person.Organisation.Name        = "Bay Hill Hospita";
            addressee.Participant.Person.Organisation.NameUsage   = OrganisationNameUsage.Other;
            addressee.Participant.Person.Organisation.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, "8003620000045562")
            };
            addressee.Participant.Person.Organisation.Department             = "Some department person";
            addressee.Participant.Person.Organisation.EmploymentType         = BaseCDAModel.CreateCodableText("Person Casual");
            addressee.Participant.Person.Organisation.Occupation             = BaseCDAModel.CreateRole(Occupation.GeneralMedicalPractitioner);
            addressee.Participant.Person.Organisation.PositionInOrganisation = BaseCDAModel.CreateCodableText("Person Manager");

            addressee.Participant.Person.Organisation.Addresses = new List <IAddress> {
                address
            };
            addressee.Participant.Person.Organisation.ElectronicCommunicationDetails = electronicCommunicationDetails;

            return(addressee);
        }
        /// <summary>
        /// Creates and Hydrates a Service Provider Person
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated IParticipationHealthProfessional object</returns>
        private static IParticipationServiceProvider CreateServiceProviderPerson(Boolean mandatorySectionsOnly)
        {
            var serviceProvider = BaseCDAModel.CreateServiceProvider();

            var participant = BaseCDAModel.CreateParticipantForServiceProvider();

            participant.Person = BaseCDAModel.CreatePersonHealthcareProvider();

            var personName = BaseCDAModel.CreatePersonName();

            personName.FamilyName = "Dr Jane Anderson";
            personName.NameUsages = new List <NameUsage> {
                NameUsage.Legal
            };

            participant.Person.PersonNames = new List <IPersonName> {
                personName
            };
            participant.Person.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPII, "8003610000001145")
            };

            var electronicCommunicationDetail = BaseCDAModel.CreateElectronicCommunicationDetail(
                "0345754566",
                ElectronicCommunicationMedium.Telephone,
                ElectronicCommunicationUsage.WorkPlace);

            var electronicCommunicationDetailEmail = BaseCDAModel.CreateElectronicCommunicationDetail(
                "*****@*****.**",
                ElectronicCommunicationMedium.Email,
                ElectronicCommunicationUsage.WorkPlace);

            participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail> {
                electronicCommunicationDetail, electronicCommunicationDetailEmail
            };

            var address = BaseCDAModel.CreateAddress();

            address.AddressPurpose    = AddressPurpose.Business;
            address.AustralianAddress = BaseCDAModel.CreateAustralianAddress();
            address.AustralianAddress.UnstructuredAddressLines = new List <string> {
                "1 Clinician Street"
            };
            address.AustralianAddress.SuburbTownLocality = "Nehtaville";
            address.AustralianAddress.State           = AustralianState.QLD;
            address.AustralianAddress.PostCode        = "5555";
            address.AustralianAddress.DeliveryPointId = 32568931;

            participant.Addresses = new List <IAddress> {
                address, address
            };

            serviceProvider.Role = BaseCDAModel.CreateRole(!mandatorySectionsOnly ? Occupation.GeneralMedicalPractitioner : Occupation.FreightHandlerRailOrRoad);

            participant.Person.Organisation             = BaseCDAModel.CreateEmploymentOrganisation();
            participant.Person.Organisation.Name        = "Bay Hill Hospital";
            participant.Person.Organisation.NameUsage   = OrganisationNameUsage.Other;
            participant.Person.Organisation.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, "8003620000045562")
            };
            participant.Person.Organisation.EmploymentType         = BaseCDAModel.CreateCodableText("Casual");
            participant.Person.Organisation.Occupation             = BaseCDAModel.CreateRole(Occupation.GeneralMedicalPractitioner);
            participant.Person.Organisation.PositionInOrganisation = BaseCDAModel.CreateCodableText("Manager");
            participant.Person.Organisation.Addresses = new List <IAddress> {
                address, address
            };
            participant.Person.Organisation.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail> {
                electronicCommunicationDetail, electronicCommunicationDetailEmail
            };

            serviceProvider.Participant = participant;

            return(serviceProvider);
        }
コード例 #24
0
        /// <summary>
        /// Creates and Hydrates a Service Provider Person
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated IParticipationHealthProfessional object</returns>
        private static IParticipationServiceProvider CreateServiceProviderPerson(Boolean mandatorySectionsOnly)
        {
            var serviceProvider = BaseCDAModel.CreateServiceProvider();

            var participant = BaseCDAModel.CreateParticipantForServiceProvider();

            participant.Person = BaseCDAModel.CreatePersonHealthcareProvider();

            var personName = BaseCDAModel.CreatePersonName();

            personName.FamilyName = "Dr Jane Anderson";
            personName.NameUsages = new List <NameUsage> {
                NameUsage.Legal
            };
            participant.Person.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPII, "8003610000001145")
            };
            participant.Person.PersonNames = new List <IPersonName> {
                personName
            };

            var electronicCommunicationDetail1 = BaseCDAModel.CreateElectronicCommunicationDetail("0345754566", ElectronicCommunicationMedium.Telephone, ElectronicCommunicationUsage.WorkPlace);
            var electronicCommunicationDetail2 = BaseCDAModel.CreateElectronicCommunicationDetail("1234", ElectronicCommunicationMedium.Email, ElectronicCommunicationUsage.WorkPlace);

            participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail>
            {
                electronicCommunicationDetail1,
                electronicCommunicationDetail2
            };

            var address = BaseCDAModel.CreateAddress();

            address.AddressPurpose    = AddressPurpose.Business;
            address.AustralianAddress = BaseCDAModel.CreateAustralianAddress();
            address.AustralianAddress.UnstructuredAddressLines = new List <string>
            {
                "1 Clinician Street"
            };
            address.AustralianAddress.SuburbTownLocality = "Nehtaville";
            address.AustralianAddress.State           = AustralianState.QLD;
            address.AustralianAddress.PostCode        = "5555";
            address.AustralianAddress.DeliveryPointId = 32568931;

            serviceProvider.Role = !mandatorySectionsOnly?BaseCDAModel.CreateRole(Occupation.GeneralMedicalPractitioner) : BaseCDAModel.CreateRole(NullFlavour.NegativeInfinity);

            participant.Addresses = new List <IAddress>
            {
                address,
                address
            };

            var entitlement = BaseCDAModel.CreateEntitlement();

            entitlement.Id                  = BaseCDAModel.CreateMedicareNumber(MedicareNumberType.MedicareCardNumber, "1234567881");
            entitlement.Type                = EntitlementType.MedicarePrescriberNumber;
            entitlement.ValidityDuration    = BaseCDAModel.CreateInterval(new ISO8601DateTime(DateTime.Now), new ISO8601DateTime(DateTime.Now));
            participant.Person.Entitlements = new List <Entitlement> {
                entitlement, entitlement
            };

            participant.Person.Qualifications = "M.B.B.S., F.R.A.C.S.";

            participant.Person.Organisation             = BaseCDAModel.CreateEmploymentOrganisation();
            participant.Person.Organisation.Name        = "Hay Bill Hospital (ServiceProviderPerson)";
            participant.Person.Organisation.NameUsage   = OrganisationNameUsage.Other;
            participant.Person.Organisation.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, "8003620000045562")
            };
            participant.Person.Organisation.Department             = "Some department service provider";
            participant.Person.Organisation.EmploymentType         = BaseCDAModel.CreateCodableText("Service Provider Casual");
            participant.Person.Organisation.Occupation             = BaseCDAModel.CreateRole(Occupation.GeneralMedicalPractitioner);
            participant.Person.Organisation.PositionInOrganisation = BaseCDAModel.CreateCodableText("Service Provider Manager");
            participant.Person.Organisation.Addresses = new List <IAddress> {
                address
            };
            participant.Person.Organisation.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail>()
            {
                electronicCommunicationDetail1, electronicCommunicationDetail2
            };

            serviceProvider.Participant = participant;

            return(serviceProvider);
        }
        /// <summary>
        /// Creates and Hydrates an Authenticator
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated authenticator</returns>
        public static void HydrateAuthenticator(IParticipationLegalAuthenticator authenticator, bool mandatoryOnly)
        {
            // LegalAuthenticator/assignedEntity
            authenticator.Participant = BaseCDAModel.CreateParticipantForLegalAuthenticator();

            // LegalAuthenticator/time/@value
            authenticator.Participant.DateTimeAuthenticated = new ISO8601DateTime(DateTime.Now, ISO8601DateTime.Precision.Minute);

            // LegalAuthenticator/assignedEntity/assignedPerson
            authenticator.Participant.Person = BaseCDAModel.CreatePerson();

            var localAuthorityCode = BaseCDAModel.CreateCodableText("EI", CodingSystem.HL7IdentifierType, null, null, null);

            // LegalAuthenticator/assignedEntity/<Entity Identifier>
            authenticator.Participant.Person.Identifiers = new List <Identifier>
            {
                BaseCDAModel.CreateIdentifier("LocalAuthority", null, "66666", "1.2.3.4.5", localAuthorityCode),
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPII, "8003615833334118")
            };

            //LegalAuthenticator/assignedEntity/assignedPerson/<Person Name>
            var name1 = BaseCDAModel.CreatePersonName();

            name1.GivenNames = new List <string> {
                "Good"
            };
            name1.FamilyName = "Doctor";
            name1.Titles     = new List <string> {
                "Doctor"
            };
            name1.NameUsages = new List <NameUsage> {
                NameUsage.Legal
            };

            authenticator.Participant.Person.PersonNames = new List <IPersonName> {
                name1
            };

            if (!mandatoryOnly)
            {
                // LegalAuthenticator/assignedEntity/code
                authenticator.Role = BaseCDAModel.CreateRole(Occupation.GeneralMedicalPractitioner);

                // LegalAuthenticator/assignedEntity/<Address>
                var address1 = BaseCDAModel.CreateAddress();
                address1.AddressPurpose    = AddressPurpose.Residential;
                address1.AustralianAddress = BaseCDAModel.CreateAustralianAddress();
                address1.AustralianAddress.UnstructuredAddressLines = new List <string> {
                    "1 Clinician Street"
                };
                address1.AustralianAddress.SuburbTownLocality = "Nehtaville";
                address1.AustralianAddress.State           = AustralianState.QLD;
                address1.AustralianAddress.PostCode        = "5555";
                address1.AustralianAddress.DeliveryPointId = 32568931;

                var address2 = BaseCDAModel.CreateAddress();
                address2.AddressPurpose                   = AddressPurpose.TemporaryAccommodation;
                address2.InternationalAddress             = BaseCDAModel.CreateInternationalAddress();
                address2.InternationalAddress.AddressLine = new List <string> {
                    "1 Overseas Street"
                };
                address2.InternationalAddress.Country       = Country.Albania;
                address2.InternationalAddress.PostCode      = "12345";
                address2.InternationalAddress.StateProvince = "Foreign Land";

                var addressList = new List <IAddress> {
                    address1, address2
                };

                authenticator.Participant.Addresses = addressList;

                // LegalAuthenticator/assignedEntity/<Electronic Communication Detail>
                var coms1 = BaseCDAModel.CreateElectronicCommunicationDetail(
                    "0345754566",
                    ElectronicCommunicationMedium.Telephone,
                    ElectronicCommunicationUsage.WorkPlace);
                var coms2 = BaseCDAModel.CreateElectronicCommunicationDetail(
                    "*****@*****.**",
                    ElectronicCommunicationMedium.Email,
                    ElectronicCommunicationUsage.WorkPlace);
                authenticator.Participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail> {
                    coms1, coms2
                };

                // LegalAuthenticator/assignedEntity/representedOrganization
                authenticator.Participant.Organisation = BaseCDAModel.CreateOrganisationName();

                // LegalAuthenticator/assignedEntity/representedOrganization/name
                authenticator.Participant.Organisation.Name = "Oz Health Clinic";

                // LegalAuthenticator/assignedEntity/representedOrganization/<Entity Identifier>
                authenticator.Participant.Organisation.Identifiers = new List <Identifier>
                {
                    BaseCDAModel.CreateIdentifier("SampleAuthority", null, null, "1.2.3.4.55555", null),
                    BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, "8003620000001144")
                };
            }
        }
        /// <summary>
        /// Creates and Hydrates an author
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>An Hydrated author</returns>
        public static IParticipationAuthorPerson CreateDocumentAuthor(bool mandatoryOnly)
        {
            // Create IParticipationAuthorPerson
            var author = BaseCDAModel.CreateAuthorPerson();

            // Document Author > Participant
            author.Participant = BaseCDAModel.CreateParticipantForAuthorPerson();

            // Create Person
            var person = BaseCDAModel.CreatePerson();

            // Document Author > Participation Period
            // This element will hold the same value as target Shared Health Summary > Date- Time Attested (ClinicalDocument/ legalAuthenticator/ time)
            author.AuthorParticipationPeriodOrDateTimeAuthored = BaseCDAModel.CreateParticipationPeriod(new ISO8601DateTime(DateTime.Now, ISO8601DateTime.Precision.Second));

            // Document Author > Role
            author.Role = BaseCDAModel.CreateCodableText(NullFlavour.NotApplicable);

            // Document Author > Participant > Person or Organisation or Device > Person > Person Name
            var name = BaseCDAModel.CreatePersonName();

            name.FamilyName = "Smith";

            // Document Author > Person Names
            person.PersonNames = new List <IPersonName> {
                name, name
            };

            var electronicCommunicationDetailPhone = BaseCDAModel.CreateElectronicCommunicationDetail(
                "0345754566",
                ElectronicCommunicationMedium.Telephone,
                ElectronicCommunicationUsage.WorkPlace);

            var electronicCommunicationDetailEmail = BaseCDAModel.CreateElectronicCommunicationDetail(
                "*****@*****.**",
                ElectronicCommunicationMedium.Email,
                ElectronicCommunicationUsage.WorkPlace);

            author.Participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail>
            {
                electronicCommunicationDetailPhone, electronicCommunicationDetailEmail
            };

            if (!mandatoryOnly)
            {
                // Document Author > Participant > Entity Identifier
                person.Identifiers = new List <Identifier> {
                    BaseCDAModel.CreateIdentifier("Test Authority", null, null, "2.999.1234567890", null),
                    BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPII, "8003615833334118")
                };

                // Document Author > Participant > Address
                var address = BaseCDAModel.CreateAddress();
                address.AddressAbsentIndicator = AddressAbsentIndicator.NoFixedAddressIndicator;
                address.AddressPurpose         = AddressPurpose.Residential;
                address.AustralianAddress      = BaseCDAModel.CreateAustralianAddress();

                var addressList = new List <IAddress> {
                    address, address
                };

                author.Participant.Addresses = addressList;

                name.GivenNames = new List <string> {
                    "Fitun"
                };
                name.Titles = new List <string> {
                    "Dr"
                };
                name.NameUsages = new List <NameUsage> {
                    NameUsage.Legal
                };

                address.AustralianAddress.UnstructuredAddressLines = new List <string> {
                    "1 Clinician Street"
                };
                address.AustralianAddress.SuburbTownLocality = "Nehtaville";
                address.AustralianAddress.State    = AustralianState.QLD;
                address.AustralianAddress.PostCode = "5555";
                address.AddressAbsentIndicator     = null;
            }

            author.Participant.Person = person;

            return(author);
        }
コード例 #27
0
        public static void PopulateAuthor(IParticipationConsumerAuthor author, bool mandatoryOnly)
        {
            var person = BaseCDAModel.CreatePerson();

            // Document Author > Participation Period
            author.AuthorParticipationPeriodOrDateTimeAuthored = new ISO8601DateTime(DateTime.Now);

            // Document Author > Role
            author.Role = BaseCDAModel.CreateRole(Occupation.MedicalOncologist);

            // Document Author > Participant
            author.Participant = ConsumerEnteredHealthSummary.CreateParticipantForAuthor();

            // Document Author > Participant > Entity Identifier

            person.Identifiers = new List <Identifier>();

            if (!mandatoryOnly)
            {
                // IHI
                person.Identifiers.Add(BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.IHI, "8003604444567894"));
            }
            else
            {
                // Care Agency Employee Identifier
                person.Identifiers.Add(
                    BaseCDAModel.CreateIdentifier(
                        "Care Agency Employee Identifier",
                        HealthcareIdentifierGeographicArea.LocalClientIdentifier,
                        null,
                        "1.2.36.1.2001.1007.4.9123453453453458",
                        null));
            }

            // Document Author > Participant > Per-son or Organisation or Device > Person > Person Name
            var name1 = BaseCDAModel.CreatePersonName();

            name1.FamilyName = "Doctor";

            var name2 = BaseCDAModel.CreatePersonName();

            name2.FamilyName = "Wong";

            person.PersonNames = new List <IPersonName>()
            {
                name1, name2
            };

            if (!mandatoryOnly)
            {
                author.Participant.RelationshipToSubjectOfCare = BaseCDAModel.CreateRole(Occupation.MedicalOncologist);

                name1.GivenNames = new List <string> {
                    "Good"
                };
                name1.Titles = new List <string> {
                    "Doctor"
                };
                name1.NameUsages = new List <NameUsage> {
                    NameUsage.Legal
                };

                name2.GivenNames = new List <string> {
                    "Davey"
                };
                name2.Titles = new List <string> {
                    "Brother"
                };
                name2.NameUsages = new List <NameUsage> {
                    NameUsage.NewbornName
                };

                // Document Author > Participant > Address
                var address1 = BaseCDAModel.CreateAddress();
                address1.AddressPurpose    = AddressPurpose.Residential;
                address1.AustralianAddress = BaseCDAModel.CreateAustralianAddress();

                var address2 = BaseCDAModel.CreateAddress();
                address2.AddressPurpose    = AddressPurpose.TemporaryAccommodation;
                address2.AustralianAddress = BaseCDAModel.CreateAustralianAddress();

                var addressList = new List <IAddress> {
                    address1, address2
                };

                author.Participant.Addresses = addressList;

                address1.AustralianAddress.UnstructuredAddressLines = new List <string> {
                    "1 Clinician Street"
                };
                address1.AustralianAddress.SuburbTownLocality = "Nehtaville";
                address1.AustralianAddress.State           = AustralianState.QLD;
                address1.AustralianAddress.PostCode        = "5555";
                address1.AustralianAddress.DeliveryPointId = 32568931;

                address2.AustralianAddress.UnstructuredAddressLines = new List <string> {
                    "2 Clinician Street"
                };
                address2.AustralianAddress.SuburbTownLocality = "Nehtaville";
                address2.AustralianAddress.State           = AustralianState.QLD;
                address2.AustralianAddress.PostCode        = "5555";
                address2.AustralianAddress.DeliveryPointId = 32568931;

                // Document Author > Participant > Electronic Communication Detail
                var coms1 = BaseCDAModel.CreateElectronicCommunicationDetail(
                    "0345754566",
                    ElectronicCommunicationMedium.Telephone,
                    ElectronicCommunicationUsage.WorkPlace);

                var coms2 = BaseCDAModel.CreateElectronicCommunicationDetail(
                    "*****@*****.**",
                    ElectronicCommunicationMedium.Email,
                    ElectronicCommunicationUsage.WorkPlace);

                author.Participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail> {
                    coms1, coms2
                };
            }

            author.Participant.Person = person;
        }
        /// <summary>
        /// Creates and Hydrates a IParticipationReceivingLaboratory
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>IParticipationReceivingLaboratory</returns>
        private static IParticipationReportingPathologist CreateReportingPathologist(Boolean mandatoryOnly)
        {
            // Receiving Laboratory
            var reportingPathologist = PathologyResultReport.CreateReportingPathologist();

            // Document reportingPathologist > Participant
            reportingPathologist.Participant = PathologyResultReport.CreateParticipantForReportingPathologist();

            var person = BaseCDAModel.CreatePersonWithOrganisation();

            // Participation Period
            reportingPathologist.ParticipationEndTime = new ISO8601DateTime(DateTime.Now);

            // Document reportingPathologist > Role
            reportingPathologist.Role = PathologyResultReport.CreateRole(Occupation.Pathologist);

            // Document reportingPathologist > Participant > Person or Organisation or Device > Person > Person Name
            var name = BaseCDAModel.CreatePersonName();

            name.FamilyName = "Doctor";

            person.PersonNames = new List <IPersonName> {
                name
            };

            // Document reportingPathologist > Participant > Address
            var address1 = BaseCDAModel.CreateAddress();

            address1.AddressPurpose    = AddressPurpose.Business;
            address1.AustralianAddress = BaseCDAModel.CreateAustralianAddress();

            var address2 = BaseCDAModel.CreateAddress();

            address2.AddressPurpose    = AddressPurpose.Business;
            address2.AustralianAddress = BaseCDAModel.CreateAustralianAddress();

            var addressList = new List <IAddress> {
                address1, address2
            };

            reportingPathologist.Participant.Addresses = addressList;

            // Document reportingPathologist > Participant > Electronic Communication Detail
            var coms1 = BaseCDAModel.CreateElectronicCommunicationDetail(
                "0345754566",
                ElectronicCommunicationMedium.Telephone,
                ElectronicCommunicationUsage.WorkPlace);
            var coms2 = BaseCDAModel.CreateElectronicCommunicationDetail(
                "*****@*****.**",
                ElectronicCommunicationMedium.Email,
                ElectronicCommunicationUsage.WorkPlace);

            reportingPathologist.Participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail> {
                coms1, coms2
            };

            // Participant > Entitlement
            var entitlement = BaseCDAModel.CreateEntitlement();
            var code        = BaseCDAModel.CreateCodableText("11", CodingSystem.NCTISEntitlementTypeValues, "Medicare Pharmacy Approval Number", null, null);

            entitlement.Id = BaseCDAModel.CreateIdentifier("Pharmacy",
                                                           null,
                                                           "1234567892",
                                                           "1.2.36.174030967.1.3.2.1",
                                                           code);

            entitlement.Type             = EntitlementType.MedicarePharmacyApprovalNumber;
            entitlement.ValidityDuration = BaseCDAModel.CreateInterval("1", TimeUnitOfMeasure.Year);

            reportingPathologist.Participant.Entitlements = new List <Entitlement> {
                entitlement, entitlement
            };

            person.Organisation                        = BaseCDAModel.CreateEmploymentOrganisation();
            person.Organisation.Name                   = "Hay Bill Hospital";
            person.Organisation.NameUsage              = OrganisationNameUsage.Other;
            person.Organisation.Department             = "Some department service provider";
            person.Organisation.EmploymentType         = BaseCDAModel.CreateCodableText(null, null, null, "Casual", null);
            person.Organisation.Occupation             = PathologyResultReport.CreateRole(Occupation.GeneralMedicalPractitioner);
            person.Organisation.PositionInOrganisation = BaseCDAModel.CreateCodableText(null, null, null, "Manager", null);

            person.Organisation.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, "8003620833333789"),
                BaseCDAModel.CreateIdentifier("NATA", null, "3715", "1.2.36.1.2001.1005.12", BaseCDAModel.CreateCodableText("XX", CodingSystem.HL7IdentifierType, "Organization identifier"))
            };

            // Document reportingPathologist > Participant > Entity Identifier
            person.Identifiers = new List <Identifier> {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPII, "8003615833334118"),
            };

            if (!mandatoryOnly)
            {
                name.GivenNames = new List <string> {
                    "Good"
                };
                name.Titles = new List <string> {
                    "Doctor"
                };
                name.NameUsages = new List <NameUsage> {
                    NameUsage.Legal
                };

                address1.AustralianAddress.UnstructuredAddressLines = new List <string> {
                    "1 Clinician Street"
                };
                address1.AustralianAddress.SuburbTownLocality = "Nehtaville";
                address1.AustralianAddress.State           = AustralianState.QLD;
                address1.AustralianAddress.PostCode        = "5555";
                address1.AustralianAddress.DeliveryPointId = 32568931;

                address2.AustralianAddress.UnstructuredAddressLines = new List <string> {
                    "2 Clinician Street"
                };
                address2.AustralianAddress.SuburbTownLocality = "Nehtaville";
                address2.AustralianAddress.State           = AustralianState.QLD;
                address2.AustralianAddress.PostCode        = "5555";
                address2.AustralianAddress.DeliveryPointId = 32568931;

                // Qualifications
                reportingPathologist.Participant.Qualifications = "FRACGP";
            }

            reportingPathologist.Participant.Person = person;

            return(reportingPathologist);
        }
        /// <summary>
        /// Creates and Hydrates the Participation Author Non Healthcare Provider
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated IParticipationAuthorNonHealthcareProvider object</returns>
        public static IParticipationAuthorPerson HydrateAuthorNonHealthcareProvider(IParticipationAuthorPerson author, bool mandatoryIdentifier, bool mandatoryOnly)
        {
            var person = BaseCDAModel.CreatePersonNonHealthcareProvider();

            // Document Author > Participant
            author.Participant = BaseCDAModel.CreateParticipantForAuthorPerson();

            // Author Role
            author.Role = BaseCDAModel.CreateRole(RoleCodeAndRoleClassCodes.Self);

            // Document Author > Participation Period
            author.AuthorParticipationPeriodOrDateTimeAuthored = BaseCDAModel.CreateParticipationPeriod(new ISO8601DateTime(DateTime.Now));

            // Document Author > Participant > Person or Organisation or Device > Person > Person Name
            var name1 = BaseCDAModel.CreatePersonName();

            name1.FamilyName = "Doctor";

            var name2 = BaseCDAModel.CreatePersonName();

            name2.FamilyName = "Wong";

            person.PersonNames = new List <IPersonName> {
                name1, name2
            };

            if (mandatoryIdentifier || !mandatoryOnly)
            {
                // Document Author > Participant > Entity Identifier
                person.Identifiers = new List <Identifier> {
                    BaseCDAModel.CreateIdentifier("AuthorNonHealthcareProvider", null, null, "1.2.3.4.5.66666", null),
                    BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPII, "8003615833334118"),
                };
            }

            if (!mandatoryOnly)
            {
                name1.GivenNames = new List <string> {
                    "Good"
                };
                name1.Titles = new List <string> {
                    "Doctor"
                };
                name1.NameUsages = new List <NameUsage> {
                    NameUsage.Legal
                };

                name2.GivenNames = new List <string> {
                    "Davey"
                };
                name2.Titles = new List <string> {
                    "Brother"
                };
                name2.NameUsages = new List <NameUsage> {
                    NameUsage.NewbornName
                };

                // Document Author > Participant > Address
                var address1 = BaseCDAModel.CreateAddress();
                address1.AddressPurpose    = AddressPurpose.Residential;
                address1.AustralianAddress = BaseCDAModel.CreateAustralianAddress();

                var address2 = BaseCDAModel.CreateAddress();
                address2.AddressPurpose    = AddressPurpose.TemporaryAccommodation;
                address2.AustralianAddress = BaseCDAModel.CreateAustralianAddress();

                var addressList = new List <IAddress> {
                    address1, address2
                };

                author.Participant.Addresses = addressList;

                address1.AustralianAddress.UnstructuredAddressLines = new List <string> {
                    "1 Clinician Street"
                };
                address1.AustralianAddress.SuburbTownLocality = "Nehtaville";
                address1.AustralianAddress.State           = AustralianState.QLD;
                address1.AustralianAddress.PostCode        = "5555";
                address1.AustralianAddress.DeliveryPointId = 32568931;

                address2.AustralianAddress.UnstructuredAddressLines = new List <string> {
                    "2 Clinician Street"
                };
                address2.AustralianAddress.SuburbTownLocality = "Nehtaville";
                address2.AustralianAddress.State           = AustralianState.QLD;
                address2.AustralianAddress.PostCode        = "5555";
                address2.AustralianAddress.DeliveryPointId = 32568931;

                // Document Author > Participant > Elec-tronic Communication Detail
                var coms1 = BaseCDAModel.CreateElectronicCommunicationDetail(
                    "0345754566",
                    ElectronicCommunicationMedium.Telephone,
                    ElectronicCommunicationUsage.WorkPlace);
                var coms2 = BaseCDAModel.CreateElectronicCommunicationDetail(
                    "*****@*****.**",
                    ElectronicCommunicationMedium.Email,
                    ElectronicCommunicationUsage.WorkPlace);

                author.Participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail> {
                    coms1, coms2
                };
            }

            author.Participant.Person = person;

            return(author);
        }
        /// <summary>
        /// Creates a patient nominated contact.
        /// </summary>
        /// <param name="givenName">Given name</param>
        /// <param name="familyName">Family name</param>
        /// <param name="hpii">Hpii</param>
        /// <param name="addressLine">Address line</param>
        /// <param name="phone">Phone</param>
        /// <param name="mandatoryOnly">Show mandatory objects</param>
        /// <returns>IParticipationAcdCustodian</returns>
        private static IParticipationAcdCustodian CreateAcdCustodianPerson(
            string givenName, string familyName, string hpii, string addressLine, string phone, bool mandatoryOnly)
        {
            IParticipationAcdCustodian paticipation = AcdCustodianRecord.CreateParticipationAcdCustodian();

            paticipation.ParticipationPeriod = BaseCDAModel.CreateInterval(
                new ISO8601DateTime(DateTime.Now.AddDays(-50)),
                new ISO8601DateTime(DateTime.Now));

            paticipation.Role        = BaseCDAModel.CreateRole(Occupation.GeneralMedicalPractitioner);
            paticipation.Participant = AcdCustodianRecord.CreateAcdCustodian();

            // Name
            var person     = BaseCDAModel.CreatePersonConsumer();
            var personName = BaseCDAModel.CreatePersonName();

            personName.GivenNames = new List <string> {
                givenName
            };
            personName.FamilyName = familyName;
            personName.Titles     = new List <string> {
                "Dr"
            };
            personName.NameUsages = new List <NameUsage> {
                NameUsage.Legal
            };
            person.PersonNames = new List <IPersonName> {
                personName
            };

            paticipation.Participant.Person = person;

            // Address
            IAddressAustralian address = BaseCDAModel.CreateAddress();

            address.AddressPurpose    = AddressPurpose.Business;
            address.AustralianAddress = BaseCDAModel.CreateAustralianAddress();
            address.AustralianAddress.UnstructuredAddressLines = new List <string> {
                addressLine
            };
            address.AustralianAddress.SuburbTownLocality = "Nehtaville";
            address.AustralianAddress.State    = AustralianState.QLD;
            address.AustralianAddress.PostCode = "5555";

            paticipation.Participant.Addresses = new List <IAddressAustralian> {
                address
            };

            // Identifiers
            paticipation.Participant.Person.Identifiers = new List <Identifier>
            {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPII, hpii)
            };


            if (!mandatoryOnly)
            {
                person.DateOfBirth = new ISO8601DateTime(DateTime.Now);
                person.Gender      = Gender.Male;

                // Communication
                var electronicCommunicationDetail = AcdCustodianRecord.CreateElectronicCommunicationDetail
                                                    (
                    phone,
                    ElectronicCommunicationMedium.Telephone,
                    ElectronicCommunicationUsage.WorkPlace
                                                    );
                paticipation.Participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail>
                {
                    electronicCommunicationDetail
                };

                person.Organisation             = BaseCDAModel.CreateEmploymentOrganisation();
                person.Organisation.Identifiers = new List <Identifier> {
                    BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, "8003620000021100")
                };
                person.Organisation.Name       = "Super Healthy Hospital";
                person.Organisation.NameUsage  = OrganisationNameUsage.EnterpriseName;
                person.Organisation.Department = "Endocrinology";

                person.Organisation.EmploymentType         = BaseCDAModel.CreateCodableText(EmploymentType.FullTime);
                person.Organisation.Occupation             = BaseCDAModel.CreateRole(Occupation.GeneralMedicalPractitioner);
                person.Organisation.PositionInOrganisation = BaseCDAModel.CreateCodableText(null, null, null, "SMO", null);
            }

            return(paticipation);
        }