예제 #1
0
        /// <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("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)
            {
                // 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";
                address1.AustralianAddress.DeliveryPointId = 32568931;

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

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

                var identifier = BaseCDAModel.CreateIdentifier
                                 (
                    "SampleAuthority",
                    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 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;
        }
예제 #3
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);
        }
예제 #4
0
        /// <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> {
                "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
            };

            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";
                address1.AustralianAddress.DeliveryPointId = 32568931;

                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);
        }
        /// <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, string organisationName, bool mandatoryOnly)
        {
            // Document Author > Participant
            author.Participant = BaseCDAModel.CreateParticipantForAuthorHealthcareProvider();

            var person = BaseCDAModel.CreatePersonHealthcareProvider();

            author.AuthorParticipationPeriodOrDateTimeAuthored = mandatoryOnly ?
                                                                 BaseCDAModel.CreateParticipationPeriod(new ISO8601DateTime(DateTime.Now, ISO8601DateTime.Precision.Second)) :
                                                                 BaseCDAModel.CreateParticipationPeriod(BaseCDAModel.CreateInterval(new ISO8601DateTime(DateTime.Now, ISO8601DateTime.Precision.Second), new ISO8601DateTime(DateTime.Now, ISO8601DateTime.Precision.Second)));

            // Document Author > Role = AddressPurpose.Residential
            author.Role = BaseCDAModel.CreateRole(Occupation.MedicalLaboratoryScientist, CodingSystem.ANZSCORevision1);

            // Document Author > Participant > Person or Organisation or Device > Person > Person Name (Note: 1..* in ACI)
            var name = BaseCDAModel.CreatePersonName();

            if (!mandatoryOnly)
            {
                // Not providing a family name will insert a nullflavor of 'NI'
                name.FamilyName = "Doctor family name";
            }

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

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

            person.Organisation      = BaseCDAModel.CreateEmploymentOrganisation();
            person.Organisation.Name = organisationName;

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

            // 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
            };

            if (!mandatoryOnly)
            {
                // Document Author > Participant > Address (Note: optional in ACI)
                var address1 = BaseCDAModel.CreateAddress();
                address1.AddressPurpose    = AddressPurpose.Business;
                address1.AustralianAddress = BaseCDAModel.CreateAustralianAddress();

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

                // Document Author > Participant > Addresses
                author.Participant.Addresses = new List <IAddress> {
                    address1, address2
                };

                name.GivenNames = new List <string> {
                    "Fitun"
                };
                name.Titles = new List <string> {
                    "Dr"
                };
                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";

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

                person.Organisation.NameUsage = OrganisationNameUsage.Other;

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

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

                person.Organisation.Addresses = new List <IAddress>
                {
                    address1, address2
                };

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

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

                entitlement.Type             = EntitlementType.MedicarePrescriberNumber;
                entitlement.ValidityDuration = BaseCDAModel.CreateInterval(new ISO8601DateTime(DateTime.Now), new ISO8601DateTime(DateTime.Now.AddYears(1)));

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

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

            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 IParticipationReportingRadiologist CreateReportingRadiologist(Boolean mandatoryOnly)
        {
            // Receiving Laboratory
            var reportingPathologist = BaseCDAModel.CreateReportingRadiologist();

            // Document reportingPathologist > Participant
            reportingPathologist.Participant = BaseCDAModel.CreateParticipantForReportingRadiologist();

            var person = BaseCDAModel.CreatePersonWithOrganisation();

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

            // Document reportingPathologist > Role
            reportingPathologist.Role = DiagnosticImagingReport.CreateRole(Occupation.MedicalLaboratoryScientist);

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

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

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

            // Employment Organisation
            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("Casual");
            person.Organisation.Occupation             = DiagnosticImagingReport.CreateRole(Occupation.GeneralMedicalPractitioner);
            person.Organisation.PositionInOrganisation = BaseCDAModel.CreateCodableText("Radiologist");

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

            if (!mandatoryOnly)
            {
                // 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
                };

                // 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;

                // Participant > Entitlement 1
                var medicarePharmacyApprovalNumberEntitlement = BaseCDAModel.CreateEntitlement();
                var code = BaseCDAModel.CreateCodableText("11", CodingSystem.NCTISEntitlementTypeValues, "Medicare Pharmacy Approval Number", null, null);
                medicarePharmacyApprovalNumberEntitlement.Id = BaseCDAModel.CreateIdentifier("Pharmacy",
                                                                                             null,
                                                                                             "1234567892",
                                                                                             "1.2.36.174030967.1.3.2.1",
                                                                                             code);
                medicarePharmacyApprovalNumberEntitlement.Type             = EntitlementType.MedicarePharmacyApprovalNumber;
                medicarePharmacyApprovalNumberEntitlement.ValidityDuration = BaseCDAModel.CreateInterval("1", TimeUnitOfMeasure.Year);

                // Participant > Entitlement 2
                var medicarePrescriberNumberEntitlement = BaseCDAModel.CreateEntitlement();
                var medicarePharmacyApprovalNumberCode  = BaseCDAModel.CreateCodableText("10", CodingSystem.NCTISEntitlementTypeValues, "Medicare Prescriber Number", null, null);
                medicarePrescriberNumberEntitlement.Id = BaseCDAModel.CreateIdentifier("Prescriber",
                                                                                       null,
                                                                                       "049960CT",
                                                                                       "1.2.36.174030967.0.3",
                                                                                       medicarePharmacyApprovalNumberCode);

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

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

                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);
        }
