<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
[
<!ENTITY patientLite SYSTEM 	"classpath://gov/va/med/cds/persistence/hibernate/common/PatientLite.hbm">
<!ENTITY author SYSTEM 				"classpath://gov/va/med/cds/persistence/hibernate/common/AuthorPractitionerParticipation.hbm">
<!ENTITY errorEnterer SYSTEM 			"classpath://gov/va/med/cds/persistence/hibernate/common/ErrorEntererPractitionerParticipation.hbm">
]
>

<hibernate-mapping default-lazy="false" default-cascade="all">
    <class entity-name="vitalSignsCreate40020" table="VITAL30_V" lazy="false" node="vitalSignObservationEvents">
       <id type="java.lang.Long" name="id">
            <column name="VITAL_ID" />
            <generator class="sequence" >
				<param name="sequence">vital_seq_id</param>
			</generator>
        </id>

        <component name="recordIdentifier" node="recordIdentifier">
			<property name="identity" column="RECORDIDENTIFIER_IDENTITY" type="java.lang.String" node="identity" />
			<property name="namespaceId" column="RECORDIDENTIFIER_NAMESPACEID" type="java.lang.String" node="namespaceId" />
			<property name="universalId" column="RECORDIDENTIFIER_UNIVERSALID" type="java.lang.String" node="universalId" />
			<property name="universalIdType" column="RECORDIDENTIFIER_UNIVERSTYP" type="java.lang.String" node="universalIdType" />
		</component>

		<!-- import from .../common/PatientLite.hbm -->
		&patientLite;

        <component name="observationTime" node="observationTime">
          <property name="literal" type="gov.va.med.cds.persistence.hibernate.common.Dom4jPointInTimeUserType" node="literal" >
            <column name="VITAL_OBSERVATION_TM"/>
            <column name="VITAL_OBSERVATION_TM_NBR"/>
          </property>
        </component>			

        <component name="observationMethod" node="observationMethod">
			<property name="code" column="OBSERVATION_METHOD_CODE" type="java.lang.String" node="code" />
			<property name="displayText" column="OBSERVATION_METHOD_DSPLYTXT" type="java.lang.String" node="displayText" />
			<property name="codingSystem" column="OBSERVATION_METHOD_CODSYS" type="java.lang.String" node="codingSystem" />
		</component>

        <component name="observedCharacteristic" node="observedCharacteristic">
			<property name="code" column="OBSERVED_CHAR_CODE" type="java.lang.String" node="code" />
			<property name="displayText" column="OBSERVED_CHAR_DSPLYTXT" type="java.lang.String" node="displayText" />
			<property name="codingSystem" column="OBSERVED_CHAR_CODSYS" type="java.lang.String" node="codingSystem" />
		</component>

		<component name="collectionSessionTime" node="collectionSessionTime">
          <property name="literal" type="gov.va.med.cds.persistence.hibernate.common.Dom4jPointInTimeUserType" node="literal" >
            <column name="COLLECTION_SESSION_TM"/>
            <column name="COLLECTION_SESSION_TM_NBR"/>
          </property>
        </component>			
		

		<property name="status" column="VITAL_STATUS" type="java.lang.String" node="status" />

		<component name="supplementalOxygen" node="supplementalOxygen"> 
			<property name="flowRateValue" column="FLOW_RATE_VAL" type="java.lang.String" node="flowRateValue" />
	        <component name="flowRateUnit" node="flowRateUnit">
				<property name="code" column="FLOW_RATE_UOFM_CODE" type="java.lang.String" node="code" />
				<property name="displayText" column="FLOW_RATE_UOFM_DSPLYTXT" type="java.lang.String" node="displayText" />
				<property name="codingSystem" column="FLOW_RATE_UOFM_CODSYS" type="java.lang.String" node="codingSystem" />
			</component> 
			<property name="concentrationValue" column="CONCENTRATION_VAL" type="java.lang.String" node="concentrationValue" />
	        <component name="concentrationUnit" node="concentrationUnit">
				<property name="code" column="CONCENTRATION_UOFM_CODE" type="java.lang.String" node="code" />
				<property name="displayText" column="CONCENTRATION_UOFM_DSPLYTXT" type="java.lang.String" node="displayText" />
				<property name="codingSystem" column="CONCENTRATION_UOFM_CODSYS" type="java.lang.String" node="codingSystem" />
			</component>        
        </component>

		<!-- import from .../common/AuthorPractitionerParticipation.hbm -->
		&author;

		<component name="homeTelehealthMonitor" node="homeTelehealthMonitor"> 
 			<property name="hthVendor" column="HTH_VENDOR" type="java.lang.String" node="vendor" />
	 		<property name="hthHomeAppliance" column="HTH_HOME_APPL" type="java.lang.String" node="homeAppliance" />
 			<property name="hthMeasurementDevice" column="HTH_MEASURE_DEVICE" type="java.lang.String" node="measurementDevice" />
        </component>

        <component name="hospitalLocationIdentifier" node="hospitalLocationIdentifier">
			<property name="pointOfCare" column="HOSPITAL_LOC_POINT_OF_CARE" type="java.lang.String" node="pointOfCare" />
			<property name="room" column="HOSPITAL_LOC_ROOM" type="java.lang.String" node="room" />
			<property name="bed" column="HOSPITAL_LOC_BED" type="java.lang.String" node="bed" />
			<property name="facilityNamespaceId" column="HOSPITAL_LOC_FCLTY_NMSPCID" type="java.lang.String" node="facilityNamespaceId" />
			<property name="facilityUniversalId" column="HOSPITAL_LOC_FCLTY_UNVSID" type="java.lang.String" node="facilityUniversalId" />
			<property name="facilityUniversalIdType" column="HOSPITAL_LOC_FCLTY_UNVSIDTYP" type="java.lang.String" node="facilityUniversalIdType" />
			<property name="personLocationType" column="HOSPITAL_LOC_PERS_LOC_TYP" type="java.lang.String" node="personLocationType" />
			<property name="locationDescription" column="HOSPITAL_LOC_DESCRIPTION" type="java.lang.String" node="locationDescription" />
		</component>

        <component name="division" node="division">
			<property name="code" column="DIVISION_CODE" type="java.lang.String" node="code" />
			<property name="displayText" column="DIVISION_DSPLYTXT" type="java.lang.String" node="displayText" />
			<property name="codingSystem" column="DIVISION_CODSYS" type="java.lang.String" node="codingSystem" />
		</component>

        <component name="orderingFacilityIdentifier" node="orderingFacilityIdentifier">
			<property name="identity" column="ORD_FCLTY_IDENTITY" type="java.lang.String" node="identity" />
			<property name="name" column="ORD_FCLTY_NAME" type="java.lang.String" node="name" />
			<property name="assigningAuthority" column="ORD_FCLTY_ASSIGNING_AUTHORITY" type="java.lang.String" node="assigningAuthority" />
		</component>

        <component name="stopCode" node="stopCode">
			<property name="code" column="STOP_CODE" type="java.lang.String" node="code" />
			<property name="displayText" column="STOP_DSPLYTXT" type="java.lang.String" node="displayText" />
			<property name="codingSystem" column="STOP_CODSYS" type="java.lang.String" node="codingSystem" />
		</component>

		<!--  one-to-many set -->
		<list name="observationQualifiers" node="vitalSignObservation">
			<key column="VITAL_ID" update="false" />
			<list-index column="LINE_NBR"  />
			<one-to-many entity-name="VitalSignQualifier" node="qualifier" embed-xml="true" />
		</list>

		<component name="observationValue" node="vitalSignObservation//value">
			<property name="value" column="OBSERVATION_VAL" type="java.lang.String" node="." />
		</component>

        <component name="observationUnitOfMeasureCode" node="vitalSignObservation//unit">
			<property name="code" column="OBSERVATION_UOFM_CODE" type="java.lang.String" node="code" />
			<property name="displayText" column="OBSERVATION_UOFM_DSPLYTXT" type="java.lang.String" node="displayText" />
			<property name="codingSystem" column="OBSERVATION_UOFM_CODSYS" type="java.lang.String" node="codingSystem" />
		</component>

		<!-- import from .../common/ErrorEntererPractitionerParticipation.hbm -->
		&errorEnterer;

		<!--  one-to-many set -->
		<list name="errorReasons" node=".">
			<key column="VITAL_ID" update="false" />
			<list-index column="LINE_NBR"  />
			<one-to-many entity-name="ErrorReason" node="errorReason"/>
		</list>

        <component name="recordSource" node="recordSource">
			<property name="namespaceId" column="RECORDSOURCE_NAMESPACEID" type="java.lang.String" node="namespaceId" />
			<property name="universalId" column="RECORDSOURCE_UNIVERSALID" type="java.lang.String" node="universalId" />
			<property name="universalIdType" column="RECORDSOURCE_UNIVERSTYP" type="java.lang.String" node="universalIdType" />
		</component>
		
		<property name="recordVersion" column="RECORD_VERSION" type="integer" node="recordVersion" />
		
        <component name="recordUpdateTime" node="recordUpdateTime">
          <property name="literal" type="gov.va.med.cds.persistence.hibernate.common.Dom4jPointInTimeUserType" node="literal" >
            <column name="RECORD_UPDATE_TM"/>
            <column name="RECORD_UPDATE_TM_NBR"/>
          </property>
        </component>			

		<property name="requestId" column="REQUEST_ID" type="java.lang.String" node="requestId" />

    </class>

</hibernate-mapping>
