예제 #1
0
        private static List <Reaction> CreateAllergiesAndAdverseReactions(bool mandatoryOnly)
        {
            if (mandatoryOnly)
            {
                return(null);
            }
            else
            {
                var reaction1 = BaseCDAModel.CreateReaction();
                reaction1.Id = Guid.NewGuid().ToString();
                reaction1.SubstanceOrAgent = BaseCDAModel.CreateCodableText("SubstanceOrAgent");
                reaction1.ReactionEvent    = BaseCDAModel.CreateReactionEvent();

                var reaction2 = BaseCDAModel.CreateReaction();
                reaction2.Id = Guid.NewGuid().ToString();
                reaction2.SubstanceOrAgent = BaseCDAModel.CreateCodableText("SubstanceOrAgent");
                reaction2.ReactionEvent    = BaseCDAModel.CreateReactionEvent();

                reaction1.ReactionEvent.Manifestations = new List <ICodableText>
                {
                    BaseCDAModel.CreateCodableText("Manifestation")
                };

                reaction2.ReactionEvent.Manifestations = new List <ICodableText>
                {
                    BaseCDAModel.CreateCodableText("Manifestation")
                };

                return(new List <Reaction>
                {
                    reaction1,
                    reaction2
                });
            }
        }
예제 #2
0
        /// <summary>
        /// Creates and Hydrates the reviewed immunisations section for the Shared Health Summary
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated Immunisations object</returns>
        private static Immunisations CreateImmunisations(Boolean mandatorySectionsOnly)
        {
            var immunisations = SharedHealthSummary.CreateReviewedImmunisations();

            if (!mandatorySectionsOnly)
            {
                var immunisation     = SharedHealthSummary.CreateImmunisation();
                var immunisationList = new List <IImmunisation>();

                immunisation.DateTime = new ISO8601DateTime(DateTime.Now);
                immunisation.Medicine = BaseCDAModel.CreateCodableText("74993011000036102", CodingSystem.AMTV3,
                                                                       "measles virus (Schwarz) live attenuated vaccine + mumps virus (Jeryl Lynn, strain RIT 4385) live attenuated vaccine + rubella virus (Wistar RA 27/3) live attenuated vaccine");
                immunisationList.Add(immunisation);

                var immunisation2 = SharedHealthSummary.CreateImmunisation();
                immunisation2.DateTime = new ISO8601DateTime(DateTime.Now);
                immunisation2.Medicine = BaseCDAModel.CreateCodableText("74993011000036102", CodingSystem.AMTV3,
                                                                        "measles virus (Schwarz) live attenuated vaccine + mumps virus (Jeryl Lynn, strain RIT 4385) live attenuated vaccine + rubella virus (Wistar RA 27/3) live attenuated vaccine");
                immunisation2.SequenceNumber = 1;
                immunisationList.Add(immunisation2);

                immunisations.AdministeredImmunisation = immunisationList;
            }
            else
            {
                immunisations.ExclusionStatement       = SharedHealthSummary.CreateStatement();
                immunisations.ExclusionStatement.Value = NCTISGlobalStatementValues.NoneSupplied;
            }


            return(immunisations);
        }
예제 #3
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);
            }
        }
예제 #4
0
        /// <summary>
        /// Creates and Hydrates the reviewed immunisations section for the Shared Health Summary
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated Immunisations object</returns>
        private static Immunisations CreateImmunisations(Boolean mandatorySectionsOnly)
        {
            var immunisations = SharedHealthSummary.CreateReviewedImmunisations();

            if (!mandatorySectionsOnly)
            {
                var immunisation     = SharedHealthSummary.CreateImmunisation();
                var immunisationList = new List <IImmunisation>();

                immunisation.DateTime = new ISO8601DateTime(DateTime.Now);
                immunisation.Medicine = BaseCDAModel.CreateCodableText("1004461000168106", CodingSystem.AMTV3, "M-M-R II powder for injection, 10 vials");
                immunisationList.Add(immunisation);

                var immunisation2 = SharedHealthSummary.CreateImmunisation();
                immunisation2.DateTime       = new ISO8601DateTime(DateTime.Now);
                immunisation2.Medicine       = BaseCDAModel.CreateCodableText("1004461000168106", CodingSystem.AMTV3, "M-M-R II powder for injection, 10 vials");
                immunisation2.SequenceNumber = 1;
                immunisationList.Add(immunisation2);

                immunisations.AdministeredImmunisation = immunisationList;
            }
            else
            {
                immunisations.ExclusionStatement       = SharedHealthSummary.CreateStatement();
                immunisations.ExclusionStatement.Value = NCTISGlobalStatementValues.NoneSupplied;
            }


            return(immunisations);
        }