예제 #7
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("Test Authority", null, null, "2.999.1234567890", 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";

                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>
        /// Creates and Hydrates a IParticipationRequester
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>IParticipationRequester</returns>
        public static IParticipationRequester CreateRequester(Boolean mandatoryOnly)
        {
            // Receiving Laboratory
            var requester = BaseCDAModel.CreateRequester();

            // Document Requester> Participant
            requester.Participant = BaseCDAModel.CreateParticipantForRequester();

            var person = BaseCDAModel.CreatePersonWithOrganisation();

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

            // Document Requester> Role
            requester.Role = BaseCDAModel.CreateRole(Occupation.MedicalLaboratoryScientist, CodingSystem.ANZSCORevision1);

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

            name1.FamilyName = "Requester";

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

            person.Organisation      = BaseCDAModel.CreateEmploymentOrganisation();
            person.Organisation.Name = "Requester";

            if (!mandatoryOnly)
            {
                // Null or empty provides the null flavor for asEmployment
                person.Organisation.Name = "Requester Organisation Name";

                person.PersonNames.Add(name1);

                // Participant > Entitlement
                var entitlement = BaseCDAModel.CreateEntitlement();
                var code        = BaseCDAModel.CreateCodableText("11", CodingSystem.NCTISEntitlementTypeValues, "Pharmacy", 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(new ISO8601DateTime(DateTime.Now), new ISO8601DateTime(DateTime.Now));

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

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

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

                // Document Requester> 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
                };

                requester.Participant.Addresses = addressList;

                person.Organisation.NameUsage              = OrganisationNameUsage.Other;
                person.Organisation.Department             = "Some department requester";
                person.Organisation.EmploymentType         = BaseCDAModel.CreateCodableText(EmploymentType.Casual);
                person.Organisation.Occupation             = BaseCDAModel.CreateRole(Occupation.GeneralMedicalPractitioner, CodingSystem.ANZSCORevision1);
                person.Organisation.PositionInOrganisation = BaseCDAModel.CreateCodableText("Manager");

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

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

                name1.GivenNames = new List <string> {
                    "Fitun"
                };
                name1.Titles = new List <string> {
                    "Healthy"
                };
                name1.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";

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

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

            requester.Participant.Person = person;

            return(requester);
        }
        /// <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> {
                "Doctor"
            };
            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";
            address.AustralianAddress.DeliveryPointId = 32568931;

            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(null, null, null, "Permanent", null);
                person.Organisation.Occupation             = BaseCDAModel.CreateRole(Occupation.GeneralMedicalPractitioner);
                person.Organisation.PositionInOrganisation = BaseCDAModel.CreateCodableText(null, null, null, "SMO", null);
            }

            return(paticipation);
        }
        /// <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 IParticipationSubjectOfCare PopulateSubjectofCare(bool mandatoryOnly)
        {
            var subjectOfCare = BaseCDAModel.CreateSubjectOfCare();

            var participant = BaseCDAModel.CreateParticipantForSubjectOfCare();

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

            // Subject of Care > Participant > Entity Identifier
            person.Identifiers = new List <Identifier>
            {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.IHI, "8003604444567894"),
                BaseCDAModel.CreateMedicalRecordNumber("123456", "1.2.3.4", "Croydon GP Centre"),
                // NOTE : ONLY 11 digit Individual Medicare Card Number's is permitted in the Entity Identifier
                BaseCDAModel.CreateMedicareNumber(MedicareNumberType.IndividualMedicareCardNumber, "59501704511"),
                BaseCDAModel.CreateIdentifier
                (
                    "SampleAuthority",
                    HealthcareIdentifierGeographicArea.StateOrTerritoryIdentifier,
                    "457456",
                    "1.22.333.444.55555",
                    BaseCDAModel.CreateCodableText("1.1.1.1.1.1", CodingSystem.NCTIS, "DisplayName", "Original Text", null)
                )
            };

            // 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
            };

            var name2 = BaseCDAModel.CreatePersonName();

            name2.FamilyName = "Grant";
            name2.GivenNames = new List <string> {
                "Wally"
            };
            name2.Titles = new List <string> {
                "Mr"
            };
            name2.NameUsages = new List <NameUsage> {
                NameUsage.NewbornName
            };

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

            // Subject of Care > Participant > Person or Organisation or Device > Person > Demographic Data > Indigenous Status
            person.IndigenousStatus = IndigenousStatus.NeitherAboriginalNorTorresStraitIslanderOrigin;

            // Subject of Care > Participant > Person or Organisation or Device > Person > Demographic Data > Indigenous Status
            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));

            if (!mandatoryOnly)
            {
                // 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 > Age Detail -> Age
                person.Age = 54;

                // 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
                };

                // Subject of Care > Participant > Address
                var address1 = BaseCDAModel.CreateAddress();

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

                var address2 = BaseCDAModel.CreateAddress();
                address2.AddressPurpose       = AddressPurpose.TemporaryAccommodation;
                address2.InternationalAddress = BaseCDAModel.CreateInternationalAddress();

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

                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;

                address2.InternationalAddress.AddressLine = new List <string> {
                    "1 Overseas Street"
                };
                address2.InternationalAddress.Country       = Country.NewCaledonia;
                address2.InternationalAddress.PostCode      = "12345";
                address2.InternationalAddress.StateProvince = "Foreign Land";

                person.DateOfBirthCalculatedFromAge = true;
                person.DateOfBirthAccuracyIndicator = new DateAccuracyIndicator(true, true, true);
                person.AgeAccuracyIndicator         = true;
                person.BirthPlurality = 3;
                person.BirthOrder     = 2;
                person.DateOfDeath    = new ISO8601DateTime(DateTime.Now, ISO8601DateTime.Precision.Day);
                person.DateOfDeathAccuracyIndicator = new DateAccuracyIndicator(true, true, true);
                person.CountryOfBirth = Country.Australia;
                person.StateOfBirth   = AustralianState.QLD;

                // Subject of Care > Participant > Entitle-ment
                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, "2244567891");
                entitlement2.Type             = EntitlementType.MedicareBenefits;
                entitlement2.ValidityDuration = BaseCDAModel.CreateInterval("1", TimeUnitOfMeasure.Year);

                var mothersOriginalFamilyName = BaseCDAModel.CreatePersonName();
                mothersOriginalFamilyName.FamilyName = "Jones";

                // Subject of Care > Participant > Person or Organisation or Device > Person > Mothers Original Family Name
                person.MothersOriginalFamilyName = mothersOriginalFamilyName;

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

            participant.Person        = person;
            subjectOfCare.Participant = participant;

            return(subjectOfCare);
        }
