/// <summary>
        /// Creates and hydrates the diagnostic investigations section.
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A hydrated 'DiagnosticInvestigations' object.</returns>
        private static IDiagnosticInvestigations CreateDiagnosticInvestigations(Boolean mandatorySectionsOnly)
        {
            IDiagnosticInvestigations diagnosticInvestigations = BaseCDAModel.CreateDiagnosticInvestigations();

            diagnosticInvestigations.ImagingExaminationResult = new List <IImagingExaminationResult>
            {
                GenericObjectReuseSample.CreateImagingResults("Leg Image"),
                GenericObjectReuseSample.CreateImagingResults("Head Image")
            };

            // Pathology test results
            diagnosticInvestigations.PathologyTestResult = new List <PathologyTestResult>
            {
                GenericObjectReuseSample.CreatePathologyResults(PitNameAndPath),
                GenericObjectReuseSample.CreatePathologyResults(mandatorySectionsOnly)
            };

            // Other Test Result
            diagnosticInvestigations.OtherTestResult = new List <OtherTestResult>
            {
                GenericObjectReuseSample.CreateOtherTestResultAttachment(),
                    GenericObjectReuseSample.CreateOtherTestResultText()
            };

            // Requested Service
            diagnosticInvestigations.RequestedService = CreateRequestedService(mandatorySectionsOnly);

            return(diagnosticInvestigations);
        }
Exemplo n.º 2
0
        /// <summary>
        /// This method populates an consumerEnteredNotes model with either the mandatory sections only, or both
        /// the mandatory and optional sections
        /// </summary>
        /// <param name="mandatorySectionsOnly">mandatorySectionsOnly</param>
        /// <returns>ConsumerEnteredNotes</returns>
        public static ConsumerEnteredNotes PopulateConsumerEnteredNotes(Boolean mandatorySectionsOnly)
        {
            var consumerEnteredNotes = ConsumerEnteredNotes.CreateConsumerEnteredNotes();

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

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

            #region Setup and populate the CDA context model

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

            consumerEnteredNotes.CDAContext = cdaContext;
            #endregion

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

            consumerEnteredNotes.SCSContext = ConsumerEnteredNotes.CreateSCSContext();

            consumerEnteredNotes.SCSContext.Author = ConsumerEnteredNotes.CreateAuthor();
            PopulateAuthor(consumerEnteredNotes.SCSContext.Author, mandatorySectionsOnly);

            consumerEnteredNotes.SCSContext.SubjectOfCare = PopulateSubjectofCare(mandatorySectionsOnly);

            #endregion

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

            consumerEnteredNotes.SCSContent.Title       = "My Health Summary";
            consumerEnteredNotes.SCSContent.Description = "I have been really healthy all my life.";

            #endregion

            return(consumerEnteredNotes);
        }
        /// <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);
        }
