Package ke.go.moh.oec.pisinterfaces.util

Examples of ke.go.moh.oec.pisinterfaces.util.SiteException


    protected String addStyleSheet(StringBuffer cda) throws SiteException {
        // This points to the CDA XSL style sheet served from the root resources dir
        String stylelink = "<?xml-stylesheet type='text/xsl' href='xsl/WebViewLayout_CDA.xsl'?>";
        if (cda.length() < 1 || cda.indexOf(">") < 0) {
            // CDA doesn't look like XML, raise
            throw new SiteException("Invalid document", null);
        }
        // Insert the style sheet element immediately following the xml header
        int endOfHeader = cda.indexOf(">");
        int i = cda.indexOf("<?xml-stylesheet", endOfHeader);
        if (i < 0) {
View Full Code Here


        try {
            InputStream in = JavaToXML.getPropertiesFile("config.properties");
            props.load(in);
            in.close();
        } catch (IOException ex) {
            throw new SiteException("Unable to access configuration file", ex);
        }

        String stringUrl = props.getProperty("urlMirth");
        String s = JavaToXML.objectToXml(patientId);
        log.info("Message to send : \n" + s);
        URL url;
        try {
            url = new URL(stringUrl);
        } catch (MalformedURLException ex) {
            throw new SiteException("Mailformed URL from property `urlMirth`", ex);
        }
        URLConnection conn;
        try {
            conn = url.openConnection();
            conn.setDoOutput(true);
            OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
            wr.write("query=" + s);
            wr.flush();
            wr.close();
        } catch (IOException ex) {
            throw new SiteException("External CDA Query client unavailable", ex);
        }

        CdaQueryResult cdaQueryResult = new CdaQueryResult();
        try {
            return cdaQueryResult.parseDocument(conn.getInputStream());
        } catch (IOException ex) {
            throw new SiteException("Unable to parse CdaQuery result", ex);
        }
    }
View Full Code Here

TOP

Related Classes of ke.go.moh.oec.pisinterfaces.util.SiteException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.