<?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="partialDispense40010" lazy="false" table="VISTA_HDSI.PRESCRIPTIOX_PARTIAL_52_2_EXT" node="partialDispense">

		<composite-id name="id">
			<key-property name="PRESCRIPTION" type="big_decimal" />
			<key-property name="CHILDSUB1" type="big_decimal" />
		</composite-id>

		<property name="prescription" column="PRESCRIPTION" type="big_decimal" insert="false" update="false" node="prescription" />

		<component name="quantityDispensed" node="quantityDispensed">
		  <property name="value" column="QTY" type="java.lang.String" node="value" />
		</component>
		
        <property name="currentProvider" type="gov.va.med.cds.persistence.hibernate.common.VistaReducedReadPersonNameUserType" node="currentProvider//name">
            <formula>
                (CASE
                     WHEN (PROVIDER IS NOT NULL) THEN VISTA_HDSI.HDSREPSQLUtil1_MiscNameNE(PROVIDER)
                     ELSE NULL
                END)
            </formula>
        </property>
		
		<component name="division" node="division">
			<component name="divisionId" node="divisionId">
			     <property name="code" formula="VISTA_HDSI.HDSREPSQLUtil1_StationNumber()" type="java.lang.String" node="code" />
				<property name="displayText" column="DIVISIONX" type="java.lang.String" node="displayText" />
			</component>
		</component>

		<component name="dispensedDrug" node="dispensedDrug">
			<component name="drugUnitPrice" node="drugUnitPrice">
			     <property name="value" column="CURRENT_UNIT_PRICE_OF_DRUG" type="java.lang.String" node="value" />
			</component>
			
			<component name="ndc" node="ndc">
				<property name="code" column="NDC" type="java.lang.String" node="code" />
			</component>
		</component>

	</class>
</hibernate-mapping>
