Ejemplo n.º 1
0
        public void Generate()
        {
            var systemName = "";
            var userId = "";
            var userFullName = "";
            var oidInstitution = "";
            var institutionName = "";
            var documentId = "";
            var documentName = "";
            var confidentialityCode = "";
            var date = DateTime.Now;

            var person = new Person();
            var doctor = new Doctor();

            var xdoc = CdaHelper.CreateCda();

            CdaHelper.UpdateHeader(xdoc, OidSystemDocuments, documentId, documentName, date, confidentialityCode);
            CdaHelper.UpdatePatient(xdoc, OidSystemPatients, person);
            CdaHelper.UpdateAuthor(xdoc, OidSystemUsers, doctor, date, oidInstitution, institutionName);
            CdaHelper.UpdateSoftware(xdoc, date, OidSystemInstance, systemName, oidInstitution, institutionName);
            CdaHelper.UpdateDataEnterer(xdoc, date, OidSystemUsers, userId, userFullName);
            CdaHelper.UpdateCustodian();
            CdaHelper.UpdateInformationRecipient();
            CdaHelper.UpdateLegalAuthenticator();
            CdaHelper.UpdateAuthenticator();
            CdaHelper.UpdateInFulfillmentOf();
            CdaHelper.UpdateComponent();
            CdaHelper.UpdateComponentOf();
        }
