示例#1
0
        private static List <IMedication> CreateMedications(bool mandatoryOnly)
        {
            if (mandatoryOnly)
            {
                return(null);
            }
            else
            {
                var medication1 = ConsumerEnteredHealthSummary.CreateMedication();
                medication1.Id                 = Guid.NewGuid().ToString();
                medication1.Directions         = BaseCDAModel.CreateStructuredText("Directions");
                medication1.ClinicalIndication = "clinicalIndication";
                medication1.Comment            = "Comment";
                medication1.Medicine           = BaseCDAModel.CreateCodableText("Medicine");

                var medication2 = ConsumerEnteredHealthSummary.CreateMedication();
                medication2.Id                 = Guid.NewGuid().ToString();
                medication2.Directions         = BaseCDAModel.CreateStructuredText("Directions");
                medication2.ClinicalIndication = "clinicalIndication";
                medication2.Comment            = "Comment";
                medication2.Medicine           = BaseCDAModel.CreateCodableText("Medicine");

                var list = new List <IMedication>
                {
                    medication1,
                    medication2
                };

                return(list);
            }
        }
示例#2
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;
        }
示例#3
0
        /// <summary>
        /// This method populates an consumerEnteredHealthSummary model with either the mandatory sections only, or both
        /// the mandatory and optional sections
        /// </summary>
        /// <param name="mandatorySectionsOnly">mandatorySectionsOnly</param>
        /// <returns>ConsumerEnteredHealthSummary</returns>
        public static ConsumerEnteredHealthSummary PopulateConsumerEnteredHealthSummary(Boolean mandatorySectionsOnly)
        {
            var consumerEnteredHealthSummary = ConsumerEnteredHealthSummary.CreateConsumerEnteredHealthSummary();

            // Include Logo
            consumerEnteredHealthSummary.IncludeLogo = true;

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

            #region Setup and populate the CDA context model

            // Setup and populate the CDA context model
            var cdaContext = ConsumerEnteredHealthSummary.CreateCDAContext();
            // Document Id
            cdaContext.DocumentId = BaseCDAModel.CreateIdentifier(BaseCDAModel.CreateOid(), null);
            // Set Id
            cdaContext.SetId = BaseCDAModel.CreateIdentifier(BaseCDAModel.CreateGuid(), null);
            // CDA Context Version
            cdaContext.Version = "1";

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

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

            consumerEnteredHealthSummary.CDAContext = cdaContext;
            #endregion

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

            consumerEnteredHealthSummary.SCSContext = ConsumerEnteredHealthSummary.CreateSCSContext();

            consumerEnteredHealthSummary.SCSContext.Author = ConsumerEnteredHealthSummary.CreateAuthor();
            PopulateAuthor(consumerEnteredHealthSummary.SCSContext.Author, mandatorySectionsOnly);

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

            #endregion

            #region Setup and populate the SCS Content model
            // Setup and populate the SCS Content model
            consumerEnteredHealthSummary.SCSContent = ConsumerEnteredHealthSummary.CreateSCSContent();

            // Allergies And Adverse Reactions
            consumerEnteredHealthSummary.SCSContent.AllergiesAndAdverseReactions = CreateAllergiesAndAdverseReactions(mandatorySectionsOnly);

            // Medications
            consumerEnteredHealthSummary.SCSContent.Medications = CreateMedications(mandatorySectionsOnly);

            #endregion

            return(consumerEnteredHealthSummary);
        }