예제 #5
0
        /// <summary>
        /// Creates and Hydrates the Medications section for the Event Summary
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated List of RequestedService</returns>
        private static List <RequestedService> CreateRequestedService(Boolean mandatorySectionsOnly)
        {
            var requestedServiceList = new List <RequestedService>();

            // Create Service Provider for a Person
            var requestedServicePerson = EventSummary.CreateRequestedService();

            requestedServicePerson.ServiceCommencementWindow = BaseCDAModel.CreateInterval(
                new ISO8601DateTime(DateTime.Now, ISO8601DateTime.Precision.Day),
                new ISO8601DateTime(DateTime.Now.AddMonths(6), ISO8601DateTime.Precision.Day));
            requestedServicePerson.RequestedServiceDescription         = BaseCDAModel.CreateCodableText("399208008", CodingSystem.SNOMED, "Plain chest X-ray");
            requestedServicePerson.ServiceBookingStatus                = EventTypes.AppointmentRequest;
            requestedServicePerson.SubjectOfCareInstructionDescription = "Subject Of Care Instruction Description";
            requestedServicePerson.RequestedServiceDateTime            = new ISO8601DateTime(DateTime.Now.AddDays(4), ISO8601DateTime.Precision.Day);
            requestedServicePerson.ServiceProvider = CreateServiceProviderPerson(mandatorySectionsOnly);

            // Add to list
            requestedServiceList.Add(requestedServicePerson);

            // Create Service Provider for a Organisation
            var requestedServiceOrganisation = EventSummary.CreateRequestedService();

            requestedServiceOrganisation.ServiceScheduled                    = new ISO8601DateTime(DateTime.Now, ISO8601DateTime.Precision.Day);
            requestedServiceOrganisation.RequestedServiceDescription         = BaseCDAModel.CreateCodableText("399208008", CodingSystem.SNOMED, "Plain chest X-ray");
            requestedServiceOrganisation.ServiceBookingStatus                = EventTypes.Intent;
            requestedServiceOrganisation.SubjectOfCareInstructionDescription = "Subject Of Care Instruction Description";
            requestedServiceOrganisation.RequestedServiceDateTime            = new ISO8601DateTime(DateTime.Now.AddDays(4));
            requestedServiceOrganisation.ServiceProvider = CreateServiceProviderOrganisation(mandatorySectionsOnly);

            // Add to list
            requestedServiceList.Add(requestedServiceOrganisation);

            return(requestedServiceList);
        }
예제 #6
0
        /// <summary>
        /// Creates a medication item.
        /// </summary>
        /// <param name="code">Medication code.</param>
        /// <param name="name">Medication name.</param>
        /// <param name="directionsNullFlavour">The Directions Null Flavour</param>
        /// <param name="recomendationOrChangeNullFlavour">The Recommendation Or Change Null Flavour</param>
        /// <param name="changeTypeNullFlavour">The Change Type Null Flavour</param>
        /// <returns></returns>
        private static IMedicationItem CreateMedication(string code, string name, bool showNullflavor)
        {
            IMedicationItem medication = EventSummary.CreateMedication();

            if (showNullflavor)
            {
                medication.Directions   = BaseCDAModel.CreateStructuredText(NullFlavour.Other);
                medication.ChangeStatus = BaseCDAModel.CreateCodableText(NullFlavour.Other, CodingSystem.SNOMED, "Change made"); // Could not find ChangeStatus code for the provided refset
                medication.ChangeType   = BaseCDAModel.CreateCodableText(NullFlavour.Other, CodingSystem.SNOMED, "Changed");     // Could not find ChangeType code for the provided refset
            }
            else
            {
                medication.Directions   = BaseCDAModel.CreateStructuredText("Dose:1, Frequency: 3 times daily");
                medication.ChangeStatus = BaseCDAModel.CreateCodableText(ChangeStatus.ChangeMade);
                medication.ChangeType   = BaseCDAModel.CreateCodableText(ChangeTypeSnomed.Changed);
            }

            medication.ChangeDescription  = "Change Description";
            medication.ChangeReason       = BaseCDAModel.CreateStructuredText("Change Reason");
            medication.ClinicalIndication = "Clinical Indication";
            medication.Comment            = "Comment";

            medication.Medicine = BaseCDAModel.CreateCodableText(code, CodingSystem.AMTV3, name);

            return(medication);
        }
        /// <summary>
        /// Creates and Hydrates a Response Details object
        /// </summary>
        /// <returns>(IResponseDetails) Response</returns>
        private static IResponseDetails CreateResponseDetails(Boolean mandatorySectionsOnly)
        {
            var responseDetails = SpecialistLetter.CreateResponseDetails();

            responseDetails.Diagnoses = new List <ICodableText>
            {
                BaseCDAModel.CreateCodableText("236629009", CodingSystem.SNOMED, "Chronic radiation cystitis"),
                BaseCDAModel.CreateCodableText("33134003", CodingSystem.SNOMED, "Abscess of forehead")
            };

            if (!mandatorySectionsOnly)
            {
                var procedure1 = SpecialistLetter.CreateProcedure();
                procedure1.ProcedureName = BaseCDAModel.CreateCodableText("268400002", CodingSystem.SNOMED, "12 lead ECG");

                var procedure2 = SpecialistLetter.CreateProcedure();
                procedure2.ProcedureName = BaseCDAModel.CreateCodableText("120214004", CodingSystem.SNOMED, "Anaesthesia for procedure on perineum");

                responseDetails.Procedures = new List <IProcedureName> {
                    procedure1, procedure2
                };

                responseDetails.OtherDiagnosisEntries = new List <string>
                {
                    "Text description of first Diagnosis Procedure Entry",
                    "Text description of second Diagnosis Procedure Entry"
                };
            }

            responseDetails.ResponseNarrative = "Response narrative";

            return(responseDetails);
        }
        /// <summary>
        /// Creates and Hydrates the Medications section for the E-Referral.
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated Medications object</returns>
        private static IMedicationsSpecialistLetter CreateMedications(Boolean mandatorySectionsOnly)
        {
            var medications = SpecialistLetter.CreateMedications();

            if (!mandatorySectionsOnly)
            {
                var medicationList = new List <IMedicationItem>();

                var medication1 = SpecialistLetter.CreateMedication();
                medication1.Directions = BaseCDAModel.CreateStructuredText("Dose:1, Frequency: 3 times daily");

                // NOTE: ChangeStatus replaces RecommendationOrChange
                medication1.ChangeStatus       = BaseCDAModel.CreateCodableText(RecomendationOrChange.ARecommendationToMakeTheChange);
                medication1.ChangeType         = BaseCDAModel.CreateCodableText(ChangeTypeNctis.Changed);
                medication1.ChangeReason       = BaseCDAModel.CreateStructuredText("Change reason");
                medication1.ClinicalIndication = "Clinical indication";
                medication1.Comment            = "Some comment";
                medication1.ChangeDescription  = "Recommendation: Change description";

                medication1.Medicine = BaseCDAModel.CreateCodableText
                                       (
                    "23641011000036102",
                    CodingSystem.AMTV2,
                    "paracetamol 500 mg + codeine phosphate 30 mg tablet",
                    null,
                    null
                                       );
                medicationList.Add(medication1);

                var medication2 = SpecialistLetter.CreateMedication();
                medication2.Directions         = BaseCDAModel.CreateStructuredText("Dose:1, Frequency: 3 times daily");
                medication2.ChangeStatus       = BaseCDAModel.CreateCodableText(NullFlavour.NotApplicable);
                medication2.ChangeType         = BaseCDAModel.CreateCodableText(NullFlavour.NoInformation);
                medication2.ChangeReason       = BaseCDAModel.CreateStructuredText("Change reason");
                medication2.ClinicalIndication = "Clinical indication";
                medication2.Comment            = "Some comment";
                medication2.ChangeDescription  = "Change description";

                medication2.Medicine = BaseCDAModel.CreateCodableText
                                       (
                    "22589011000036109",
                    CodingSystem.AMTV2,
                    "paracetamol 240 mg/5 mL oral liquid",
                    null,
                    null
                                       );
                medicationList.Add(medication2);

                medications.MedicationsList = medicationList;
            }
            else
            {
                medications.ExclusionStatement       = SpecialistLetter.CreateExclusionStatement();
                medications.ExclusionStatement.Value = NCTISGlobalStatementValues.NoneSupplied;
            }

            return(medications);
        }