예제 #11
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 PopulatePSML_1B(Boolean mandatorySectionsOnly)
        {
            var pharmacySharedMedsList = Nehta.VendorLibrary.CDA.Common.PCML.CreatePCML();

            // Include Logo
            pharmacySharedMedsList.IncludeLogo = true;
            pharmacySharedMedsList.LogoPath    = OutputFolderPath;

            // Set Creation Time
            pharmacySharedMedsList.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
            if (!mandatorySectionsOnly)
            {
                // Set Id
                cdaContext.SetId = BaseCDAModel.CreateIdentifier(BaseCDAModel.CreateOid(), null);
                // CDA Context Version
                cdaContext.Version = "1";

                // Legal authenticator
                cdaContext.LegalAuthenticator = BaseCDAModel.CreateLegalAuthenticator();
                GenericObjectReuseSample.HydrateAuthenticator(cdaContext.LegalAuthenticator, mandatorySectionsOnly);

                // Information Recipients
                cdaContext.InformationRecipients = new List <IParticipationInformationRecipient>();

                var recipient1 = BaseCDAModel.CreateInformationRecipient();
                GenericObjectReuseSample.HydrateRecipient(recipient1, RecipientType.Primary, mandatorySectionsOnly);

                var recipient2 = BaseCDAModel.CreateInformationRecipient();
                GenericObjectReuseSample.HydrateRecipient(recipient2, RecipientType.Secondary, mandatorySectionsOnly);

                cdaContext.InformationRecipients.AddRange(new[] { recipient1, recipient2 });
            }

            pharmacySharedMedsList.CDAContext = cdaContext;
            #endregion

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

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

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

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

            if (!mandatorySectionsOnly)
            {
                // Context>Encounter>HEALTHCARE FACILITY
                pharmacySharedMedsList.SCSContext.Encounter = new Encounter
                {
                    HealthcareFacility = PopulateHealthcareFacility(mandatorySectionsOnly)
                };
            }

            pharmacySharedMedsList.SCSContext.SubjectOfCare = BaseCDAModel.CreateSubjectOfCare();
            GenericObjectReuseSample.HydrateSubjectofCare(pharmacySharedMedsList.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 > Identifier
            person.Participant.Person.Identifiers = new List <Identifier>
            {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPII, "8003615833334118")
            };

            // 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;

            // New requirement to make address mandatory
            person.Participant.Person.Organisation.Addresses = new List <IAddress> {
                address1
            };

            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
                };

                // Optional Participants
                pharmacySharedMedsList.SCSContext.Participant = new List <IParticipationPersonOrOrganisation>();
                pharmacySharedMedsList.SCSContext.Participant.Add(person);
            }

            #endregion

            #region Setup and populate the SCS Content model

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

            //Use Custom Narrative instead of Attachment - 1B
            //pharmacyCuratedMedsList.SCSContent.EncapsulatedData = BaseCDAModel.CreateEncapsulatedData();
            pharmacySharedMedsList.ShowAdministrativeObservationsSection           = false;
            pharmacySharedMedsList.ShowAdministrativeObservationsNarrativeAndTitle = false;

            // Build Narrative
            var sdt = new StrucDocText();

            sdt.table = new[]
            {
                new StrucDocTable
                {
                    caption = new StrucDocCaption {
                        Text = new [] { "Patient History" }
                    },
                    tbody = new [] { new StrucDocTbody
                                     {
                                         tr = new [] { new StrucDocTr {
                                                           td = new [] { AddTd("Allergies"), AddTd("Nil Known") }
                                                       },
                                                       new StrucDocTr {
                                                           td = new [] { AddTd("Diagnosis"), AddTd("CVA, TIA, Hypertension") }
                                                       } }
                                     } }
                },
                new StrucDocTable
                {
                    caption = new StrucDocCaption {
                        Text = new [] { "Medications" }
                    },
                    thead = new StrucDocThead {
                        tr = new [] { new StrucDocTr {
                                          td = new [] { AddTd("Drug", "BoldxColWidthPx200"), AddTd("Direction", "BoldxColWidthPx200"), AddTd("B'fast", "BoldxColWidthPx20"), AddTd("Lunch", "BoldxColWidthPx20"), AddTd("Dinner", "BoldxColWidthPx20"), AddTd("B'time", "BoldxColWidthPx20"), AddTd("Indication", "BoldxColWidthPx200"), AddTd("Special Instructions", "BoldxColWidthPx220") }
                                      } }
                    },
                    tbody = new [] { new StrucDocTbody {
                                         tr = new []
                                         {
                                             new StrucDocTr {
                                                 td = new [] { AddTd("LanoxnPG62.5mcgTb"), AddTd("One on alternate morning"), AddTd("1"), AddTd(""), AddTd(""), AddTd(""), AddTd("Heart rate"), AddTd("") }
                                             },
                                             new StrucDocTr {
                                                 td = new [] { AddTd("Paralgin500mgTb"), AddTd("One four times daily"), AddTd("1"), AddTd("1"), AddTd("1"), AddTd("1"), AddTd("Pain"), AddTd("") }
                                             },
                                             new StrucDocTr {
                                                 td = new [] { AddTd("CandesartanSZ16mg"), AddTd("One in the morning"), AddTd("1"), AddTd(""), AddTd(""), AddTd(""), AddTd("High Blood Pressume"), AddTd("") }
                                             },
                                             new StrucDocTr {
                                                 td = new [] { AddTd("Rispa 0.5mg Tab"), AddTd("One at bedtime"), AddTd(""), AddTd(""), AddTd(""), AddTd("1"), AddTd("Behavioural Disorder"), AddTd("") }
                                             },
                                             new StrucDocTr {
                                                 td = new [] { AddTd("Apo-Rabeprzle20mgTb"), AddTd("One in the morning"), AddTd("1"), AddTd(""), AddTd(""), AddTd(""), AddTd("Barrett's Oesaphagus"), AddTd("") }
                                             },
                                             new StrucDocTr {
                                                 td = new [] { AddTd("Sorbolene Cream"), AddTd("Apply twice daily for dry skin after bath"), AddTd("Ap"), AddTd(""), AddTd("Ap"), AddTd(""), AddTd("Dry Skin"), AddTd("") }
                                             },
                                             new StrucDocTr {
                                                 td = new [] { AddTd("Liquifilm TearsEyDrp"), AddTd("Instill one drop four times daily into both eyes"), AddTd("1"), AddTd("1"), AddTd("1"), AddTd(""), AddTd("Dry Eyes"), AddTd("") }
                                             },
                                             new StrucDocTr {
                                                 td = new [] { AddTd("Keflex 500mg Cap"), AddTd("One three times daily for seven days"), AddTd("1"), AddTd("1"), AddTd("1"), AddTd(""), AddTd(""), AddTd("") }
                                             },
                                             new StrucDocTr {
                                                 td = new [] { AddTd("Coloxyl/SennaTab"), AddTd("One at dinner when necessary if BNO 3/7"), AddTd("1"), AddTd("1"), AddTd("1"), AddTd("1"), AddTd("Constipation"), AddTd("") }
                                             },
                                             new StrucDocTr {
                                                 td = new [] { AddTd("Fosamax70mgTab"), AddTd("One on Thursday morning half an hour before food"), AddTd("1"), AddTd(""), AddTd(""), AddTd(""), AddTd("Asteoporosis"), AddTd("") }
                                             },
                                         }
                                     } }
                }
            };


            // Save Custom Text
            var narrativeOnlyDocument = BaseCDAModel.CreateNarrativeOnlyDocument();
            narrativeOnlyDocument.Title     = "Patient Medication Record";
            narrativeOnlyDocument.Narrative = sdt;

            pharmacySharedMedsList.SCSContent.CustomNarrativePcmlRecord = new List <NarrativeOnlyDocument>();
            pharmacySharedMedsList.SCSContent.CustomNarrativePcmlRecord.Add(narrativeOnlyDocument);

            #endregion


            return(pharmacySharedMedsList);
        }
