private static IParticipationAcdCustodian CreateAcdCustodianOrganisation(string name, string department, string id, string addressLine, string phone, bool mandatoryOnly) { var custodianParticipation = AcdCustodianRecord.CreateParticipationAcdCustodian(); custodianParticipation.ParticipationPeriod = BaseCDAModel.CreateInterval( new ISO8601DateTime(DateTime.Now.AddDays(-50)), new ISO8601DateTime(DateTime.Now)); custodianParticipation.Role = BaseCDAModel.CreateRole(Occupation.GeneralMedicalPractitioner); custodianParticipation.Participant = AcdCustodianRecord.CreateAcdCustodian(); IOrganisation organisation = BaseCDAModel.CreateOrganisation(); organisation.Name = name; organisation.Identifiers = new List <Identifier> { BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, id) }; custodianParticipation.Participant.Organisation = organisation; if (!mandatoryOnly) { organisation.Department = department; organisation.NameUsage = OrganisationNameUsage.EnterpriseName; // Address IAddressAustralian address1 = BaseCDAModel.CreateAddress(); address1.AddressPurpose = AddressPurpose.Residential; address1.AustralianAddress = BaseCDAModel.CreateAustralianAddress(); address1.AustralianAddress.UnstructuredAddressLines = new List <string> { addressLine }; address1.AustralianAddress.SuburbTownLocality = "Nehtaville"; address1.AustralianAddress.State = AustralianState.QLD; address1.AustralianAddress.PostCode = "5555"; address1.AustralianAddress.DeliveryPointId = 32568931; custodianParticipation.Participant.Addresses = new List <IAddressAustralian> { address1 }; // Communication var electronicCommunicationDetail = BaseCDAModel.CreateElectronicCommunicationDetail ( phone, ElectronicCommunicationMedium.Telephone, ElectronicCommunicationUsage.WorkPlace ); custodianParticipation.Participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail> { electronicCommunicationDetail }; } return(custodianParticipation); }
/// <summary> /// Creates a patient nominated contact. /// </summary> /// <param name="givenName">Given name</param> /// <param name="familyName">Family name</param> /// <param name="hpii">Hpii</param> /// <param name="addressLine">Address line</param> /// <param name="phone">Phone</param> /// <param name="mandatoryOnly">Show mandatory objects</param> /// <returns>IParticipationAcdCustodian</returns> private static IParticipationAcdCustodian CreateAcdCustodianPerson( string givenName, string familyName, string hpii, string addressLine, string phone, bool mandatoryOnly) { IParticipationAcdCustodian paticipation = AcdCustodianRecord.CreateParticipationAcdCustodian(); paticipation.ParticipationPeriod = BaseCDAModel.CreateInterval( new ISO8601DateTime(DateTime.Now.AddDays(-50)), new ISO8601DateTime(DateTime.Now)); paticipation.Role = BaseCDAModel.CreateRole(Occupation.GeneralMedicalPractitioner); paticipation.Participant = AcdCustodianRecord.CreateAcdCustodian(); // Name var person = BaseCDAModel.CreatePersonConsumer(); var personName = BaseCDAModel.CreatePersonName(); personName.GivenNames = new List <string> { givenName }; personName.FamilyName = familyName; personName.Titles = new List <string> { "Dr" }; personName.NameUsages = new List <NameUsage> { NameUsage.Legal }; person.PersonNames = new List <IPersonName> { personName }; paticipation.Participant.Person = person; // Address IAddressAustralian address = BaseCDAModel.CreateAddress(); address.AddressPurpose = AddressPurpose.Business; address.AustralianAddress = BaseCDAModel.CreateAustralianAddress(); address.AustralianAddress.UnstructuredAddressLines = new List <string> { addressLine }; address.AustralianAddress.SuburbTownLocality = "Nehtaville"; address.AustralianAddress.State = AustralianState.QLD; address.AustralianAddress.PostCode = "5555"; paticipation.Participant.Addresses = new List <IAddressAustralian> { address }; // Identifiers paticipation.Participant.Person.Identifiers = new List <Identifier> { BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPII, hpii) }; if (!mandatoryOnly) { person.DateOfBirth = new ISO8601DateTime(DateTime.Now); person.Gender = Gender.Male; // Communication var electronicCommunicationDetail = AcdCustodianRecord.CreateElectronicCommunicationDetail ( phone, ElectronicCommunicationMedium.Telephone, ElectronicCommunicationUsage.WorkPlace ); paticipation.Participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail> { electronicCommunicationDetail }; person.Organisation = BaseCDAModel.CreateEmploymentOrganisation(); person.Organisation.Identifiers = new List <Identifier> { BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, "8003620000021100") }; person.Organisation.Name = "Super Healthy Hospital"; person.Organisation.NameUsage = OrganisationNameUsage.EnterpriseName; person.Organisation.Department = "Endocrinology"; person.Organisation.EmploymentType = BaseCDAModel.CreateCodableText(EmploymentType.FullTime); person.Organisation.Occupation = BaseCDAModel.CreateRole(Occupation.GeneralMedicalPractitioner); person.Organisation.PositionInOrganisation = BaseCDAModel.CreateCodableText(null, null, null, "SMO", null); } return(paticipation); }
/// <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); }