Exemplo n.º 4
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);
        }
        /// <summary>
        /// This method populates an PCEHRPrescriptionRecord model with either the mandatory sections only, or both
        /// the mandatory and optional sections
        /// </summary>
        /// <param name="mandatorySectionsOnly">mandatorySectionsOnly</param>
        /// <returns>PCEHRPrescriptionRecord</returns>
        internal static PCEHRPrescriptionRecord PopulatePrescriptionRecord(Boolean mandatorySectionsOnly)
        {
            var prescriptionRecord = PCEHRPrescriptionRecord.CreatePrescriptionRecord();

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

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

            #region Setup and populate the CDA context model

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

            if (mandatorySectionsOnly)
            {
                // Hide Administrative Observations
                prescriptionRecord.ShowAdministrativeObservationsNarrativeAndTitle = false;

                // Set Parent Document
                cdaContext.ParentDocuments = new List <ParentDocument>
                {
                    CreateParentDocument(ReleatedDocumentType.Transform, null, BaseCDAModel.CreateGuid(), null, null, mandatorySectionsOnly)
                };
            }
            else
            {
                // Set Parent Document
                cdaContext.ParentDocuments = new List <ParentDocument>
                {
                    CreateParentDocument(ReleatedDocumentType.Transform, null, BaseCDAModel.CreateGuid(), null, "1", mandatorySectionsOnly),
                    CreateParentDocument(ReleatedDocumentType.Replace, cdaContext.SetId, BaseCDAModel.CreateGuid(), CDADocumentType.PrescriptionRecord, "1", mandatorySectionsOnly),
                };
            }

            var prescriberOrganisationId = new Guid(BaseCDAModel.CreateGuid());
            var prescriberId             = new Guid(BaseCDAModel.CreateGuid());

            // Custodian
            cdaContext.Custodian = CreateCustodian(mandatorySectionsOnly, prescriberOrganisationId);

            cdaContext.LegalAuthenticator = CreateLegalAuthenticator(mandatorySectionsOnly, prescriberId);

            prescriptionRecord.CDAContext = cdaContext;

            #endregion

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

            prescriptionRecord.SCSContext = PCEHRPrescriptionRecord.CreateSCSContext();

            prescriptionRecord.SCSContext.Prescriber             = CreatePrescriber(mandatorySectionsOnly, prescriberId);
            prescriptionRecord.SCSContext.PrescriberOrganisation = CreatePrescriberOrganisation(mandatorySectionsOnly, prescriberOrganisationId);

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

            #endregion

            #region Setup and populate the SCS Content model
            // Setup and populate the SCS Content model

            // Create SCS Content
            prescriptionRecord.SCSContent = PCEHRPrescriptionRecord.CreateSCSContent();

            // Prescription Item
            prescriptionRecord.SCSContent.PrescriptionItem = CreatePrescriptionItem(mandatorySectionsOnly, BaseCDAModel.CreateGuid());

            #endregion

            return(prescriptionRecord);
        }
Exemplo n.º 6
0
        /// <summary>
        /// This method populates a shared health summary model with either the mandatory sections only, or both
        /// the mandatory and optional sections
        /// </summary>
        /// <param name="mandatorySectionsOnly">mandatorySectionsOnly</param>
        /// <returns>SharedHealthSummary</returns>
        internal static SharedHealthSummary PopulateSharedHealthSummary(Boolean mandatorySectionsOnly)
        {
            var sharedHealthSummary = SharedHealthSummary.CreateSharedHealthSummary(DocumentStatus.Final);

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

            // Set Creation Time
            sharedHealthSummary.DocumentCreationTime = new ISO8601DateTime(DateTime.Now, ISO8601DateTime.Precision.Second);

            #region Setup and populate the CDA context model

            // Setup and populate the CDA context model
            var cdaContext = SharedHealthSummary.CreateCDAContext();

            // Document Id
            cdaContext.DocumentId = BaseCDAModel.CreateIdentifier(BaseCDAModel.CreateOid());

            // CDA Context Version
            if (!mandatorySectionsOnly)
            {
                // Version
                cdaContext.Version = "1";

                // Set Id
                cdaContext.SetId = BaseCDAModel.CreateIdentifier(BaseCDAModel.CreateGuid());
            }

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

            sharedHealthSummary.ShowAdministrativeObservationsSection = !mandatorySectionsOnly;

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

            sharedHealthSummary.CDAContext = cdaContext;

            #endregion

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

            sharedHealthSummary.SCSContext = SharedHealthSummary.CreateSCSContext();

            sharedHealthSummary.SCSContext.Author = BaseCDAModel.CreateAuthor();
            GenericObjectReuseSample.HydrateAuthorV2(sharedHealthSummary.SCSContext.Author, mandatorySectionsOnly);

            // Subject of Care
            sharedHealthSummary.SCSContext.SubjectOfCare = BaseCDAModel.CreateSubjectOfCare();
            GenericObjectReuseSample.HydrateSubjectofCare(sharedHealthSummary.SCSContext.SubjectOfCare, mandatorySectionsOnly, true);

            #endregion

            #region Setup and populate the SCS Content model
            // Setup and populate the SCS Content model

            sharedHealthSummary.SCSContent = SharedHealthSummary.CreateSCSContent();

            // Adverse reactions
            sharedHealthSummary.SCSContent.AdverseReactions = CreateAdverseReactions(mandatorySectionsOnly);

            // Reviewed medications
            sharedHealthSummary.SCSContent.Medications = CreateMedications(mandatorySectionsOnly);

            // Reviewed medical history
            sharedHealthSummary.SCSContent.MedicalHistory = CreateMedicalHistory(mandatorySectionsOnly);

            // Reviewed Immunizations
            sharedHealthSummary.SCSContent.Immunisations = CreateImmunisations(mandatorySectionsOnly);

            #endregion

            return(sharedHealthSummary);
        }