예제 #9
0
        /// <summary>
        /// Creates and Hydrates the reviewed medications section for the Shared Health Summary
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated ReviewedMedications object</returns>
        private static IMedications CreateMedications(Boolean mandatorySectionsOnly)
        {
            var medicationList = new List <IMedication>();

            var medications = SharedHealthSummary.CreateMedications();

            if (!mandatorySectionsOnly)
            {
                var medication = SharedHealthSummary.CreateMedication();
                medication.ClinicalIndication = "Diuretic induced hypokalemia";
                medication.Comment            = "Taken with food";
                medication.Directions         = BaseCDAModel.CreateStructuredText("2 tablets once daily oral");
                medication.Medicine           = BaseCDAModel.CreateCodableText("5884011000036107", CodingSystem.AMTV3, "	Span K 600 mg (potassium 8 mmol) modified release tablet");
                medicationList.Add(medication);

                var medication1 = SharedHealthSummary.CreateMedication();
                medication1.ClinicalIndication = "Arthritis pain management";
                medication1.Comment            = "Swallow whole";
                medication1.Directions         = BaseCDAModel.CreateStructuredText("2 tablets three times per day");
                medication1.Medicine           = BaseCDAModel.CreateCodableText("5848011000036106", CodingSystem.AMTV3, "	Panadol Osteo 665 mg modified release tablet");
                medicationList.Add(medication1);

                var medication2 = SharedHealthSummary.CreateMedication();
                medication2.ClinicalIndication = "Fluid retention";
                medication2.Comment            = "Take in the morning";
                medication2.Directions         = BaseCDAModel.CreateStructuredText("1 tablet once daily oral");
                medication2.Medicine           = BaseCDAModel.CreateCodableText("40288011000036101", CodingSystem.AMTV3, "Lasix 40 mg/4 mL injection, 4 mL ampoule");
                medicationList.Add(medication2);

                var medication3 = SharedHealthSummary.CreateMedication();
                medication3.ClinicalIndication = "COPD";
                medication3.Directions         = BaseCDAModel.CreateStructuredText("1 inhalation per day");
                medication3.Medicine           = BaseCDAModel.CreateCodableText("7113011000036100", CodingSystem.AMTV3, "	Spiriva 18 microgram powder for inhalation, 1 capsule");
                medicationList.Add(medication3);

                var medication4 = SharedHealthSummary.CreateMedication();
                medication4.ClinicalIndication = "Depression";
                medication4.Directions         = BaseCDAModel.CreateStructuredText("Dose:1, Frequency: 3 times daily");
                medication4.Medicine           = BaseCDAModel.CreateCodableText("32481000036107", CodingSystem.AMTV3, "	Exatrust 25 mg film-coated tablet");
                medicationList.Add(medication4);

                var medication5 = SharedHealthSummary.CreateMedication();
                medication5.ClinicalIndication = "Depression";
                medication5.Directions         = BaseCDAModel.CreateStructuredText("Dose:1, Frequency: as required");
                medication5.Medicine           = BaseCDAModel.CreateCodableText("32481000036107", CodingSystem.AMTV3, "	Exatrust 25 mg film-coated tablet");
                medicationList.Add(medication5);
                medications.Medications = medicationList;
            }
            else
            {
                medications.ExclusionStatement       = SharedHealthSummary.CreateStatement();
                medications.ExclusionStatement.Value = NCTISGlobalStatementValues.NoneSupplied;
            }

            return(medications);
        }