Ejemplo n.º 2
0
        public void GenerateResponse()
        {
            #region

            // Header
            string   systemDocumentId   = "systemDocumentId";
            string   systemDocumentName = "systemDocumentName";
            DateTime headerDateTime     = DateTime.Now;

            // Patient
            string   patientId = "patientId";
            string   patientNationalIdentityCode = "patientNationalIdentityCode";
            string   patientStreet            = "patientStree";
            string   patientExtrenalNumber    = "patientExtrenalNumber";
            string   patientInternalNumber    = "patientInternalNumber";
            string   patientNeighborhood      = "patientNeighborhood";
            string   patientMunicipality      = "patientMunicipality";
            string   patientCity              = "patientCity";
            string   patientState             = "patientState";
            string   patientZipCode           = "patientZipCode";
            string   patientPhoneNumber       = "patientPhoneNumber";
            string   patientEmail             = "patientEmail";
            string   patientFirstName         = "patientFirstName";
            string   patientLastName          = "patientLastName";
            string   patientSurname           = "patientSurname";
            string   patientGender            = "patientGender";
            DateTime patientBirthDate         = DateTime.Now;
            string   patientCivilState        = "patientCivilState";
            string   patientReligion          = "patientReligion";
            string   patientEthnicity         = "patientEthnicity";
            string   patientBirthPlaceState   = "patientBirthPlaceState";
            string   patientBirthPlaceCountry = "patientBirthPlaceCountry";

            // Author
            string   authorDoctorId = "doctorId";
            string   authorDoctorProfessionalLicense = "doctorProfessionalLicense";
            string   authorDoctorFirstName           = "doctorFirstName";
            string   authorDoctorMiddleName          = "doctorMiddleName";
            string   authorDoctorLastName            = "doctorLastName";
            string   authorDoctorSurname             = "doctorSurname";
            string   authorOidSpecialty     = "oidSpecialty";
            string   authorSpecialtyName    = "specialtyName";
            DateTime authorDateTime         = DateTime.Now;
            string   authorOidOrganization  = "oidOrganization";
            string   authorOrganizationName = "organizationName";

            // custodian
            string oidCustodianOrganization        = "oidCustodianOrganization";
            string custodianOrganizationName       = "CustodianOrganizationName";
            string custodianOrganizationTelecom    = "CustodianOrganizationTelecom";
            string custodianOrganizationAddress    = "CustodianOrganizationAddress";
            string custodianOrganizationPrecinct   = "CustodianOrganizationPrecinct";
            string custodianOrganizationCounty     = "CustodianOrganizationCounty";
            string custodianOrganizationState      = "CustodianOrganizationState";
            string custodianOrganizationPostalCode = "CustodianOrganizationPostalCode";
            string custodianOrganizationCountry    = "CustodianOrganizationCountry";

            // ComponentOF

            string oidClinicalActs           = "oidClinicalActs";
            string clinicalActId             = "clinicalActId";
            string userId                    = "userID";
            string doctorProfessionalLicense = "doctorProfessionalLicense";
            string doctorFirstName           = "doctorFirstName";
            string doctorMiddleName          = "doctorMiddleName";
            string doctorLastName            = "doctorLastName";
            string doctorSurname             = "doctorSurname";
            string oidOrganization           = "oidOrganization";
            string organizationName          = "organizationName";
            string clues                  = "clues";
            string locationName           = "locationName";
            string organizationAddress    = "organizationAddress";
            string organizationPrecinct   = "organizationPrecinct";
            string organizationCounty     = "organizationCounty";
            string organizationState      = "organizationState";
            string organizationPostalCode = "organizationPostalCode";
            string organizationCountry    = "organizationCountry";


            // Software
            var softwareName            = "Lumed";
            var dateTime                = DateTime.Now;
            var softwareInstitutionName = "Netemedical";

            // Data Enterer
            var userFullName = "userFullName";

            // InformationRecipient
            string   recipientDoctorProfessionalLicense = "doctorProfessionalLicense";
            string   recipientDoctorFirstName           = "doctorFirstName";
            string   recipientDoctorMiddleName          = "doctorMiddleName";
            string   recipientDoctorLastName            = "doctorLastName";
            string   recipientDoctorSurname             = "doctorSurname";
            DateTime recipientDateTime        = DateTime.Now;
            string   recipientOidOrganization = "2.16.840.1.113883.3.215.6.99.5";

            string recipientOrganizationName = "organizationName";

            // UpdateLegalAuthenticator
            var oidSpecialty  = "oidSpeialty";
            var specialtyName = "specialtyName";

            // Component
            string interrogatory = "interrogatory";
            string diagnostic    = "diagnostic";
            string orders        = "orders";
            string treatmentPlan = "treatmenPlan";

            // UpdateInFulfillmentOf
            var oidOrders = "oidOrders";
            var orderId   = "orderId";

            #endregion

            var fileName = Path.GetTempFileName();
            var xdoc     = CdaHelper.CreateCda(TemplateResponse);

            if (xdoc != null)
            {
                CdaHelper.UpdateHeader(xdoc, OidSystemDocuments, systemDocumentId, systemDocumentName, headerDateTime, "N");
                CdaHelper.UpdatePatient(xdoc, OidSystemPatients, patientId, patientNationalIdentityCode, patientStreet, patientExtrenalNumber, patientInternalNumber, patientNeighborhood, patientMunicipality, patientCity, patientState, patientZipCode, patientPhoneNumber, patientEmail, patientFirstName, patientLastName, patientSurname, patientGender, patientBirthDate, patientCivilState, patientReligion, patientEthnicity, patientBirthPlaceState, patientBirthPlaceCountry);

                CdaHelper.UpdateAuthor(xdoc, OidSystemUsers, authorDoctorId, authorDoctorProfessionalLicense, authorDoctorFirstName, authorDoctorMiddleName, authorDoctorLastName, authorDoctorSurname, authorOidSpecialty, authorSpecialtyName, authorDateTime, authorOidOrganization, authorOrganizationName);

                CdaHelper.UpdateSoftware(xdoc, dateTime, OidSystemInstance, softwareName, OidInstitution, softwareInstitutionName);

                CdaHelper.UpdateDataEnterer(xdoc, dateTime, OidSystemUsers, userId, userFullName);

                CdaHelper.UpdateCustodian(xdoc, oidCustodianOrganization, custodianOrganizationName, custodianOrganizationTelecom, custodianOrganizationAddress, custodianOrganizationPrecinct, custodianOrganizationCounty, custodianOrganizationState, custodianOrganizationPostalCode, custodianOrganizationCountry);

                CdaHelper.UpdateInformationRecipient(xdoc, recipientDoctorProfessionalLicense, recipientDoctorFirstName, recipientDoctorMiddleName, recipientDoctorLastName, recipientDoctorSurname, recipientOidOrganization, recipientOrganizationName);

                CdaHelper.UpdateLegalAuthenticator(xdoc, dateTime, OidSystemUsers, userId, doctorProfessionalLicense, oidSpecialty, specialtyName, doctorFirstName, doctorMiddleName, doctorLastName, doctorSurname, oidOrganization, organizationName);

                CdaHelper.UpdateAuthenticator(xdoc, dateTime, OidSystemUsers, userId, doctorProfessionalLicense, oidSpecialty, specialtyName, doctorFirstName, doctorMiddleName, doctorLastName, doctorSurname, oidOrganization, organizationName);

                CdaHelper.UpdateInFulfillmentOf(xdoc, oidOrders, orderId);

                CdaHelper.UpdateComponent(xdoc, interrogatory, diagnostic, orders, treatmentPlan);

                CdaHelper.UpdateComponentOf(xdoc, oidClinicalActs, clinicalActId, OidSystemUsers, userId, dateTime, doctorProfessionalLicense, doctorFirstName, doctorMiddleName, doctorLastName, doctorSurname, oidOrganization, organizationName, clues, locationName, organizationAddress, organizationPrecinct, organizationCounty, organizationState, organizationPostalCode, organizationCountry);

                //Saves the file
                Console.WriteLine(fileName);
                CdaHelper.SaveCda(xdoc, fileName);
                Console.ReadLine();
            }
        }