/// <summary>
        /// Creates and Hydrates an Recipient demonstrating its usage with multiple CDA Libraries
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated Recipient</returns>
        public IParticipationInformationRecipient PopulateRecipient()
        {
            var genericRecipient = BaseCDAModel.CreateInformationRecipient();

            HydrateRecipient(genericRecipient, RecipientType.Primary, false);

            //The requirement to instantiate the objects with the factory ensures that the correct implementations
            //of each interface are instantiated; e.g. that the correct content and context are created.
            var specialistLetter = new SpecialistLetter(DocumentStatus.Interim)
            {
                CDAContext = SpecialistLetter.CreateCDAContext()
            };

            specialistLetter.CDAContext.InformationRecipients = new List <IParticipationInformationRecipient>
            {
                genericRecipient
            };

            //The requirement to instantiate the objects with the factory ensures that the correct implementations
            //of each interface are instantiated; e.g. that the correct content and context are created.
            var dischargeSummary = new EDischargeSummary(DocumentStatus.Interim)
            {
                CDAContext = EDischargeSummary.CreateCDAContext()
            };

            dischargeSummary.CDAContext.InformationRecipients = new List <IParticipationInformationRecipient>
            {
                genericRecipient
            };

            return(genericRecipient);
        }
        /// <summary>
        /// This method populates a specialistLetter
        /// </summary>
        /// <param name="mandatorySectionsOnly">mandatorySectionsOnly</param>
        /// <returns>SpecialistLetter</returns>
        internal static SpecialistLetter PopulateSpecialistLetter(Boolean mandatorySectionsOnly)
        {
            var specialistLetter = SpecialistLetter.CreateSpecialistLetter();

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

            // Include Logo
            specialistLetter.IncludeLogo = true;

            #region Setup and populate the CDA context model

            // Setup and populate the CDA context model
            var cdaContext = SpecialistLetter.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);
            }

            // Create information recipient
            if (!mandatorySectionsOnly)
            {
                var recipient1 = BaseCDAModel.CreateInformationRecipient();
                var recipient2 = BaseCDAModel.CreateInformationRecipient();
                GenericObjectReuseSample.HydrateRecipient(recipient1, RecipientType.Primary, mandatorySectionsOnly);
                GenericObjectReuseSample.HydrateRecipient(recipient2, RecipientType.Secondary, mandatorySectionsOnly);
                cdaContext.InformationRecipients = new List <IParticipationInformationRecipient> {
                    recipient1, recipient2
                };
            }

            specialistLetter.CDAContext = cdaContext;

            #endregion

            #region Setup and Populate the SCS Context model

            specialistLetter.SCSContext = SpecialistLetter.CreateSCSContext();

            specialistLetter.SCSContext.Author = BaseCDAModel.CreateAuthor();
            GenericObjectReuseSample.HydrateAuthor(specialistLetter.SCSContext.Author, mandatorySectionsOnly);

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

            specialistLetter.SCSContext.DateTimeSubjectSeen = new ISO8601DateTime(DateTime.Now);

            if (!mandatorySectionsOnly)
            {
                specialistLetter.SCSContext.Referrer = CreateReferrer(mandatorySectionsOnly);
                specialistLetter.SCSContext.UsualGP  = CreateUsualGPPerson(mandatorySectionsOnly);
            }
            #endregion

            #region Setup and populate the SCS Content model

            specialistLetter.SCSContent = SpecialistLetter.CreateSCSContent();

            // Response details
            specialistLetter.SCSContent.ResponseDetails = CreateResponseDetails(mandatorySectionsOnly);

            // Recommendations
            specialistLetter.SCSContent.Recommendations = CreateRecommendations(mandatorySectionsOnly);

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

            if (!mandatorySectionsOnly)
            {
                // Adverse reactions
                specialistLetter.SCSContent.AdverseReactions = CreateAdverseReactions();

                // Diagnostic Investigations
                specialistLetter.SCSContent.DiagnosticInvestigations = CreateDiagnosticInvestigations(mandatorySectionsOnly);
            }

            #endregion

            return(specialistLetter);
        }
コード例 #3
0
        // ***** 1B documents - NOT REQUIRED ******



        /// <summary>
        /// This sample populates both the mandatory and optional Sections / Entries; as a result this sample
        /// includes all of the sections within the body and each section includes at least one example for
        /// each of its optional entries.
        /// </summary>
        //public XmlDocument MinPopulatedPCMLAuthorHealthcareProviderSample_1B(string fileName)
        //{
        //    XmlDocument xmlDoc = null;

        //    var PCML = PopulatePCML_1B(true);

        //    try
        //    {
        //        CDAGenerator.NarrativeGenerator = new CDANarrativeGenerator();

        //        //Pass the Child Parent Questionnaire model into the GeneratePCML method
        //        xmlDoc = CDAGenerator.GeneratePCML(PCML);

        //        using (var writer = XmlWriter.Create(OutputFolderPath + @"\" + fileName, new XmlWriterSettings { Indent = true }))
        //        {
        //            if (!fileName.IsNullOrEmptyWhitespace()) xmlDoc.Save(writer);
        //        }
        //    }
        //    catch (ValidationException ex)
        //    {
        //        //Catch any validation exceptions
        //        var validationMessages = ex.GetMessagesString();

        //        //Handle any validation errors as appropriate.
        //        throw;
        //    }

        //    return xmlDoc;
        //}



        //public XmlDocument MaxPopulatedPCMLAuthorHealthcareProviderSample_1B(string fileName)
        //{
        //    XmlDocument xmlDoc = null;

        //    var PCML = PopulatePCML_1B(false);

        //    try
        //    {
        //        CDAGenerator.NarrativeGenerator = new CDANarrativeGenerator();

        //        //Pass the Child Parent Questionnaire model into the GeneratePCML method
        //        xmlDoc = CDAGenerator.GeneratePCML(PCML);

        //        using (var writer = XmlWriter.Create(OutputFolderPath + @"\" + fileName, new XmlWriterSettings { Indent = true }))
        //        {
        //            if (!fileName.IsNullOrEmptyWhitespace()) xmlDoc.Save(writer);
        //        }
        //    }
        //    catch (ValidationException ex)
        //    {
        //        //Catch any validation exceptions
        //        var validationMessages = ex.GetMessagesString();

        //        //Handle any validation errors as appropriate.
        //        throw;
        //    }

        //    return xmlDoc;
        //}



        #region Populate Methods
        /// <summary>
        /// This method populates an PCML model with either the mandatory sections only, or both
        /// the mandatory and optional sections
        /// </summary>
        /// <param name="mandatorySectionsOnly">mandatorySectionsOnly</param>
        /// <returns>PCML</returns>
        public static Nehta.VendorLibrary.CDA.Common.PCML PopulatePCML_1A(Boolean mandatorySectionsOnly)
        {
            var pharmacyCuratedMedsList = Nehta.VendorLibrary.CDA.Common.PCML.CreatePCML();

            // Include Logo
            pharmacyCuratedMedsList.IncludeLogo = false;

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

            #region Setup and populate the CDA context model

            // Setup and populate the CDA context model
            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 });
            }


            pharmacyCuratedMedsList.CDAContext = cdaContext;
            #endregion


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

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

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

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

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

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


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


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

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

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

            var address1 = BaseCDAModel.CreateAddress();

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


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

            #endregion

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

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

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



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

            return(pharmacyCuratedMedsList);
        }
コード例 #4
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);
        }