public static CdaAllergy CreateLatexAllergy(List <Observation> list)
        {
            CdaAllergy returnVal = null;

            Observation latexObs = list.FirstOrDefault(o => o.Code == "300916003");

            if (latexObs != null)
            {
                returnVal = new CdaAllergy();

                if (latexObs.Negation)
                {
                    returnVal.AllergyText = "NO Latex Allergy";
                }
                else
                {
                    returnVal.AllergyText = "Latex Allergy";
                }

                returnVal.EffectiveTime = new CdaEffectiveTime()
                {
                    Low = latexObs.EntryDate
                };

                returnVal.Id = Guid.NewGuid().ToString();
                returnVal.IntoleranceType   = Hl7ObservationIntoleranceType.Allergy;
                returnVal.Status            = CdaConcernStatus.Actve;
                returnVal.Substance         = "Latex";
                returnVal.NegationIndicator = latexObs.Negation;
                returnVal.Value             = new CdaCode()
                {
                    Code        = "300916003",
                    CodeSystem  = CodingSystem.SnomedCT,
                    DisplayName = "Latex Allergy"
                };
            }

            return(returnVal);
        }
Ejemplo n.º 2
0
        public static AphpDocument CreateAphpDocument(CdaSource source)
        {
            // *** Creates the APHP document ***

            AphpDocument aphp = new AphpDocument();

            // *** Set id ***
            Guid tempGuid = new Guid(source.DocumentId);

            aphp.DocumentId = tempGuid.ToString();

            // *** Create Record Target Section ***
            aphp.RecordTarget = CdaSectionFactory.CreateRecordTarget(source.VprData.Demographics);

            // *** Add provider organization to record target ***
            aphp.RecordTarget.ProviderOrganization = CdaSectionFactory.CreateProviderOrganization(source.VprData.Demographics, source.ProviderOrganizationPhone);

            // *** Create Device Author ***
            // TODO: Skip device author...?
            //aphp.DeviceAuthor = new CdaDeviceAuthor();
            //aphp.DeviceAuthor.AssignedAuthoringDevice.ManufacturerModelName = source.ManufacturerModelName;
            //aphp.DeviceAuthor.AssignedAuthoringDevice.SoftwareName = source.SoftwareName;

            // *** Create Author ***
            aphp.Author = CdaSectionFactory.CreateAuthor(source.VprData);

            // *** Information Recipient ***
            aphp.Recipient              = new CdaRecipient();
            aphp.Recipient.FirstName    = source.Options.IntendedRecipientFirstName;
            aphp.Recipient.LastName     = source.Options.IntendedRecipientLastName;
            aphp.Recipient.Organization = source.Options.IntendedRecipientOrganization;

            // *** Participants ***
            aphp.Participants = CdaSectionFactory.CreateParticipants(source.VprData);

            // *** Custodian ***
            aphp.Custodian = CdaSectionFactory.CreateCustodian(aphp.RecordTarget.ProviderOrganization);

            // *** Documentation Of ***
            aphp.DocumentationOf = CdaSectionFactory.CreateDocumentationOf();

            // *** Chief Complaint ***
            aphp.ChiefComplaint = CdaSectionFactory.CreateChiefComplaintSection(source.Observations);

            // *** History of Present Illness ***
            aphp.HistoryOfPresentIllness = CdaSectionFactory.CreatePresentIllnessSection(source.Observations);

            // *** History of Past Illness ***
            ValueSet vs;

            if (source.ValueSets.TryGetValue(ValueSetType.HistoryOfPastIllness, out vs))
            {
                aphp.HistoryOfPastIllness = CdaSectionFactory.CreatePastIllnessSection(source.Observations, (HistoryOfPastIllnessValueSet)vs);
            }

            // *** Coded History of Infection ***
            if (source.ValueSets.TryGetValue(ValueSetType.HistoryOfInfection, out vs))
            {
                aphp.CodedHistoryOfInfection = CdaSectionFactory.CreateHistoryOfInfectionSection(source.Observations, (HistoryOfInfectionValueSet)vs);
            }

            // *** Allergies ***
            aphp.Allergies = CdaSectionFactory.CreateAllergiesSection(source.VprData.Reactions);

            CdaAllergy latexAllergy = CdaObservationFactory.CreateLatexAllergy(source.Observations);

            if (latexAllergy != null)
            {
                aphp.Allergies.Allergies.Add(latexAllergy);
            }

            // *** Pregnancy History ***
            aphp.PregnancyHistorySection = CdaSectionFactory.CreatePregnancyHistorySection(source.Observations, source.Patient.Pregnant, source.Pregnancies);

            // *** Coded Social History ***
            aphp.SocialHistory = CdaSectionFactory.CreateSocialHistorySection(source.Observations);

            // *** Coded Family Medical History ***
            if (source.ValueSets.TryGetValue(ValueSetType.AntepartumFamilyHistory, out vs))
            {
                aphp.FamilyMedicalHistory = CdaSectionFactory.CreateFamilyHistorySection(source.Observations, vs);
            }

            // *** Review of Systems (+ Menstrual History) ***
            if (source.ValueSets.TryGetValue(ValueSetType.MenstrualHistory, out vs))
            {
                aphp.ReviewOfSystems = CdaSectionFactory.CreateReviewOfSystemsSection(source.Observations, vs);
            }

            // *** Coded Physical Exam ***
            aphp.PhysicalExam = CdaSectionFactory.CreatePhysicalExamSection(source.Observations);

            aphp.PhysicalExam.VitalSigns = CdaSectionFactory.CreateVitalsSubSection(source.VprData);

            return(aphp);
        }
