Esempio n. 1
0
        public static PpvsDocument CreatePpvsDocument(CdaSource cdaSource)
        {
            // *** Creates the PPVS document ***

            PpvsDocument ppvs = new PpvsDocument();

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

            ppvs.DocumentId = tempGuid.ToString();

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

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

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

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

            // *** Participants ***
            ppvs.Participants = CdaSectionFactory.CreateParticipants(cdaSource.VprData);

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

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

            // *** History of Present Illness ***
            ppvs.HistoryOfPresentIllness = CdaSectionFactory.CreatePresentIllnessSection(cdaSource.Observations);

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

            // *** Coded Social History ***
            ppvs.SocialHistory = CdaSectionFactory.CreateSocialHistorySection(cdaSource.Observations);

            // *** Coded Physical Exam ***
            ppvs.PhysicalExam            = CdaSectionFactory.CreatePhysicalExamSection(cdaSource.Observations);
            ppvs.PhysicalExam.VitalSigns = CdaSectionFactory.CreateVitalsSubSection(cdaSource.VprData);

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

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

            // *** Care Plans ***
            ppvs.CarePlanSection = CdaSectionFactory.CreateCarePlanSection(cdaSource.Observations);

            // *** Newborn Status ***
            ppvs.NewbornStatusSections = CdaSectionFactory.CreateNewbornStatusSections(cdaSource.Observations);

            // *** Newborn Care Plan ***
            ppvs.NewbornCarePlanSections = CdaSectionFactory.CreateNewbornCarePlanSections(cdaSource.Observations);

            // *** Newborn Delivery Info ***
            ppvs.NewbornDeliveryInfoSections = CdaSectionFactory.CreateNewbornDeliveryInfoSections(cdaSource.Observations);

            // *** Labor & Delivery Events ***
            ppvs.LaborDeliveryEvents = CdaSectionFactory.CreateLaborDeliverySection(cdaSource.Observations);

            // *** Postpartum Hospitalization Treatment ***
            ppvs.PostpartumHospitalizationTreatment = CdaSectionFactory.CreatePostpartumHospitalizationTreatmentSection(cdaSource.Observations);

            return(ppvs);
        }