Exemplo n.º 1
0
        /// <summary>
        /// Hl7 Message Validation. Validate the hl7Message using the given xmlProfile.
        /// </summary>
        /// <param name="xmlProfile">HL7 Conformance Profile - encoded as XML.</param>
        /// <param name="xmlValidContext">HL7 Validation Context - encoded as XML.</param>
        /// <param name="hl7Message">DVTK HL7 Message.</param>
        /// <param name="isXml">Generated messages are ER7 or XML message (true if XML, false either).</param>
        /// <param name="errorDescription">Out - error description string.</param>
        /// <returns>String - validation results XML stream.</returns>
        public System.String Validate(System.String xmlProfile, System.String xmlValidContext, System.String hl7Message, System.Boolean isXml, out System.String errorDescription)
        {
            System.String validationResultsXmlStream = System.String.Empty;
            errorDescription = System.String.Empty;

            Dvtk.IheActors.Hl7.WebService.Validation.setProfile         profile         = new Dvtk.IheActors.Hl7.WebService.Validation.setProfile();
            Dvtk.IheActors.Hl7.WebService.Validation.setProfileResponse profileResponse = new Dvtk.IheActors.Hl7.WebService.Validation.setProfileResponse();
            profile.param0  = xmlProfile;
            profileResponse = _hl7MessageValidation.setProfile(profile);
            if (profileResponse.@return != true)
            {
                errorDescription = GetErrorDescriptionValidation("_hl7MessageValidation.setProfile(profile)");
            }
            else
            {
                Dvtk.IheActors.Hl7.WebService.Validation.setMessage         msg         = new Dvtk.IheActors.Hl7.WebService.Validation.setMessage();
                Dvtk.IheActors.Hl7.WebService.Validation.setMessageResponse msgResponse = new Dvtk.IheActors.Hl7.WebService.Validation.setMessageResponse();
                msg.param0 = hl7Message;
                msg.param1 = isXml;

                msgResponse = _hl7MessageValidation.setMessage(msg);
                if (msgResponse.@return != true)
                {
                    errorDescription = GetErrorDescriptionValidation("_hl7MessageValidation.setMessage(msg)");
                }
                else
                {
                    Dvtk.IheActors.Hl7.WebService.Validation.setValidationContext         validContext         = new Dvtk.IheActors.Hl7.WebService.Validation.setValidationContext();
                    Dvtk.IheActors.Hl7.WebService.Validation.setValidationContextResponse validContextResponse = new Dvtk.IheActors.Hl7.WebService.Validation.setValidationContextResponse();
                    validContext.param0  = xmlValidContext;
                    validContextResponse = _hl7MessageValidation.setValidationContext(validContext);
                    if (validContextResponse.@return != true)
                    {
                        errorDescription = GetErrorDescriptionValidation("_hl7MessageValidation.setValidationContext(validContext)");
                    }
                    else
                    {
                        Dvtk.IheActors.Hl7.WebService.Validation.validate         val         = new Dvtk.IheActors.Hl7.WebService.Validation.validate();
                        Dvtk.IheActors.Hl7.WebService.Validation.validateResponse valResponse = new Dvtk.IheActors.Hl7.WebService.Validation.validateResponse();
                        valResponse = _hl7MessageValidation.validate(val);
                        // validate() returns if the message is valid or not (and not if the method was well executed or not)
                        if (valResponse.@return != true)
                        {
                            errorDescription = GetErrorDescriptionValidation("_hl7MessageValidation.validate(val)");
                        }

                        Dvtk.IheActors.Hl7.WebService.Validation.getValidationReport         valReport         = new Dvtk.IheActors.Hl7.WebService.Validation.getValidationReport();
                        Dvtk.IheActors.Hl7.WebService.Validation.getValidationReportResponse valReportResponse = new Dvtk.IheActors.Hl7.WebService.Validation.getValidationReportResponse();
                        valReportResponse = _hl7MessageValidation.getValidationReport(valReport);
                        if (valReportResponse.@return != null)
                        {
                            validationResultsXmlStream = valReportResponse.@return;
                        }
                        else
                        {
                            errorDescription = GetErrorDescriptionValidation("_hl7MessageValidation.getValidationReport(valReport)");
                        }
                    }
                }
            }

            return(validationResultsXmlStream);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Hl7 Message Validation. Validate the hl7Message using the given xmlProfile.
        /// </summary>
        /// <param name="xmlProfile">HL7 Conformance Profile - encoded as XML.</param>
        /// <param name="xmlValidContext">HL7 Validation Context - encoded as XML.</param>
        /// <param name="hl7Message">DVTK HL7 Message.</param>
        /// <param name="isXml">Generated messages are ER7 or XML message (true if XML, false either).</param>
        /// <param name="errorDescription">Out - error description string.</param>
        /// <returns>String - validation results XML stream.</returns>
        public System.String Validate(System.String xmlProfile, System.String xmlValidContext, System.String hl7Message, System.Boolean isXml, out System.String errorDescription)
        {
            System.String validationResultsXmlStream = System.String.Empty;
            errorDescription = System.String.Empty;

            Dvtk.IheActors.Hl7.WebService.Validation.setProfile profile = new Dvtk.IheActors.Hl7.WebService.Validation.setProfile();
            Dvtk.IheActors.Hl7.WebService.Validation.setProfileResponse profileResponse = new Dvtk.IheActors.Hl7.WebService.Validation.setProfileResponse();
            profile.param0 = xmlProfile;
            profileResponse = _hl7MessageValidation.setProfile(profile);
            if (profileResponse.@return != true)
            {
                errorDescription = GetErrorDescriptionValidation("_hl7MessageValidation.setProfile(profile)");
            }
            else
            {
                Dvtk.IheActors.Hl7.WebService.Validation.setMessage msg = new Dvtk.IheActors.Hl7.WebService.Validation.setMessage();
                Dvtk.IheActors.Hl7.WebService.Validation.setMessageResponse msgResponse = new Dvtk.IheActors.Hl7.WebService.Validation.setMessageResponse();
                msg.param0 = hl7Message;
                msg.param1 = isXml;

                msgResponse = _hl7MessageValidation.setMessage(msg);
                if (msgResponse.@return != true)
                {
                    errorDescription = GetErrorDescriptionValidation("_hl7MessageValidation.setMessage(msg)");
                }
                else
                {
                    Dvtk.IheActors.Hl7.WebService.Validation.setValidationContext validContext = new Dvtk.IheActors.Hl7.WebService.Validation.setValidationContext();
                    Dvtk.IheActors.Hl7.WebService.Validation.setValidationContextResponse validContextResponse = new Dvtk.IheActors.Hl7.WebService.Validation.setValidationContextResponse();
                    validContext.param0 = xmlValidContext;
                    validContextResponse = _hl7MessageValidation.setValidationContext(validContext);
                    if (validContextResponse.@return != true)
                    {
                        errorDescription = GetErrorDescriptionValidation("_hl7MessageValidation.setValidationContext(validContext)");
                    }
                    else
                    {
                        Dvtk.IheActors.Hl7.WebService.Validation.validate val = new Dvtk.IheActors.Hl7.WebService.Validation.validate();
                        Dvtk.IheActors.Hl7.WebService.Validation.validateResponse valResponse = new Dvtk.IheActors.Hl7.WebService.Validation.validateResponse();
                        valResponse = _hl7MessageValidation.validate(val);
                        // validate() returns if the message is valid or not (and not if the method was well executed or not)
                        if (valResponse.@return != true)
                        {
                            errorDescription = GetErrorDescriptionValidation("_hl7MessageValidation.validate(val)");
                        }

                        Dvtk.IheActors.Hl7.WebService.Validation.getValidationReport valReport = new Dvtk.IheActors.Hl7.WebService.Validation.getValidationReport();
                        Dvtk.IheActors.Hl7.WebService.Validation.getValidationReportResponse valReportResponse = new Dvtk.IheActors.Hl7.WebService.Validation.getValidationReportResponse();
                        valReportResponse = _hl7MessageValidation.getValidationReport(valReport);
                        if (valReportResponse.@return != null)
                        {
                            validationResultsXmlStream = valReportResponse.@return;
                        }
                        else
                        {
                            errorDescription = GetErrorDescriptionValidation("_hl7MessageValidation.getValidationReport(valReport)");
                        }
                    }
                }
            }

            return validationResultsXmlStream;
        }