예제 #10
0
        /// <summary>
        /// Creates and Hydrates the reviewed medications section for the Shared Health Summary
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated ReviewedMedications object</returns>
        private static IMedications CreateMedications(Boolean mandatorySectionsOnly)
        {
            var medicationList = new List <IMedication>();

            var medications = SharedHealthSummary.CreateMedications();

            if (!mandatorySectionsOnly)
            {
                var medication = SharedHealthSummary.CreateMedication();
                medication.ClinicalIndication = "Diuretic induced hypokalemia";
                medication.Comment            = "Taken with food";
                medication.Directions         = BaseCDAModel.CreateStructuredText("2 tablets once daily oral");
                medication.Medicine           = BaseCDAModel.CreateCodableText("5884011000036107", CodingSystem.AMTV2, "Span K (potassium chloride 600 mg (8 mmol potassium)) tablet: modified release, 1 tablet");
                medicationList.Add(medication);

                var medication1 = SharedHealthSummary.CreateMedication();
                medication1.ClinicalIndication = "Arthritis pain management";
                medication1.Comment            = "Swallow whole";
                medication1.Directions         = BaseCDAModel.CreateStructuredText("2 tablets three times per day");
                medication1.Medicine           = BaseCDAModel.CreateCodableText("5848011000036106", CodingSystem.AMTV2, "Panadol Osteo (paracetamol 665 mg) tablet: modified release, 1 tablet");
                medicationList.Add(medication1);

                var medication2 = SharedHealthSummary.CreateMedication();
                medication2.ClinicalIndication = "Fluid retention";
                medication2.Comment            = "Take in the morning";
                medication2.Directions         = BaseCDAModel.CreateStructuredText("1 tablet once daily oral");
                medication2.Medicine           = BaseCDAModel.CreateCodableText("40288011000036101", CodingSystem.AMTV2, "Lasix (frusemide 40 mg/4 mL) injection: solution, ampoule");
                medicationList.Add(medication2);

                var medication3 = SharedHealthSummary.CreateMedication();
                medication3.ClinicalIndication = "COPD";
                medication3.Directions         = BaseCDAModel.CreateStructuredText("1 inhalation per day");
                medication3.Medicine           = BaseCDAModel.CreateCodableText("7113011000036100", CodingSystem.AMTV2, "Spiriva (tiotropium (as bromide monohydrate) 18 microgram) inhalation: powder for, 1 capsule");
                medicationList.Add(medication3);

                var medication4 = SharedHealthSummary.CreateMedication();
                medication4.ClinicalIndication = "Depression";
                medication4.Directions         = BaseCDAModel.CreateStructuredText("Dose:1, Frequency: 3 times daily");
                medication4.Medicine           = BaseCDAModel.CreateCodableText("32481000036107", CodingSystem.AMTV2, "Exatrust (exemestane 25 mg) tablet: film-coated, 1 tablet");
                medicationList.Add(medication4);

                var medication5 = SharedHealthSummary.CreateMedication();
                medication5.ClinicalIndication = "Depression";
                medication5.Directions         = BaseCDAModel.CreateStructuredText(NullFlavour.PositiveInfinity);
                medication5.Medicine           = BaseCDAModel.CreateCodableText("32481000036107", CodingSystem.AMTV2, "Exatrust (exemestane 25 mg) tablet: film-coated, 1 tablet");
                medicationList.Add(medication5);
                medications.Medications = medicationList;
            }
            else
            {
                medications.ExclusionStatement       = SharedHealthSummary.CreateStatement();
                medications.ExclusionStatement.Value = NCTISGlobalStatementValues.NoneKnown;
            }

            return(medications);
        }
        /// <summary>
        /// Creates and Hydrates the adverse substance reactions section for the Event Summary
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated List of IAdverseReactionsEventSummay object</returns>
        private static IAdverseReactionsWithoutExclusions CreateAdverseReactions()
        {
            var reactions = SpecialistLetter.CreateAdverseReactionsWithoutExclusions();

            reactions.AdverseSubstanceReaction = new List <Reaction>
            {
                CreateAdverseReaction(BaseCDAModel.CreateCodableText("86461001", CodingSystem.SNOMED, "Plant diterpene")),
                CreateAdverseReaction(BaseCDAModel.CreateCodableText("117491007", CodingSystem.SNOMED, "trans-Nonachlor"))
            };
            return(reactions);
        }
예제 #12
0
        /// <summary>
        /// Creates and Hydrates an IParticipationHealthcareFacility
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated IParticipationHealthcareFacility</returns>
        public static IParticipationHealthcareFacility PopulateHealthcareFacility(bool mandatoryOnly)
        {
            var participation = Nehta.VendorLibrary.CDA.Common.PCML.CreateHealthcareFacility();

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

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

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

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

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

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

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

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

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

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

            return(participation);
        }