Exemplo n.º 7
0
        /// <summary>
        /// This method populates an PCEHRDispenseRecord model with either the mandatory sections only, or both
        /// the mandatory and optional sections
        /// </summary>
        /// <param name="mandatorySectionsOnly">mandatorySectionsOnly</param>
        /// <returns>PCEHRDispenseRecord</returns>
        internal static PCEHRDispenseRecord PopulateDispenseRecord(Boolean mandatorySectionsOnly)
        {
            var dispenseRecord = PCEHRDispenseRecord.CreateDispenseRecord();

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

            // Include Logo
            dispenseRecord.IncludeLogo = true;

            #region Setup and populate the CDA context model

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

            if (mandatorySectionsOnly)
            {
                // Set Parent Document
                cdaContext.ParentDocuments = new List <ParentDocument>
                {
                    CreateParentDocument(ReleatedDocumentType.Transform, null, BaseCDAModel.CreateGuid(), null, null, mandatorySectionsOnly)
                };
            }
            else
            {
                // Set Parent Document
                cdaContext.ParentDocuments = new List <ParentDocument>
                {
                    CreateParentDocument(ReleatedDocumentType.Transform, null, BaseCDAModel.CreateGuid(), null, "1", mandatorySectionsOnly),
                    CreateParentDocument(ReleatedDocumentType.Replace, cdaContext.SetId, BaseCDAModel.CreateGuid(), CDADocumentType.DispenseRecord, "1", mandatorySectionsOnly),
                };
            }

            var dispenserOrganisationId = new Guid(BaseCDAModel.CreateGuid());
            var dispenserId             = new Guid(BaseCDAModel.CreateGuid());

            // Custodian
            cdaContext.Custodian = CreateCustodian(mandatorySectionsOnly, dispenserOrganisationId);

            cdaContext.LegalAuthenticator = CreateLegalAuthenticator(mandatorySectionsOnly, dispenserId);

            dispenseRecord.CDAContext = cdaContext;

            #endregion

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

            dispenseRecord.SCSContext = PCEHRDispenseRecord.CreateSCSContext();

            dispenseRecord.SCSContext.Dispenser             = CreateDispenser(mandatorySectionsOnly, dispenserId);
            dispenseRecord.SCSContext.DispenserOrganisation = CreateDispenserOrganisation(mandatorySectionsOnly, dispenserOrganisationId);

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

            #endregion

            #region Setup and populate the SCS Content model
            // Setup and populate the SCS Content model

            // Create SCS Content
            dispenseRecord.SCSContent = PCEHRDispenseRecord.CreateSCSContent();

            // Prescription Item
            dispenseRecord.SCSContent.DispenseItem = CreateDispenseItem(mandatorySectionsOnly, BaseCDAModel.CreateGuid());

            #endregion

            return(dispenseRecord);
        }
        /// <summary>
        /// This method populates an acdCustodianRecord model with either the mandatory sections only, or both
        /// the mandatory and optional sections
        /// </summary>
        /// <param name="mandatorySectionsOnly">mandatorySectionsOnly</param>
        /// <returns>AcdCustodianRecord</returns>
        public static AcdCustodianRecord PopulateAcdCustodianRecord(Boolean mandatorySectionsOnly)
        {
            var acdCustodianRecord = AcdCustodianRecord.CreateAcdCustodianRecord();

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

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

            #region Setup and populate the CDA context model

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

            acdCustodianRecord.CDAContext = cdaContext;
            #endregion

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

            acdCustodianRecord.SCSContext = AcdCustodianRecord.CreateSCSContext();

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

            // If only mandatory sections are required, then remove person employment
            if (mandatorySectionsOnly)
            {
                acdCustodianRecord.SCSContext.Author.Participant.Person.Organisation = null;
            }

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

            #endregion

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

            // ACD Custodian Record
            acdCustodianRecord.SCSContent.AcdCustodians = CreateAcdCustodians(mandatorySectionsOnly);

            #endregion

            return(acdCustodianRecord);
        }
        static void Main(string[] args)
        {
            string folderPath = null;

            if (args != null && args.Length > 0)
            {
                folderPath = args[0];
            }
            else
            {
                folderPath = ConfigurationManager.AppSettings["OutputFolder"];
            }

            if (folderPath.IsNullOrEmptyWhitespace())
            {
                folderPath = ".";
            }

            SpecialistLetterSample.OutputFolderPath    = folderPath;
            SharedHealthSummarySample.OutputFolderPath = folderPath;
            EventSummarySample.OutputFolderPath        = folderPath;
            EDischargeSummarySample.OutputFolderPath   = folderPath;
            EReferralSample.OutputFolderPath           = folderPath;
            ServiceReferralSample.OutputFolderPath     = folderPath;

            PrepareOutputFolder(folderPath);

            var eReferralSampleCode = new EReferralSample();
            var minEReferralCda     = eReferralSampleCode.MinPopulatedEReferralSample("EReferral_3A_Min.xml");
            var maxEReferralCda     = eReferralSampleCode.MaxPopulatedEReferralSample("EReferral_3A_Max.xml");
            var eReferralCda1A      = eReferralSampleCode.PopulateEReferralSample_1A("EReferral_1A.xml");
            var eReferralCda1B      = eReferralSampleCode.PopulateEReferralSample_1B("EReferral_1B.xml");
            var eReferralCda1N      = eReferralSampleCode.PopulateEReferralSample_1B_NarrativeExample("EReferral_1B_NB.xml");

            LevelsGenerator.Generate2("EReferral_3A_Max.xml", "EReferral_2.xml");

            var sharedHealthSummarySampleCode = new SharedHealthSummarySample();
            var minSharedHealthSummaryCda     = sharedHealthSummarySampleCode.MinPopulatedSharedHealthSummarySample("SharedHealthSummary_3A_Min.xml");
            var maxSharedHealthSummaryCda     = sharedHealthSummarySampleCode.MaxPopulatedSharedHealthSummarySample("SharedHealthSummary_3A_Max.xml");
            var sharedHealthSummaryCda_1A     = sharedHealthSummarySampleCode.PopulateSharedHealthSummarySample_1A("SharedHealthSummary_1A.xml");

            LevelsGenerator.Generate2("SharedHealthSummary_3A_Max.xml", "SharedHealthSummary_2.xml");

            var specialistLetterSampleCode = new SpecialistLetterSample();
            var minSpecialistLetterCda     = specialistLetterSampleCode.MinPopulatedSpecialistLetterSample("SpecialistLetter_3A_Min.xml");
            var maxSpecialistLetterCda     = specialistLetterSampleCode.MaxPopulatedSpecialistLetterSample("SpecialistLetter_3A_Max.xml");
            var specialistLetterCda1A      = specialistLetterSampleCode.PopulateSpecialistLetterSample_1A("SpecialistLetter_1A.xml");
            var specialistLetterCda1B      = specialistLetterSampleCode.PopulateSpecialistLetterSample_1B("SpecialistLetter_1B.xml");

            LevelsGenerator.Generate2("SpecialistLetter_3A_Max.xml", "SpecialistLetter_2.xml");

            var dischargeSummarySampleCode = new EDischargeSummarySample();
            var minDischargeSummaryCda     = dischargeSummarySampleCode.MinPopulatedEDischargeSummary("DischargeSummary_3A_Min.xml");
            var maxDischargeSummaryCda     = dischargeSummarySampleCode.MaxPopulatedEDischargeSummary("DischargeSummary_3A_Max.xml");
            var dischargeSummaryCda1A      = dischargeSummarySampleCode.PopulateEDischargeSummarySample_1A("DischargeSummary_1A.xml");
            var dischargeSummaryCda1B      = dischargeSummarySampleCode.PopulateEDischargeSummarySample_1B("DischargeSummary_1B.xml");

            LevelsGenerator.Generate2("DischargeSummary_3A_Max.xml", "DischargeSummary_2.xml");

            var eEventSummarySampleCode = new EventSummarySample();
            var minEventSummaryCda      = eEventSummarySampleCode.MinPopulatedEventSummary("EventSummary_3A_Min.xml");
            var maxEventSummaryCda      = eEventSummarySampleCode.MaxPopulatedEventSummary("EventSummary_3A_Max.xml");
            var eventSummaryCda1A       = eEventSummarySampleCode.PopulateEventSummarySample_1A("EventSummary_1A.xml");

            LevelsGenerator.Generate2("EventSummary_3A_Max.xml", "EventSummary_2.xml");

            var serviceReferralSampleCode = new ServiceReferralSample();
            var minServiceReferralCda     = serviceReferralSampleCode.MinPopulatedServiceReferralSample("ServiceReferral_3A_Min.xml");
            var maxServiceReferralCda     = serviceReferralSampleCode.MaxPopulatedServiceReferralSample("ServiceReferral_3A_Max.xml");
            var serviceReferralCda1A      = serviceReferralSampleCode.PopulateServiceReferralSample_1A("ServiceReferral_1A.xml");
            var serviceReferralCda1B      = serviceReferralSampleCode.PopulateServiceReferralSample_1B("ServiceReferral_1B.xml");

            LevelsGenerator.Generate2("ServiceReferral_3A_Max.xml", "ServiceReferral_2.xml");

            var genericObjectReuseSampleCode = new GenericObjectReuseSample();
            var sampleSubjectOfCare          = genericObjectReuseSampleCode.PopulateSubjectOfCare();
            var sampleAutrhor       = genericObjectReuseSampleCode.PopulateAuthor();
            var sampleCustodian     = genericObjectReuseSampleCode.PopulateCustodian();
            var sampleAuthenticator = genericObjectReuseSampleCode.PopulateAuthenticator();
            var sampleRecipient     = genericObjectReuseSampleCode.PopulateRecipient();
        }
