au.gov.nehta.vendorlibrary.pcehr.clients.common.util
Class MetadataUtils

java.lang.Object
  extended by au.gov.nehta.vendorlibrary.pcehr.clients.common.util.MetadataUtils

public final class MetadataUtils
extends java.lang.Object

Metadata utilities.


Method Summary
static byte[] calculateSha1Hash(byte[] value)
          Calculates SHA-1 hash from a byte array.
static java.util.Date parseDate(java.lang.String str)
           
static DocumentMetadata toDocumentMetadata(au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader commonHeader, byte[] cdaDocument)
          Helper method used to construct a DocumentMetadata object.
static DocumentMetadata toDocumentMetadata(au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader commonHeader, org.w3c.dom.Document rootDocument)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

calculateSha1Hash

public static byte[] calculateSha1Hash(byte[] value)
Calculates SHA-1 hash from a byte array.

Parameters:
value - Input byte array.
Returns:
SHA-1 hash.

toDocumentMetadata

public static DocumentMetadata toDocumentMetadata(au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader commonHeader,
                                                  byte[] cdaDocument)
                                           throws javax.xml.parsers.ParserConfigurationException,
                                                  java.io.IOException,
                                                  org.xml.sax.SAXException,
                                                  javax.xml.xpath.XPathExpressionException
Helper method used to construct a DocumentMetadata object.

Parameters:
commonHeader - PCEHR request common header.
cdaDocument - CDA root document.
Returns:
DocumentMetadata populated.
Throws:
javax.xml.parsers.ParserConfigurationException - Thrown in the event
java.io.IOException
org.xml.sax.SAXException
javax.xml.xpath.XPathExpressionException

toDocumentMetadata

public static DocumentMetadata toDocumentMetadata(au.net.electronichealth.ns.pcehr.xsd.common.commoncoreelements._1.PCEHRHeader commonHeader,
                                                  org.w3c.dom.Document rootDocument)
                                           throws javax.xml.xpath.XPathExpressionException
Throws:
javax.xml.xpath.XPathExpressionException

parseDate

public static java.util.Date parseDate(java.lang.String str)