예제 #13
0
        /// <summary>
        /// Creates and Hydrates the immunisations section for the Event Summary
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated Event Summary object</returns>
        private static List <IImmunisation> CreateImmunisations()
        {
            var immunisation = BaseCDAModel.CreateCodableText("53705011000036109", CodingSystem.AMTV3, "Advil 200 mg sugar coated tablet");

            var immunisationList = new List <IImmunisation>
            {
                CreateImmunisation(DateTime.Parse("22 Dec 2009"), immunisation, null),
                CreateImmunisation(DateTime.Parse("22 Dec 2009"), immunisation, 1),
            };

            return(immunisationList);
        }
        /// <summary>
        /// Creates and Hydrates an Prescription Item.
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <param name="mandatorySectionsOnly">Only show mandatorySectionsOnly fields</param>
        /// <param name="prescriptionId">Prescription Identifier </param>
        /// <returns>A Hydrated PrescriptionItem </returns>
        internal static IPCEHRPrescriptionItem CreatePrescriptionItem(Boolean mandatorySectionsOnly, string prescriptionId)
        {
            var prescriptionItem = PCEHRPrescriptionRecord.CreatePrescriptionItem();

            // The Dispensing Information Object
            prescriptionItem.DispensingInformation = CreateDispensingInformation(mandatorySectionsOnly);

            // Prescription Item Identifier - A globally unique object identifier for each instance of a Medication Instruction
            prescriptionItem.PrescriptionItemIdentifier = BaseCDAModel.CreateIdentifier("1.2.36.1.2001.1005.36", BaseCDAModel.CreateGuid());

            if (!mandatorySectionsOnly)
            {
                // Therapeutic Good Identification - The medicine, vaccine or other therapeutic good being ordered, administered to or used by the subject of care
                prescriptionItem.TherapeuticGoodId = BaseCDAModel.CreateCodableText("01158Y", CodingSystem.PBSCode, "cimetidine 400 mg tablet, 60", null, null);

                // Therapeutic Good Strength (Additional Therapeutic Good Detail) - Information concerning the strength of the Therapeutic Good
                prescriptionItem.TherapeuticGoodStrength = "Therapeutic Good Strength";

                // Therapeutic Good Generic Name (Additional Therapeutic Good Detail) - The generic name of the Therapeutic Good
                prescriptionItem.TherapeuticGoodGenericName = "Therapeutic Good Generic Name";

                // Directions - A complete narrative description of how much, when and how to use the medicine, vaccine or other therapeutic good
                prescriptionItem.Directions = "Directions";

                // Formula - The recipe for compounding a medicine
                prescriptionItem.Formula = "Formula";

                // Form - The formulation or presentation of the overall substance
                prescriptionItem.Form = BaseCDAModel.CreateCodableText("385057009", CodingSystem.SNOMED, "Film-coated tablet", null, null);

                // ClinicalIndication - A reason for ordering the medicine, vaccine or other therapeutic good
                prescriptionItem.ClinicalIndication = "Clinical Indication";

                // Route - The route by which the medication is administered
                prescriptionItem.Route = BaseCDAModel.CreateCodableText("26643006", CodingSystem.SNOMED, "Oral route", null, null);

                // Comment - Any additional information that may be needed to ensure the continuity of supply, rationale for current dose and timing, or safe and appropriate use
                prescriptionItem.Comment = "Comment";

                // DateTime Prescription Expires
                prescriptionItem.DateTimePrescriptionExpires = new ISO8601DateTime(DateTime.Now.AddMonths(12));

                // PBS Manufacturer Code (Administrative Manufacturer Code) - Administrative code of the manufacturer of the pharmaceutical item supplied
                prescriptionItem.PBSManufacturerCode = BaseCDAModel.CreateExternalConceptIdentifier(ExternalConcepts.AustralianPBSManufacturerCode, "AB");
            }
            else
            {
                // Therapeutic Good Identification - The medicine, vaccine or other therapeutic good being ordered, administered to or used by the subject of care
                prescriptionItem.TherapeuticGoodId = BaseCDAModel.CreateCodableText("28237011000036107", CodingSystem.AMTV3, "amoxycillin 500 mg capsule, 20", null, null);
            }
            return(prescriptionItem);
        }
        /// <summary>
        /// Creates and hydrates the 'Test Result' section.
        /// </summary>
        /// <returns>A hydrated 'Test Result' object.</returns>
        public static ITestResult CreateTestResult(Boolean mandatorySectionsOnly)
        {
            // Result (INDIVIDUAL PATHOLOGY TEST RESULT)
            ITestResult resultGroup = BaseCDAModel.CreateTestResult();

            resultGroup.ResultName = BaseCDAModel.CreateCodableText("14682-9", CodingSystem.LOINC, "Creatinine [Moles/volume] in Serum or Plasma");

            // Individual Pathology Test Result Status
            resultGroup.ResultStatus = BaseCDAModel.CreateCodableText(HL7ResultStatus.FinalResultsResultsStoredAndVerifiedCanOnlyBeChangedWithACorrectedResult);

            // Result Value (INDIVIDUAL PATHOLOGY TEST RESULT VALUE)
            resultGroup.ResultValue = BaseCDAModel.CreateResultValue();

            // Test Result Value
            resultGroup.ResultValue.TestResultValue = BaseCDAModel.CreateQuantity("12.88", "ml");

            if (!mandatorySectionsOnly)
            {
                // Individual Pathology Test Result Comment
                resultGroup.Comments = new List <string> {
                    "Sodium test result comments",
                    "More comments",
                    "Another comment"
                };

                // Individual Pathology Test Result Reference Range Guidance
                resultGroup.ReferenceRangeGuidance = "Reference range guidance comments for Sodium; eg. the quantity should be between the high and low values";

                // Normal Status
                resultGroup.NormalStatus = HL7ObservationInterpretationNormality.Normal;

                // Individual Pathology Test Result Value Reference Ranges (REFERENCE RANGE DETAILS)
                var resultValueReferenceRangeDetail = BaseCDAModel.CreateResultValueReferenceRangeDetail();

                // Reference Range
                resultValueReferenceRangeDetail.Range = BaseCDAModel.CreateQuantityRange(50, 100, "ml");

                // Reference Range Meaning
                resultValueReferenceRangeDetail.ResultValueReferenceRangeMeaning = BaseCDAModel.CreateCodableText("75540009", CodingSystem.SNOMEDCT, "High");

                // Individual Pathology Test Result Value Reference Ranges (REFERENCE RANGE DETAILS)
                resultGroup.ResultValueReferenceRangeDetails = new List <ResultValueReferenceRangeDetail>
                {
                    resultValueReferenceRangeDetail,
                    resultValueReferenceRangeDetail,
                };
            }

            return(resultGroup);
        }
