/// <summary> /// Creates and Hydrates an Recipient demonstrating its usage with multiple CDA Libraries /// /// Note: the data used within this method is intended as a guide and should be replaced. /// </summary> /// <returns>A Hydrated Recipient</returns> public IParticipationInformationRecipient PopulateRecipient() { var genericRecipient = BaseCDAModel.CreateInformationRecipient(); HydrateRecipient(genericRecipient, RecipientType.Primary, false); //The requirement to instantiate the objects with the factory ensures that the correct implementations //of each interface are instantiated; e.g. that the correct content and context are created. var specialistLetter = new SpecialistLetter(DocumentStatus.Interim) { CDAContext = SpecialistLetter.CreateCDAContext() }; specialistLetter.CDAContext.InformationRecipients = new List <IParticipationInformationRecipient> { genericRecipient }; //The requirement to instantiate the objects with the factory ensures that the correct implementations //of each interface are instantiated; e.g. that the correct content and context are created. var dischargeSummary = new EDischargeSummary(DocumentStatus.Interim) { CDAContext = EDischargeSummary.CreateCDAContext() }; dischargeSummary.CDAContext.InformationRecipients = new List <IParticipationInformationRecipient> { genericRecipient }; return(genericRecipient); }
/// <summary> /// Creates and Hydrates an Authenticator demonstrating its usage with multiple CDA Libraries /// /// Note: the data used within this method is intended as a guide and should be replaced. /// </summary> /// <returns>A Hydrated Authenticator</returns> public IParticipationLegalAuthenticator PopulateAuthenticator() { var genericAuthenticator = BaseCDAModel.CreateAuthenticator(); HydrateAuthenticator(genericAuthenticator, false); //The requirement to instantiate the objects with the factory ensures that the correct implementations //of each interface are instantiated; e.g. that the correct content and context are created. var specialistLetter = new SpecialistLetter(DocumentStatus.Interim) { CDAContext = SpecialistLetter.CreateCDAContext() }; specialistLetter.CDAContext.LegalAuthenticator = genericAuthenticator; //The requirement to instantiate the objects with the factory ensures that the correct implementations //of each interface are instantiated; e.g. that the correct content and context are created. var dischargeSummary = new EDischargeSummary(DocumentStatus.Interim) { CDAContext = EDischargeSummary.CreateCDAContext() }; dischargeSummary.CDAContext.LegalAuthenticator = genericAuthenticator; return(genericAuthenticator); }
/// <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); }
/// <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); }
/// <summary> /// Creates and Hydrates an Subject Of Care demonstrating its usage with multiple CDA Libraries /// /// Note: the data used within this method is intended as a guide and should be replaced. /// </summary> /// <returns>A Hydrated SubjectOfCare</returns> public IParticipationSubjectOfCare PopulateSubjectOfCare() { IParticipationSubjectOfCare genericSubjectOfCare = BaseCDAModel.CreateSubjectOfCare(); HydrateSubjectofCare(genericSubjectOfCare, false); //The requirement to instantiate the objects with the factory ensures that the correct implementations //of each interface are instantiated; e.g. that the correct content and context are created. var specialistLetter = new SpecialistLetter(DocumentStatus.Interim) { SCSContext = SpecialistLetter.CreateSCSContext() }; specialistLetter.SCSContext.SubjectOfCare = genericSubjectOfCare; //The requirement to instantiate the objects with the factory ensures that the correct implementations //of each interface are instantiated; e.g. that the correct content and context are created. var dischargeSummary = new EDischargeSummary(DocumentStatus.Interim) { SCSContext = EDischargeSummary.CreateSCSContext() }; dischargeSummary.SCSContext.SubjectOfCare = genericSubjectOfCare; return(genericSubjectOfCare); }
/// <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); }
/// <summary> /// Create the reporting pathologist from information in the HL7 V2 message. /// </summary> /// <param name="message">The HL7 V2 message.</param> /// <returns></returns> internal static IParticipationReportingPathologist CreateReportingPathologist(HL7GenericMessage message) { var nameCn = message.Order.First().Observation.First().ObservationsReportID.PrincipalResultInterpreter.name; var reportingPathologist = PathologyResultReport.CreateReportingPathologist(); // Document reportingPathologist > Participant reportingPathologist.Participant = PathologyResultReport.CreateParticipantForReportingPathologist(); // Participation Period reportingPathologist.ParticipationEndTime = GetResultsReportStatusChange(message); var person = BaseCDAModel.CreatePersonWithOrganisation(); // Document reportingPathologist > Participant > Person or Organisation or Device > Person > Person Name person.PersonNames = new List <IPersonName> { GetPersonNameFromCn(nameCn) }; // Document reportingPathologist > Participant > Entity Identifier person.Identifiers = new List <Identifier> { BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPII, nameCn.IDnumberST) }; reportingPathologist.Participant.Person = person; return(reportingPathologist); }
/// <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); }
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); } }
/// <summary> /// Create the pathology test result from information in the HL7 V2 message. /// </summary> /// <param name="obrSegment">OBR segment.</param> /// <returns>PathologyTestResult</returns> internal static PathologyTestResult CreatePathologyTestResult(OBR obrSegment) { PathologyTestResult testResult = PathologyResultReport.CreatePathologyTestResult(); // Test Result Name testResult.TestResultName = GetTestResultName(obrSegment.UniversalServiceID); // Pathology Discipline DiagnosticService diagnosticService; if (!EnumHelper.TryGetEnumValue <DiagnosticService, NameAttribute>(attribute => attribute.Code == obrSegment.DiagnosticServSectID, out diagnosticService)) { diagnosticService = DiagnosticService.Laboratory; } testResult.PathologyDiscipline = diagnosticService; // Report Status Hl7V3ResultStatus hl7V3ResultStatus; if (!EnumHelper.TryGetEnumValue <Hl7V3ResultStatus, NameAttribute>(attribute => attribute.Code == obrSegment.ResultStatus, out hl7V3ResultStatus)) { throw new ArgumentException("No matching Hl7V3ResultStatus value found"); } testResult.OverallTestResultStatus = BaseCDAModel.CreateResultStatus(hl7V3ResultStatus); // Test Specimen Detail testResult.TestSpecimenDetail = PathologyResultReport.CreateTestSpecimenDetail(); testResult.TestSpecimenDetail.CollectionDateTime = new ISO8601DateTime(obrSegment.ObservationDateTime.TimestampValue.Value); // Pathology Test Result Date Time testResult.ObservationDateTime = new ISO8601DateTime(obrSegment.ObservationDateTime.TimestampValue.Value); return(testResult); }
/// <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); }
private IPersonName GetCdaPatientName(Spia.PathologyReportModel.Model.Name Name) { var CdaName = BaseCDAModel.CreatePersonName(); CdaName.FamilyName = Name.Family; if (Name.Given is object) { CdaName.GivenNames = new List <string>() { Name.Given }; if (Name.Middle is object) { CdaName.GivenNames.Add(Name.Middle); } } if (Name.Title is object) { CdaName.Titles = new List <string>() { Name.Title }; } CdaName.NameUsages = new List <NameUsage>() { NameUsage.Legal }; return(CdaName); }
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 }); } }
/// <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 an Dispensing Object /// /// 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> /// <returns>A Hydrated Dispensing Object </returns> internal static DispensingInformation CreateDispensingInformation(Boolean mandatorySectionsOnly) { // The Dispensing Object var dispensingInformation = PCEHRPrescriptionRecord.CreateDispensingInformation(); // Dispensing - Quantity Description - Free text description of the amount which may consist of the quantity and dose unit. dispensingInformation.QuantityDescription = "Dispensing Information - Quantity"; if (!mandatorySectionsOnly) { // Brand Substitution Permitted - Indicates whether or not the substitution of a prescribed medicine with a different brand name of the same medicine, vaccine or other therapeutic good. // which has been determined as bioequivalent, is allowed when the medication is dispensed/supplied dispensingInformation.BrandSubstitutionPermitted = true; // Dispensing - Quantity Description - Free text description of the amount which may consist of the quantity and dose unit dispensingInformation.QuantityDescription = "Dispensing Information - Quantity"; // Dispensing - Maximum Number Of Repeats - The number of times the expressed quantity of medicine, vaccine or other therapeutic good may be refilled or redispensed without a new prescription dispensingInformation.MaximumNumberOfRepeats = 6; // Dispensing - Minimum Interval Between Repeats - The minimum time between repeat dispensing of the medicine, vaccine or therapeutic good. dispensingInformation.MinimumIntervalBetweenRepeats = BaseCDAModel.CreateInterval("1", TimeUnitOfMeasure.Week); } return(dispensingInformation); }
/// <summary> /// Creates and Hydrates a Recommendations object /// </summary> /// <returns>(IRecommendations) Recommendations</returns> private static IRecommendations CreateRecommendations(Boolean mandatorySectionsOnly) { var recommendations = SpecialistLetter.CreateRecommendations(); if (!mandatorySectionsOnly) { var recomendationPerson = SpecialistLetter.CreateRecommendation(); recomendationPerson.Narrative = "Recommendation Narrative Person"; recomendationPerson.TimeFrame = BaseCDAModel.CreateInterval( new ISO8601DateTime(DateTime.Now, ISO8601DateTime.Precision.Day), new ISO8601DateTime(DateTime.Now.AddMonths(4), ISO8601DateTime.Precision.Day)); recomendationPerson.Addressee = CreateAddresseePerson(mandatorySectionsOnly); var recomendationOrganisation = SpecialistLetter.CreateRecommendation(); recomendationOrganisation.Narrative = "Recommendation Narrative Organisation"; recomendationOrganisation.TimeFrame = BaseCDAModel.CreateInterval("4", TimeUnitOfMeasure.Month); recomendationOrganisation.Addressee = CreateAddresseeOrganisation(mandatorySectionsOnly); recommendations.Recommendation = new List <Recommendation> { recomendationPerson, recomendationOrganisation }; } else { recommendations.ExclusionStatement = "No Recommendations are supplied"; } return(recommendations); }
/// <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> /// Creates and Hydrates an atomicalSite /// </summary> /// <returns>AnatomicalSite</returns> private static AnatomicalSite CreateAnatomicalSite(string description) { var anatomicalSite = BaseCDAModel.CreateAnatomicalSite(); anatomicalSite.Description = description; return(anatomicalSite); }
/// <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); }
/// <summary> /// This example show an example of populating a 1B document /// </summary> public XmlDocument PopulateSpecialistLetterSample_1B(string fileName) { XmlDocument xmlDoc = null; var document = PopulateSpecialistLetter(true); document.SCSContent = SpecialistLetter.CreateSCSContent(); document.IncludeLogo = false; // Hide Administrative Observations Section document.ShowAdministrativeObservationsSection = false; var narrativeOnlyDocumentList = new List <NarrativeOnlyDocument>(); var narrativeOnlyDocument = BaseCDAModel.CreateNarrativeOnlyDocument(); narrativeOnlyDocument.Title = "Narrative Title"; narrativeOnlyDocument.Narrative = new StrucDocText { paragraph = new[] { new StrucDocParagraph { Text = new[] { "The narrative goes here" } } } }; // Add One narrativeOnlyDocumentList.Add(narrativeOnlyDocument); document.SCSContent.NarrativeOnlyDocument = narrativeOnlyDocumentList; try { CDAGenerator.NarrativeGenerator = new CDANarrativeGenerator(); //Pass the document model into the Generate method xmlDoc = CDAGenerator.GenerateSpecialistLetter(document); using (var writer = XmlWriter.Create(OutputFolderPath + @"\" + fileName, new XmlWriterSettings { Indent = true })) { if (!fileName.IsNullOrEmptyWhitespace()) { xmlDoc.Save(writer); } } } catch (ValidationException ex) { //Catch any validation exceptions var validationMessages = ex.GetMessagesString(); //Handle any validation errors as appropriate. throw; } return(xmlDoc); }
/// <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); }
/// <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); }
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> /// Create Addressee Organisation /// </summary> /// <returns>(IParticipationAddressee) Addressee</returns> private static IParticipationAddressee CreateAddresseeOrganisation(Boolean mandatorySectionsOnly) { var addressee = SpecialistLetter.CreateAddressee(); addressee.Participant = SpecialistLetter.CreateParticipantAddressee(); addressee.Participant.Organisation = BaseCDAModel.CreateOrganisation(); addressee.Participant.Organisation.Name = "Bay Hill Hospital"; addressee.Participant.Organisation.NameUsage = OrganisationNameUsage.Other; addressee.Participant.Organisation.Identifiers = new List <Identifier> { BaseCDAModel.CreateHealthIdentifier(HealthIdentifierType.HPIO, "8003620000045562") }; addressee.Participant.Organisation.Department = "Some department organisation"; 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 }; addressee.Participant.ElectronicCommunicationDetails = new List <ElectronicCommunicationDetail> { BaseCDAModel.CreateElectronicCommunicationDetail("*****@*****.**", ElectronicCommunicationMedium.Email, ElectronicCommunicationUsage.WorkPlace), BaseCDAModel.CreateElectronicCommunicationDetail("134567891", ElectronicCommunicationMedium.Telephone, new List <ElectronicCommunicationUsage> { //ElectronicCommunicationUsage.PrimaryHome, ElectronicCommunicationUsage.MobileContact ElectronicCommunicationUsage.WorkPlace }), BaseCDAModel.CreateElectronicCommunicationDetail("675675675676", ElectronicCommunicationMedium.Telephone, new List <ElectronicCommunicationUsage> { //ElectronicCommunicationUsage.MobileContact ElectronicCommunicationUsage.WorkPlace }), }; if (!mandatorySectionsOnly) { addressee.Role = BaseCDAModel.CreateRole(HealthcareFacilityTypeCodes.GeneralPractice); } else { addressee.Role = BaseCDAModel.CreateRole(HealthcareFacilityTypeCodes.RetailPharmacy); } return(addressee); }
/// <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); }
/// <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> /// This example populates only the mandatory Sections / Entries; as a result this sample omits all /// of the content within the body of the CDA document; as each of the sections within the body /// are optional. /// </summary> public XmlDocument PopulateEventSummarySample_1A(string fileName) { XmlDocument xmlDoc; var document = PopulatedEventSummary(true); // Hide Administrative Observations Section document.ShowAdministrativeObservationsSection = false; document.SCSContent = EventSummary.CreateSCSContent(); document.IncludeLogo = false; var structuredBodyFileList = new List <ExternalData>(); var structuredBodyFile = BaseCDAModel.CreateStructuredBodyFile(); structuredBodyFile.Caption = "Structured Body File"; structuredBodyFile.ExternalDataMediaType = MediaType.PDF; structuredBodyFile.Path = StructuredFileAttachment; structuredBodyFileList.Add(structuredBodyFile); document.SCSContent.StructuredBodyFiles = structuredBodyFileList; try { CDAGenerator.NarrativeGenerator = new CDANarrativeGenerator(); //Pass the document model into the Generate method xmlDoc = CDAGenerator.GenerateEventSummary(document); using (var writer = XmlWriter.Create(OutputFolderPath + @"\" + fileName, new XmlWriterSettings() { Indent = true })) { if (!fileName.IsNullOrEmptyWhitespace()) { xmlDoc.Save(writer); } } } catch (ValidationException ex) { //Catch any validation exceptions var validationMessages = ex.GetMessagesString(); //Handle any validation errors as appropriate. throw; } return(xmlDoc); }
/// <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); }
/// <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 '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(); // Requester Order Identifier orderDetails.RequesterOrderIdentifier = BaseCDAModel.CreateIdentifier("1.2.36.1.2001.1005.52.8003620833333789", "10523479"); // Requester orderDetails.Requester = GenericObjectReuseSample.CreateRequester(mandatorySectionsOnly); return(orderDetails); }