Ejemplo n.º 3
0
        public static ApsDocument CreateApsDocument(CdaSource cdaSource)
        {
            // *** Creates the APS document ***

            ApsDocument aps = new ApsDocument();

            // *** Set id ***
            Guid tempGuid = new Guid(cdaSource.DocumentId);

            aps.DocumentId = tempGuid.ToString();

            // *** Create Record Target Section ***
            aps.RecordTarget = CdaSectionFactory.CreateRecordTarget(cdaSource.VprData.Demographics);

            // *** Add provider organization to record target ***
            aps.RecordTarget.ProviderOrganization = CdaSectionFactory.CreateProviderOrganization(cdaSource.VprData.Demographics, cdaSource.ProviderOrganizationPhone);

            // *** Create Author ***
            aps.Author = CdaSectionFactory.CreateAuthor(cdaSource.VprData);

            // *** Information Recipient ***
            aps.Recipient              = new CdaRecipient();
            aps.Recipient.FirstName    = cdaSource.Options.IntendedRecipientFirstName;
            aps.Recipient.LastName     = cdaSource.Options.IntendedRecipientLastName;
            aps.Recipient.Organization = cdaSource.Options.IntendedRecipientOrganization;

            // *** Participants ***
            //aphp.Participants = CreateParticipants(cdaSource.VprData);

            // *** Custodian ***
            aps.Custodian = CdaSectionFactory.CreateCustodian(aps.RecordTarget.ProviderOrganization);

            // *** Documentation Of ***
            aps.DocumentationOf = CdaSectionFactory.CreateDocumentationOf();

            // *** Allergies ***
            aps.Allergies = CdaSectionFactory.CreateAllergiesSection(cdaSource.VprData.Reactions);

            CdaAllergy latexAllergy = CdaObservationFactory.CreateLatexAllergy(cdaSource.Observations);

            if (latexAllergy != null)
            {
                aps.Allergies.Allergies.Add(latexAllergy);
            }

            // *** Advance Directves ***
            aps.AdvanceDirectiveSection = CdaSectionFactory.CreateAdvanceDirectivesSection(cdaSource.Observations);

            // *** Care Plan ***
            aps.CarePlanSection = CdaSectionFactory.CreateApsCarePlanSection(cdaSource.Observations);

            // *** Problems ***
            aps.ProblemsSection = CdaSectionFactory.CreateProblemsSection(cdaSource.Observations, cdaSource.VprData.Problems);

            // *** Meds ***
            aps.MedicationsSection = CdaSectionFactory.CreateMedicationSection(cdaSource.VprData.Meds);

            // *** EDD ***
            aps.EstimatedDeliveryDatesSection = CdaSectionFactory.CreateEddSection(cdaSource.Observations);

            // *** Antepartum Visit Summary ***
            aps.AntepartumVisitSummarySection = CdaSectionFactory.CreateVisitSummarySection(cdaSource.Observations);

            return(aps);
        }