예제 #16
0
        /// <summary>
        /// Creates an adverse reaction.
        /// </summary>
        /// <param name="code">Code for the adverse reaction.</param>
        /// <param name="name">Name of the adverse reaction.</param>
        /// <returns></returns>
        private static Reaction CreateAdverseReaction(ICodableText substanceOrAgent)
        {
            Reaction reaction = EventSummary.CreateReaction();

            reaction.SubstanceOrAgent = substanceOrAgent;

            reaction.ReactionEvent = BaseCDAModel.CreateReactionEvent();
            reaction.ReactionEvent.Manifestations = new List <ICodableText>
            {
                BaseCDAModel.CreateCodableText("248265004", CodingSystem.SNOMED, "Work stress"),
                BaseCDAModel.CreateCodableText("425392003", CodingSystem.SNOMED, "Active advance directive")
            };

            reaction.ReactionEvent.ReactionType = BaseCDAModel.CreateCodableText("419076005", CodingSystem.SNOMED, "Allergic reaction");

            return(reaction);
        }
        /// <summary>
        /// Creates a medication item.
        /// </summary>
        /// <param name="code">Medication code.</param>
        /// <param name="name">Medication name.</param>
        /// <param name="directionsNullFlavour">The Directions Null Flavour</param>
        /// <param name="recomendationOrChangeNullFlavour">The Recommendation Or Change Null Flavour</param>
        /// <param name="changeTypeNullFlavour">The Change Type Null Flavour</param>
        /// <returns></returns>
        private static IMedicationItem CreateMedication(string code, string name, bool showNullflavor = false)
        {
            IMedicationItem medication = EventSummary.CreateMedication();

            // WE SHOULD NEVER USE showNullflavor as the defined refsets are very simple ones
            medication.Directions   = BaseCDAModel.CreateStructuredText("Dose:1, Frequency: 3 times daily");
            medication.ChangeStatus = BaseCDAModel.CreateCodableText(ChangeStatus.ChangeMade);
            medication.ChangeType   = BaseCDAModel.CreateCodableText(ChangeTypeSnomed.Changed);

            medication.ChangeDescription  = "Change Description";
            medication.ChangeReason       = BaseCDAModel.CreateStructuredText("Change Reason");
            medication.ClinicalIndication = "Clinical Indication";
            medication.Comment            = "Comment";

            medication.Medicine = BaseCDAModel.CreateCodableText(code, CodingSystem.AMTV3, name);

            return(medication);
        }
        /// <summary>
        /// Creates an adverse reaction.
        /// </summary>
        /// <param name="code">Code for the adverse reaction.</param>
        /// <param name="name">Name of the adverse reaction.</param>
        /// <returns></returns>
        private static Reaction CreateAdverseReaction(ICodableText substanceOrAgent)
        {
            Reaction reaction = SpecialistLetter.CreateReaction();

            reaction.SubstanceOrAgent = substanceOrAgent;

            reaction.ReactionEvent = BaseCDAModel.CreateReactionEvent();

            reaction.ReactionEvent.Manifestations = new List <ICodableText>
            {
                BaseCDAModel.CreateCodableText("305505004", CodingSystem.SNOMED, "Under care of pathologist"),
                BaseCDAModel.CreateCodableText("170753006", CodingSystem.SNOMED, "Understands diet - diabetes")
            };

            reaction.ReactionEvent.ReactionType = BaseCDAModel.CreateCodableText("419076005", CodingSystem.SNOMED, "Allergic reaction");

            return(reaction);
        }
