<?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="chartMarker40010" table="VISTA_HDSI.PAT_X_CHART_MARKED_120_813_EXT" lazy="false" name="gov.va.med.cds.template.generated.common.PractitionerParticipationLite"  >
        <id name="idV" type="java.lang.String">
            <column name="ROWID" />
            <generator class="assigned" />
        </id>
        
        <property name="patientAllergies" column="PATIENT_ALLERGIES"  type="big_decimal" insert="false" update="false" />        
       <property name="time" formula="STRING(DATETIME,'^',VISTA_HDSI.HDSREPSQLUtil1_StationNumber())"  type="gov.va.med.cds.persistence.hibernate.common.VistaPointInTimeUserType" insert="false" update="false"  />
        
       <component name="practitioner" class="gov.va.med.cds.template.generated.common.PractitionerLite">
            <property name="identifier" formula="ChartMarkerNE||'^'||(VISTA_HDSI.HDSREPSQLUtil1_StationNumber())" type="gov.va.med.cds.persistence.hibernate.common.VistaPersonIdentifierUserType" insert="false" update="false"  />
            <property name="name" column="ChartMarkerNE" type="gov.va.med.cds.persistence.hibernate.common.VistaPersonNameUserType" insert="false" update="false"  />
        </component>

    </class>
    
    <class entity-name="chartMarker_multiquery" table="VISTA_HDSI.PAT_X_CHART_MARKED_120_813_EXT" lazy="false" name="gov.va.med.cds.template.generated.allergies.subquery.ChartMarkerWrapper"  >
        
        <id name="id" type="java.lang.String">
            <column name="ROWID" />
            <generator class="assigned" />
        </id>

        <property name="patientAllergies" column="PATIENT_ALLERGIES" type="big_decimal" insert="false" update="false" />
        
        <property name="time" formula="STRING(DATETIME,'^',VISTA_HDSI.HDSREPSQLUtil1_StationNumber())"  type="gov.va.med.cds.persistence.hibernate.common.VistaPointInTimeUserType" insert="false" update="false" />
 
       
       <component name="practitioner" class="gov.va.med.cds.template.generated.common.PractitionerLite">
            <property name="identifier" formula="ChartMarkerNE||'^'||(VISTA_HDSI.HDSREPSQLUtil1_StationNumber())" type="gov.va.med.cds.persistence.hibernate.common.VistaPersonIdentifierUserType" insert="false" update="false"  />
            <property name="name" column="ChartMarkerNE" type="gov.va.med.cds.persistence.hibernate.common.VistaPersonNameUserType" insert="false" update="false"  />
        </component>

    </class>
    
    <query name="IntoleranceConditionRead40010.IntoleranceCondition.chartMarker">
     <![CDATA[
        select cm
        from chartMarker_multiquery cm, intoleranceConditions ic
        where ic.id = cm.patientAllergies
        and ic.patient.identifier.identity in ( :pids )
      ]]>
    </query>
    
     <query name="IntoleranceConditionRead40010.IntoleranceCondition.chartMarker.date">
     <![CDATA[
        select cm
        from chartMarker_multiquery cm, intoleranceConditions ic
        where ic.id = cm.patientAllergies
        and ic.patient.identifier.identity in ( :pids )
        and ( (ic.observationTime.timestamp between :startDate and :endDate) or (ic.observationTime.timestamp is null)  )
      ]]>
    </query>
    
     <query name="IntoleranceConditionRead40010.IntoleranceCondition.chartMarker.identifiers">
     <![CDATA[
        select cm
        from chartMarker_multiquery cm, intoleranceConditions ic
        where ic.id = cm.patientAllergies
        and ic.patient.identifier.identity in ( :pids )
        and ic.id in ( :recordIdentifiers )
      ]]>
    </query>
    
     <query name="VWIntoleranceConditionRead40010.IntoleranceCondition.chartMarker">
     <![CDATA[
        select cm
        from chartMarker_multiquery cm, intoleranceConditions ic
        where ic.id = cm.patientAllergies
        and ic.patient.identifier.identity in ( :pids )
      ]]>
    </query>
    
     <query name="VWIntoleranceConditionRead40010.IntoleranceCondition.chartMarker.date">
     <![CDATA[
        select cm
        from chartMarker_multiquery cm, intoleranceConditions ic
        where ic.id = cm.patientAllergies
        and ic.patient.identifier.identity in ( :pids )
        and ( (ic.observationTime.timestamp between :startDate and :endDate) or (ic.observationTime.timestamp is null)  )
      ]]>
    </query>
    
     <query name="VWIntoleranceConditionRead40010.IntoleranceCondition.chartMarker.identifiers">
     <![CDATA[
        select cm
        from chartMarker_multiquery cm, intoleranceConditions ic
        where ic.id = cm.patientAllergies
        and ic.patient.identifier.identity in ( :pids )
        and ic.id in ( :recordIdentifiers )
      ]]>
    </query>
        
    <query name="RDIIntoleranceConditionPharmacyRead40010.IntoleranceCondition.chartMarker">
     <![CDATA[
        select cm
        from chartMarker_multiquery cm, intoleranceConditions ic
        where ic.id = cm.patientAllergies
        and ic.patient.identifier.identity in ( :pids )
      ]]>
    </query>
    
     <query name="RDIIntoleranceConditionPharmacyRead40010.IntoleranceCondition.chartMarker.date">
     <![CDATA[
        select cm
        from chartMarker_multiquery cm, intoleranceConditions ic
        where ic.id = cm.patientAllergies
        and ic.patient.identifier.identity in ( :pids )
        and ( (ic.observationTime.timestamp between :startDate and :endDate) or (ic.observationTime.timestamp is null)  )
      ]]>
    </query>
    
     <query name="RDIIntoleranceConditionPharmacyRead40010.IntoleranceCondition.chartMarker.identifiers">
     <![CDATA[
        select cm
        from chartMarker_multiquery cm, intoleranceConditions ic
        where ic.id = cm.patientAllergies
        and ic.patient.identifier.identity in ( :pids )
        and ic.id in ( :recordIdentifiers )
      ]]>
    </query>      

    <query name="RDIIntoleranceConditionPharmacyRead40011.IntoleranceCondition.chartMarker">
     <![CDATA[
        select cm
        from chartMarker_multiquery cm, intoleranceConditions ic
        where ic.id = cm.patientAllergies
        and ic.patient.identifier.identity in ( :pids )
      ]]>
    </query>
    
     <query name="RDIIntoleranceConditionPharmacyRead40011.IntoleranceCondition.chartMarker.date">
     <![CDATA[
        select cm
        from chartMarker_multiquery cm, intoleranceConditions ic
        where ic.id = cm.patientAllergies
        and ic.patient.identifier.identity in ( :pids )
        and ( (ic.observationTime.timestamp between :startDate and :endDate) or (ic.observationTime.timestamp is null)  )
      ]]>
    </query>
    
     <query name="RDIIntoleranceConditionPharmacyRead40011.IntoleranceCondition.chartMarker.identifiers">
     <![CDATA[
        select cm
        from chartMarker_multiquery cm, intoleranceConditions ic
        where ic.id = cm.patientAllergies
        and ic.patient.identifier.identity in ( :pids )
        and ic.id in ( :recordIdentifiers )
      ]]>
    </query>   
    <query name="RDIIntoleranceConditionPharmacyRead40012.IntoleranceCondition.chartMarker">
     <![CDATA[
        select cm
        from chartMarker_multiquery cm, intoleranceConditions ic
        where ic.id = cm.patientAllergies
        and ic.patient.identifier.identity in ( :pids )
      ]]>
    </query>
    
     <query name="RDIIntoleranceConditionPharmacyRead40012.IntoleranceCondition.chartMarker.date">
     <![CDATA[
        select cm
        from chartMarker_multiquery cm, intoleranceConditions ic
        where ic.id = cm.patientAllergies
        and ic.patient.identifier.identity in ( :pids )
        and ( (ic.observationTime.timestamp between :startDate and :endDate) or (ic.observationTime.timestamp is null)  )
      ]]>
    </query>
    
     <query name="RDIIntoleranceConditionPharmacyRead40012.IntoleranceCondition.chartMarker.identifiers">
     <![CDATA[
        select cm
        from chartMarker_multiquery cm, intoleranceConditions ic
        where ic.id = cm.patientAllergies
        and ic.patient.identifier.identity in ( :pids )
        and ic.id in ( :recordIdentifiers )
      ]]>
    </query>         
       <query name="RDIAllergiesPharmacyRead40013.IntoleranceCondition.chartMarker">
     <![CDATA[
        select cm
        from chartMarker_multiquery cm, intoleranceConditions ic
        where ic.id = cm.patientAllergies
        and ic.patient.identifier.identity in ( :pids )
      ]]>
    </query>
    
     <query name="RDIAllergiesPharmacyRead40013.IntoleranceCondition.chartMarker.date">
     <![CDATA[
        select cm
        from chartMarker_multiquery cm, intoleranceConditions ic
        where ic.id = cm.patientAllergies
        and ic.patient.identifier.identity in ( :pids )
        and ( (ic.observationTime.timestamp between :startDate and :endDate) or (ic.observationTime.timestamp is null)  )
      ]]>
    </query>
    
     <query name="RDIAllergiesPharmacyRead40013.IntoleranceCondition.chartMarker.identifiers">
     <![CDATA[
        select cm
        from chartMarker_multiquery cm, intoleranceConditions ic
        where ic.id = cm.patientAllergies
        and ic.patient.identifier.identity in ( :pids )
        and ic.id in ( :recordIdentifiers )
      ]]>
    </query>                                  
</hibernate-mapping>