<?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="vwOriginalMedicationDispense40010" table="OUTPATIENT_MED_DSP_V" lazy="false" discriminator-value="O" name="gov.va.med.cds.template.generated.pharmacy.OutpatientMedicationDispense">
		<id name="id" type="java.lang.Long">
			<column name="OUTPATIENT_MED_DSP_ID"/>
			<generator class="sequence">
				<param name="sequence">outpatient_med_dsp_seq_id</param>
			</generator>
		</id>
		
		<discriminator column="discriminator" type="character"/>
				
		<!-- From super class MedicationDispense.  One more superclass item mapped in the set list at the bottom. -->
		<list name="comments" table="DISPENSE_COMMENT_V" fetch="subselect" batch-size="100">
			<key column="OUTPATIENT_MED_DSP_ID" not-null="true" update="false"/>
			<list-index column="LINE_NBR"/>
			<element type="java.lang.String" column="DISPENSE_COMMENTS" />
		</list>
		<component name="currentProvider" class="gov.va.med.cds.template.generated.common.PractitionerLite">
			<component name="name" class="gov.va.med.cds.template.generated.basedatatypes.HL72PersonName" >
				<property name="prefix" column="CPRV_NAME_PREFIX" type="java.lang.String" />
				<property name="given" column="CPRV_NAME_GIVEN" type="java.lang.String" />
				<property name="middle" column="CPRV_NAME_MIDDLE" type="java.lang.String" />
				<property name="family" column="CPRV_NAME_FAMILY" type="java.lang.String" />
				<property name="suffix" column="CPRV_NAME_SUFFIX" type="java.lang.String" />
				<property name="title" column="CPRV_NAME_TITLE" type="java.lang.String" />
			</component>
		</component>
		<component name="quantityDispensed" class="gov.va.med.cds.template.generated.basedatatypes.PhysicalQuantity">
			<property name="value" column="QTYDISPENSED_VAL" type="java.lang.String" />
		</component>
		<component name="division" class="gov.va.med.cds.template.generated.common.PharmacyDivision">
			<component name="divisionId" class="gov.va.med.cds.template.generated.basedatatypes.HL72CodedElementLite">
				<property name="code" column="DIVISION_ID_CODE" type="java.lang.String" />
				<property name="displayText" column="DIVISION_ID_DSPLYTXT" type="java.lang.String" />
				<property name="codingSystem" column="DIVISION_ID_CODSYS" type="java.lang.String"/>
			</component>
		</component>
		<property name="numberOfRefillsRemaining" column="NUM_REFILLS_REMAINING" type="integer" />
		<component name="dispensedDrug" class="gov.va.med.cds.template.generated.pharmacy.DispensedDrugInstance">
			<component name="drugUnitPrice" class="gov.va.med.cds.template.generated.basedatatypes.Money">
				<property name="value" column="DRUG_UNITPRICE_VAL" type="java.lang.String" />
			</component>
			<component name="ndc" class="gov.va.med.cds.template.generated.basedatatypes.HL72CodedElementLite">
				<property name="code" column="NDC_CODE" type="java.lang.String" />
				<property name="displayText" column="NDC_DSPLYTXT" type="java.lang.String" />
				<property name="codingSystem" column="NDC_CODSYS" type="java.lang.String" />
			</component>
		</component>
	</class>
</hibernate-mapping>