Exemplo n.º 10
0
        /// <summary>
        /// This sample populates both the mandatory and optional Sections / Entries depending on the
        /// mandatorySectionsOnly Boolean
        /// </summary>
        internal static EventSummary PopulatedEventSummary(Boolean mandatorySectionsOnly)
        {
            var eventSummary = EventSummary.CreateEventSummary();

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

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

            #region Setup and populate the CDA context model

            // Setup and populate the CDA context model
            var cdaContext = EventSummary.CreateCDAContext();

            // Document Id
            cdaContext.DocumentId = BaseCDAModel.CreateIdentifier(BaseCDAModel.CreateOid());

            // Set Id
            if (!mandatorySectionsOnly)
            {
                cdaContext.SetId = BaseCDAModel.CreateIdentifier(BaseCDAModel.CreateGuid());
            }

            // CDA Context Version
            if (!mandatorySectionsOnly)
            {
                cdaContext.Version = "1";
            }

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

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

            eventSummary.CDAContext = cdaContext;

            #endregion

            #region Setup and Populate the SCS Context model

            // Setup and Populate the SCS Context model
            eventSummary.SCSContext = EventSummary.CreateSCSContext();

            eventSummary.SCSContext.Author = BaseCDAModel.CreateAuthor();
            GenericObjectReuseSample.HydrateAuthorV2(eventSummary.SCSContext.Author, mandatorySectionsOnly);

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

            // DateTime Health Event Started & DateTime Health Event Ended allowable combinations
            var dateTimeHealthEventEnded   = new ISO8601DateTime(DateTime.Now);
            var dateTimeHealthEventStarted = new ISO8601DateTime(DateTime.Now.AddMonths(-12));

            eventSummary.SCSContext.EncounterPeriod = !mandatorySectionsOnly?
                                                      BaseCDAModel.CreateLowHigh(dateTimeHealthEventStarted, dateTimeHealthEventEnded) :
                                                          BaseCDAModel.CreateHigh(dateTimeHealthEventEnded);

            #endregion

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

            if (!mandatorySectionsOnly)
            {
                eventSummary.SCSContent.EventDetails = CreateEventDetails();

                // Adverse reactions
                eventSummary.SCSContent.AdverseReactions = CreateAdverseReactions();

                // Medications
                eventSummary.SCSContent.Medications = CreateMedications();

                // Medical history
                eventSummary.SCSContent.DiagnosesIntervention = CreateDiagnosesIntervention(mandatorySectionsOnly);

                // Immunisations
                eventSummary.SCSContent.Immunisations = CreateImmunisations();

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

            #endregion

            return(eventSummary);
        }