예제 #12
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 PopulatePSML_1A(Boolean mandatorySectionsOnly)
        {
            var pharmacySharedMedsList = Nehta.VendorLibrary.CDA.Common.PCML.CreatePCML();

            // Include Logo
            pharmacySharedMedsList.IncludeLogo = false;

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

            #region Setup and populate the CDA context model

            // Setup and populate the CDA context model
            ICDAContextPCML 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
            if (!mandatorySectionsOnly)
            {
                // Set Id
                cdaContext.SetId = BaseCDAModel.CreateIdentifier(BaseCDAModel.CreateOid(), null);
                // CDA Context Version
                cdaContext.Version = "1";

                // Legal authenticator
                cdaContext.LegalAuthenticator = BaseCDAModel.CreateLegalAuthenticator();
                GenericObjectReuseSample.HydrateAuthenticator(cdaContext.LegalAuthenticator, mandatorySectionsOnly);

                // Information Recipients
                cdaContext.InformationRecipients = new List <IParticipationInformationRecipient>();

                var recipient1 = BaseCDAModel.CreateInformationRecipient();
                GenericObjectReuseSample.HydrateRecipient(recipient1, RecipientType.Primary, mandatorySectionsOnly);

                var recipient2 = BaseCDAModel.CreateInformationRecipient();
                GenericObjectReuseSample.HydrateRecipient(recipient2, RecipientType.Secondary, mandatorySectionsOnly);

                cdaContext.InformationRecipients.AddRange(new[] { recipient1, recipient2 });
            }


            pharmacySharedMedsList.CDAContext = cdaContext;
            #endregion


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

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

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

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

            if (!mandatorySectionsOnly)
            {
                // Context>Encounter>HEALTHCARE FACILITY
                pharmacySharedMedsList.SCSContext.Encounter = new Encounter
                {
                    HealthcareFacility = PopulateHealthcareFacility(mandatorySectionsOnly)
                };
            }

            pharmacySharedMedsList.SCSContext.SubjectOfCare = BaseCDAModel.CreateSubjectOfCare();
            GenericObjectReuseSample.HydrateSubjectofCare(pharmacySharedMedsList.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 > Identifier
            person.Participant.Person.Identifiers = new List <Identifier>
            {
                BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPII, "8003615833334118")
            };


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

            var address1 = BaseCDAModel.CreateAddress();

            // MUST BE BUSINESS
            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.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;

            // New requirement to make address mandatory
            person.Participant.Person.Organisation.Addresses = new List <IAddress> {
                address1
            };

            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
                };

                // Optional Participants
                pharmacySharedMedsList.SCSContext.Participant = new List <IParticipationPersonOrOrganisation>();
                pharmacySharedMedsList.SCSContext.Participant.Add(person);
            }

            #endregion

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

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

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


            pharmacySharedMedsList.SCSContent.EncapsulatedData.ExternalData = report1;
            #endregion

            return(pharmacySharedMedsList);
        }
예제 #13
0
        /// <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> {
                "Dr"
            };

            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);
        }