<?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"
>

<hibernate-mapping default-lazy="false" default-cascade="all">
	<class entity-name="LabTest" table="LAB_TEST_V" lazy="false" name="gov.va.med.cds.template.generated.lab.LabTest" >
		<id name="id" type="java.lang.Long">
			<column name="LAB_TEST_ID" />
			<generator class="sequence">
				<param name="sequence">lab_test_seq_id</param>
			</generator>
		</id>

		<component name="procedureCode" class="gov.va.med.cds.template.generated.basedatatypes.HL72CodedElement">
			<property name="code" column="PROCEDURE_CODE" type="java.lang.String" />
			<property name="displayText" column="PROCEDURE_DSPLYTXT" type="java.lang.String" />
			<property name="codingSystem" column="PROCEDURE_CODSYS" type="java.lang.String" />
			<property name="alternateCode" column="PROCEDURE_ALT_CODE" type="java.lang.String" />
			<property name="alternateDisplayText" column="PROCEDURE_ALT_DSPLYTXT" type="java.lang.String" />
			<property name="alternateCodingSystem" column="PROCEDURE_ALT_CODSYS" type="java.lang.String" />
		</component>

		<component name="orderedTestCode" class="gov.va.med.cds.template.generated.basedatatypes.HL72CodedElement">
			<property name="code" column="ORDERED_TEST_CODE" type="java.lang.String" />
			<property name="displayText" column="ORDERED_TEST_DSPLYTXT" type="java.lang.String" />
			<property name="codingSystem" column="ORDERED_TEST_CODSYS" type="java.lang.String" />
			<property name="alternateCode" column="ORDERED_TEST_ALT_CODE" type="java.lang.String" />
			<property name="alternateDisplayText" column="ORDERED_TEST_ALT_DSPLYTXT" type="java.lang.String" />
			<property name="alternateCodingSystem" column="ORDERED_TEST_ALT_CODSYS" type="java.lang.String" />
		</component>

		<property name="fillerAccessionReference" column="FILLER_ACCESSION_REF" type="java.lang.String" />

		<list name="chemistryResults" cascade="all" >
			<key column="LAB_TEST_ID" not-null="true" update="false"/>
			<list-index column="LINE_NBR"  />
			<one-to-many entity-name="ChemistryResult" />
		</list>

	</class>

</hibernate-mapping>