예제 #19
0
        /// <summary>
        /// Creates and Hydrates the reviewed adverse substance reactions section for the Shared Health Summary
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated ReviewedAdverseSubstanceReactions object</returns>
        private static IAdverseReactions CreateAdverseReactions(Boolean mandatorySectionsOnly)
        {
            var adverseReactions = SharedHealthSummary.CreateReviewedAdverseSubstanceReactions();

            if (!mandatorySectionsOnly)
            {
                var reaction = SharedHealthSummary.CreateReaction();
                reaction.SubstanceOrAgent = BaseCDAModel.CreateCodableText("391739009", CodingSystem.SNOMED, "Aloe");
                reaction.ReactionEvent    = BaseCDAModel.CreateReactionEvent();

                reaction.ReactionEvent.Manifestations = new List <ICodableText>
                {
                    BaseCDAModel.CreateCodableText("20262006", CodingSystem.SNOMED, "Ataxia"),
                    BaseCDAModel.CreateCodableText("285599002", CodingSystem.SNOMED, "Trunk nerve lesion")
                };

                reaction.ReactionEvent.ReactionType = BaseCDAModel.CreateCodableText("419076005", CodingSystem.SNOMED, "Allergic reaction");

                var reaction2 = SharedHealthSummary.CreateReaction();
                reaction2.SubstanceOrAgent = BaseCDAModel.CreateCodableText("372725003", CodingSystem.SNOMED, "Phenoxymethylpenicillin");
                reaction2.ReactionEvent    = BaseCDAModel.CreateReactionEvent();

                reaction2.ReactionEvent.Manifestations = new List <ICodableText>
                {
                    BaseCDAModel.CreateCodableText("20262006", CodingSystem.SNOMED, "Ataxia"),
                    BaseCDAModel.CreateCodableText("285599002", CodingSystem.SNOMED, "Trunk nerve lesion")
                };

                reaction2.ReactionEvent.ReactionType = BaseCDAModel.CreateCodableText("419076005", CodingSystem.SNOMED, "Allergic reaction");

                adverseReactions.AdverseSubstanceReaction = new List <Reaction>
                {
                    reaction,
                    reaction2
                };
            }
            else
            {
                adverseReactions.ExclusionStatement       = BaseCDAModel.CreateStatement();
                adverseReactions.ExclusionStatement.Value = NCTISGlobalStatementValues.NoneSupplied;
            }

            return(adverseReactions);
        }
        /// <summary>
        /// Creates and hydrates the 'OrderDetails' section.
        /// </summary>
        /// <param name="mandatorySectionsOnly">Includes on the mandatory items</param>
        /// <returns>A hydrated 'OrderDetails' object.</returns>
        public static OrderDetails CreateOrderDetails(Boolean mandatorySectionsOnly)
        {
            // Order Details
            var orderDetails = DiagnosticImagingReport.CreateOrderDetails();

            if (!mandatorySectionsOnly)
            {
                // Requester Order Identifier
                orderDetails.RequesterOrderIdentifier = BaseCDAModel.CreateIdentifier("1.2.36.1.2001.1005.52.8003620833333789", "10523479");

                // Requester Order Identifier
                orderDetails.RequestedTestName = BaseCDAModel.CreateCodableText("26604007", CodingSystem.SNOMED, "Complete blood count");
            }

            // Requester
            orderDetails.Requester = GenericObjectReuseSample.CreateRequester(mandatorySectionsOnly);

            return(orderDetails);
        }
