<?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="CommentEvents" table="ALLERGY_COMMENT_EVENT_V" name="gov.va.med.cds.template.generated.allergies.AllergyCommentEvent">
        <id name="id" type="java.lang.Long">
            <column name="ALLERGY_COMMENT_EVENT_ID" />
            <generator class="sequence" >
				<param name="sequence">allergy_comment_event_seq_id</param>
			</generator>
        </id>

		<property name="date" type="gov.va.med.cds.persistence.hibernate.common.PointInTimeUserType"  >
			<column name="COMMENT_TM"/>
			<column name="COMMENT_TM_NBR"/>
		</property>

		<component name="commentType" class="gov.va.med.cds.template.generated.basedatatypes.HL72CodedElementLite">
			<property name="code" column="COMMENT_TYP_CODE" type="java.lang.String"  />
			<property name="displayText" column="COMMENT_TYP_DSPLYTXT" type="java.lang.String"  />
			<property name="codingSystem" column="COMMENT_TYP_CODSYS" type="java.lang.String" />
		</component>
 
  		<list name="comments" table="ALLERGY_COMMENT_V" >
			<key column="ALLERGY_COMMENT_EVENT_ID" not-null="true"/>
			<list-index column="LINE_NBR" />
			<element type="string" column="COMMENT_TXT" />
        </list>
        	
	   <component name="author"  class="gov.va.med.cds.template.generated.common.PractitionerLite">
			<component name="identifier" class="gov.va.med.cds.template.generated.basedatatypes.HL72PersonIdentifier">
				<property name="identity" column="AUTH_PERSON_IDENTITY" type="java.lang.String"/>
				<property name="assigningFacility" column="AUTH_PERSON_ASGNING_FACILITY" type="java.lang.String" />
				<property name="assigningAuthority" column="AUTH_PERSON_ASGNING_AUTHORITY" type="java.lang.String" />
			</component>

        	<property name="idSourceTable" column="AUTH_PRACTITIONER_ID_SRC_TBL" type="java.lang.String" />

			<component name="name" class="gov.va.med.cds.template.generated.basedatatypes.HL72PersonName">
				<property name="prefix" column="AUTH_NAME_PREFIX" type="java.lang.String" />
				<property name="given" column="AUTH_NAME_GIVEN" type="java.lang.String" />
				<property name="middle" column="AUTH_NAME_MIDDLE" type="java.lang.String" />
				<property name="family" column="AUTH_NAME_FAMILY" type="java.lang.String" />
				<property name="suffix" column="AUTH_NAME_SUFFIX" type="java.lang.String" />
				<property name="title" column="AUTH_NAME_TITLE" type="java.lang.String" />
			</component>
		</component>

    </class>
 
</hibernate-mapping>
