<?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="refillDispense40010" lazy="false" table="VISTA_HDSI.PRESCRIPTION_52X_REFILL_52_1" node="refillDispense">

		<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="daysSupply" column="DAYS_SUPPLY" type="big_decimal" node="daysSupply" />
		
		<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>
			
			<property name="expirationDate" formula="STRING(DRUG_EXPIRATION_DATE,'^',(VISTA_HDSI.HDSREPSQLUtil1_StationNumber()))" type="gov.va.med.cds.persistence.hibernate.common.VistaPointInTimeUserType" node="expirationDate//literal" />
			
			<component name="ndc" node="ndc">
				<property name="code" column="NDC" type="java.lang.String" node="code" />
			</component>
		</component>

	</class>
</hibernate-mapping>