예제 #21
0
        /// <summary>
        /// Gets the test result name.
        /// </summary>
        /// <param name="universalServiceId">Universal Service Id</param>
        /// <returns>ICodableText</returns>
        internal static ICodableText GetTestResultName(CE universalServiceId)
        {
            string code;
            string text;

            if (string.IsNullOrWhiteSpace(universalServiceId.alternatetext) &&
                string.IsNullOrWhiteSpace(universalServiceId.alternateidentifier) &&
                string.IsNullOrWhiteSpace(universalServiceId.nameofalternatecodingsystem))
            {
                code = universalServiceId.identifier;
                text = universalServiceId.text;
            }
            else
            {
                code = universalServiceId.alternateidentifier;
                text = universalServiceId.alternatetext;
            }

            return(BaseCDAModel.CreateCodableText(code, null, string.Empty, text));
        }
        /// <summary>
        /// Creates and hydrates the 'Other Test Result' Attachment section.
        /// </summary>
        /// <returns>A hydrated 'OtherTestResult' object.</returns>
        public static OtherTestResult CreateOtherTestResultAttachment()
        {
            var otherTestResult = BaseCDAModel.CreateOtherTestResult();

            // Report Name
            otherTestResult.ReportName = BaseCDAModel.CreateCodableText("Report with Attachment");

            // Report Status
            otherTestResult.ReportStatus = BaseCDAModel.CreateCodableText(Hl7V3ResultStatus.NoOrderOnRecordForThisTest);

            // Report ExternalData
            ExternalData report = BaseCDAModel.CreateExternalData(MediaType.PDF, AttachmentFileNameAndPath, "Path File");

            otherTestResult.ReportContent = BaseCDAModel.CreateEncapsulatedData();
            otherTestResult.ReportContent.ExternalData = report;

            // Report Date
            otherTestResult.ReportDate = new ISO8601DateTime(DateTime.Now.AddDays(-2));

            return(otherTestResult);
        }
        /// <summary>
        /// Creates and hydrates the 'Other Test Result' text only section.
        /// </summary>
        /// <returns>A hydrated 'OtherTestResult' object.</returns>
        public static OtherTestResult CreateOtherTestResultText()
        {
            var otherTestResult = BaseCDAModel.CreateOtherTestResult();

            // Report Name
            otherTestResult.ReportName = BaseCDAModel.CreateCodableText("Report Name");

            // Report Status
            otherTestResult.ReportStatus = BaseCDAModel.CreateCodableText(HL7ResultStatus.CorrectionToResults);

            // Report Content
            otherTestResult.ReportContent = BaseCDAModel.CreateEncapsulatedData();

            // Report Content
            otherTestResult.ReportContent.Text = "Report Content - Text";

            // Report Date
            otherTestResult.ReportDate = new ISO8601DateTime(DateTimeNow);

            return(otherTestResult);
        }
        /// <summary>
        /// Creates and hydrates the 'Test Result Group' section.
        /// </summary>
        /// <returns>A hydrated 'Test Result Group' object.</returns>
        public static ITestResultGroup CreateTestResultGroup(Boolean mandatorySectionsOnly)
        {
            // Test Result Group
            ITestResultGroup testResultGroup = BaseCDAModel.CreateTestResultGroup();

            // Pathology TestResult Group Name
            testResultGroup.ResultGroupName = BaseCDAModel.CreateCodableText("18719-5", CodingSystem.LOINC, "Chemistry Studies (Set)");

            // Result (INDIVIDUAL PATHOLOGY TEST RESULT)
            testResultGroup.Results = new List <ITestResult>
            {
                CreateTestResult(mandatorySectionsOnly)
            };

            if (!mandatorySectionsOnly)
            {
                // Result Group Specimen Detail (SPECIMEN)
                testResultGroup.ResultGroupSpecimenDetail = CreateTestSpecimenDetail(mandatorySectionsOnly);
            }

            return(testResultGroup);
        }
        /// <summary>
        /// Creates a pathology test result.
        /// </summary>
        /// <returns>PathologyTestResult</returns>
        private static PathologyTestResult CreatePathologyTestResult(string reportingPathologistName)
        {
            PathologyTestResult testResult = PathologyResultReport.CreatePathologyTestResult();

            // Please note optional field - Note: This field is only displayed in the Narrative
            testResult.ReportingPathologistForTestResult = reportingPathologistName;

            // Test Result Name
            testResult.TestResultName = BaseCDAModel.CreateCodableText("275711006", CodingSystem.SNOMED, "Serum chemistry test");

            // Department Code
            testResult.PathologyDiscipline = DiagnosticService.Laboratory;

            // Department Code
            testResult.OverallTestResultStatus = BaseCDAModel.CreateResultStatus(Hl7V3ResultStatus.Preliminary, "Preliminary"); // or BaseCDAModel.CreateResultStatus(Hl7V3ResultStatus.Preliminary)

            // Test Specimen Detail
            testResult.TestSpecimenDetail = CreateTestSpecimenDetail();

            // Pathology Test Result Date Time
            testResult.ObservationDateTime = new ISO8601DateTime(DateTime.Parse("27 Feb 2007 13:00"));

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

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

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

            var person = BaseCDAModel.CreatePersonHealthcareProvider();

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

            name1.FamilyName = "Doctor";

            var name2 = BaseCDAModel.CreatePersonName();

            name2.FamilyName = "Wong";

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

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

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

            var address2 = BaseCDAModel.CreateAddress();

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

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

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

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

            author.Participant.Addresses = addressList;


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


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

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

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

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

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



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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                authenticator.Participant.Addresses = addressList;

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

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

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

                // LegalAuthenticator/assignedEntity/representedOrganization/<Entity Identifier>
                authenticator.Participant.Organisation.Identifiers = new List <Identifier>
                {
                    BaseCDAModel.CreateIdentifier("SampleAuthority", null, null, "1.2.3.4.55555", null),
                    BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, "8003620000001144")
                };
            }
        }
        /// <summary>
        /// Creates and Hydrates a Service Provider Person
        ///
        /// Note: the data used within this method is intended as a guide and should be replaced.
        /// </summary>
        /// <returns>A Hydrated IParticipationHealthProfessional object</returns>
        private static IParticipationServiceProvider CreateServiceProviderPerson(Boolean mandatorySectionsOnly)
        {
            var serviceProvider = BaseCDAModel.CreateServiceProvider();

            var participant = BaseCDAModel.CreateParticipantForServiceProvider();

            participant.Person = BaseCDAModel.CreatePersonHealthcareProvider();

            var personName = BaseCDAModel.CreatePersonName();

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

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

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

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

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

            var address = BaseCDAModel.CreateAddress();

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

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

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

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

            serviceProvider.Participant = participant;

            return(serviceProvider);
        }
        /// <summary>
        /// Create Address Organisation
        /// </summary>
        /// <returns>(IParticipationAddressee) Addressee</returns>
        private static IParticipationAddressee CreateAddresseePerson(Boolean mandatorySectionsOnly)
        {
            var addressee = SpecialistLetter.CreateAddressee();

            addressee.Participant = SpecialistLetter.CreateParticipantAddressee();

            var personName = BaseCDAModel.CreatePersonName();

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

            var person = BaseCDAModel.CreatePersonWithOrganisation();

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

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

            var address = BaseCDAModel.CreateAddress();

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

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

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

            addressee.Participant.ElectronicCommunicationDetails = electronicCommunicationDetails;

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

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

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

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

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

            var person = BaseCDAModel.CreatePersonWithOrganisation();

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

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

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

            name.FamilyName = "Doctor";

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

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

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

            var address2 = BaseCDAModel.CreateAddress();

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

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

            reportingPathologist.Participant.Addresses = addressList;

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

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

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

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

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

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

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

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

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

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

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

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

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

            reportingPathologist.Participant.Person = person;

            return(reportingPathologist);
        }