public void GetHealthRecordOverview() { //Get Certificate and Header objects CertAndHeaderInfo CertAndHeaderInfo = Support.CertAndHeaderFactory.Get( certSerial: "06fba6", serialHPIO: "8003629900019338", patientType: Support.PatientType.CalebDerrington); // Obtain the certificate for use with TLS and signing X509Certificate2 cert = CertAndHeaderInfo.Certificate; // Create PCEHR header CommonPcehrHeader header = CertAndHeaderInfo.Header; // Instantiate the client // SVT endpoint is "https://b2b.ehealthvendortest.health.gov.au/getView" // production endpoint is "https://services.ehealth.gov.au/getView" GetViewClient getViewClient = new GetViewClient(new Uri("https://b2b.ehealthvendortest.health.gov.au/getView"), cert, cert); // Add server certificate validation callback ServicePointManager.ServerCertificateValidationCallback += Support.CertificateHelper.ValidateServiceCertificate; try { getView request = new getView() { // Creates a healthRecordOverView view = new healthRecordOverView() { clinicalSynopsisLength = 200, // versionNumber can be found in the "PCEHR View Service - Technical Service Specification" via // https://digitalhealth.gov.au/implementation-resources/national-infrastructure/EP-2109-2015 // If the specification doesn't specify the version number then it is 1.0 versionNumber = "1.1" } }; var responseStatus = getViewClient.GetView(header, request); // Get the soap request and response string soapRequest = getViewClient.SoapMessages.SoapRequest; string soapResponse = getViewClient.SoapMessages.SoapResponse; // Convert XML response into Class for healthRecordOverview XmlDocument xml = new XmlDocument(); xml.PreserveWhitespace = true; xml.LoadXml(Encoding.Default.GetString(responseStatus.view.data)); healthRecordOverviewResponse data = new healthRecordOverviewResponse(); data = (healthRecordOverviewResponse)DeserialiseElementToClass(xml.DocumentElement, data); } catch (FaultException fex) { // Handle any errors } }
public void SampleForHroResponse() { // Obtain the certificate for use with TLS and signing X509Certificate2 cert = X509CertificateUtil.GetCertificate( "06fba6", X509FindType.FindBySerialNumber, StoreName.My, StoreLocation.CurrentUser, true ); // Create PCEHR header CommonPcehrHeader header = PcehrHeaderHelper.CreateHeader(); // Instantiate the client // SVT endpoint is "https://b2b.ehealthvendortest.health.gov.au/getView" // production endpoint is "https://services.ehealth.gov.au/getView" GetViewClient getViewClient = new GetViewClient(new Uri("https://b2b.ehealthvendortest.health.gov.au/getView"), cert, cert); // Add server certificate validation callback ServicePointManager.ServerCertificateValidationCallback += ValidateServiceCertificate; try { getView request = new getView() { // Creates a healthRecordOverView view = new healthRecordOverView() { clinicalSynopsisLength = 200, // versionNumber can be found in the "PCEHR View Service - Technical Service Specification" via // https://digitalhealth.gov.au/implementation-resources/national-infrastructure/EP-2109-2015 // If the specification doesn't specify the version number then it is 1.0 versionNumber = "1.2" } }; var responseStatus = getViewClient.GetView(header, request); // Convert XML response into Class for healthRecordOverview XmlDocument xml = new XmlDocument(); xml.PreserveWhitespace = true; xml.LoadXml(Encoding.Default.GetString(responseStatus.view.data)); healthRecordOverviewResponse data = new healthRecordOverviewResponse(); data = (healthRecordOverviewResponse)DeserialiseElementToClass(xml.DocumentElement, data); // Get the soap request and response string soapRequest = getViewClient.SoapMessages.SoapRequest; string soapResponse = getViewClient.SoapMessages.SoapResponse; } catch (FaultException fex) { // Handle any errors } }