<?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="labCommentEvents" table="VISTA_HDSI.LAB_X_CHEM_HEMX_COMMENT_63_041" lazy="false" node="labCommentEvents">

		<id name="id" type="java.lang.String">
			<column name="ROWID"/>
			<generator class="assigned"/>
		</id>

		<property name="subChemHemToxRiaSerEtc" column="SUB_CHEM_HEM_TOX_RIA_SER_etc_" type="java.lang.String"/>
		<component name="labCommentEvent" node="labCommentEvent">
			<component name="comments" node="comments">
				<property name="comment" column="COMMENT" type="java.lang.String" node="comment"/>
			</component>
		</component>
	</class>

	<!-- Patient Query -->
	<query name="LabChemHemRead1.LabTestPromise.labCommentEvents"> 
		<![CDATA[
		    select lce
			from labTestPromise lab, labCommentEvents lce
		 	where lab.labData in (select laboratoryReference from patient where id in (:pids) ) and lab.id = lce.subChemHemToxRiaSerEtc 
		]]>
	</query>

	<!-- Patient Query -->
	<query name="LabChemHemRead1.LabTestPromise.labCommentEvents.date"> 
		<![CDATA[
		    select lce
			from labTestPromise lab, labCommentEvents lce
		 	where lab.labData in (select laboratoryReference from patient where id in (:pids) ) and lab.id = lce.subChemHemToxRiaSerEtc
		 	and lab.specimen.specimenTakenDate.timestamp between :startDate and :endDate
		]]>
	</query>

</hibernate-mapping>