<?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="ProblemListRead2" table="VISTA_HDSI.PROBLM0_9000011_EXT"  name="gov.va.med.cds.template.generated.problemlist.HealthConcern">
		<!-- <id name="rowId" type="big_decimal">
			<column name="ROWID" />
			<generator class="assigned" />
		</id> -->	
		<id name="idV" type="big_decimal">
			<column name="ROWID" />
			<generator class="assigned" />
		</id>

		<property name="idV" column="ROWID" type="big_decimal" insert="false" update="false" />

		<component name="patient" class="gov.va.med.cds.template.generated.common.PatientLite">
			<component name="identifier" class="gov.va.med.cds.template.generated.basedatatypes.HL72PersonIdentifier">
				<property name="identity" column="PATIENT_NAME" type="gov.va.med.cds.persistence.hibernate.common.VistaIdentityUserType" insert="false" update="false"/>
				<property name="assigningFacility" formula="VISTA_HDSI.HDSREPSQLUtil1_StationNumber()" type="java.lang.String"  />
				<property name="assigningAuthority" formula="'USVHA'" type="java.lang.String"  />
			</component>
			<property name="name" formula="VISTA_HDSI.HDSREPSQLUtil1_PatientNE(PATIENT_NAME)" type="gov.va.med.cds.persistence.hibernate.common.VistaPersonNameUserType"/>	
		</component>
	
		<component name="chronicityCode" class="gov.va.med.cds.template.generated.basedatatypes.VACode">
			<property name="alternateCode" column="PRIORITY" type="java.lang.String" />
			<property name="alternateCodingSystem" type="java.lang.String" >
				<formula>
					(CASE
					WHEN ( PRIORITY IS NOT NULL ) THEN 'L'
					END)
				</formula>
			</property>
			<property name="alternateDisplayText" type="java.lang.String" >
				<formula>
					(CASE
					WHEN ( PRIORITY = 'A' ) THEN 'Acute'
					WHEN ( PRIORITY = 'C' ) THEN 'Chronic'
					ELSE NULL
					END )
		        </formula>
			</property>
		</component>

		<property name="dateLastModified" type="gov.va.med.cds.persistence.hibernate.common.VistaPointInTimeUserTypeQuery" >
			<column name="DATE_LAST_MODIFIED" />
			<formula>VISTA_HDSI.HDSREPSQLUtil1_StationNumber()</formula>
		</property>

		<component name="entryId"  class="gov.va.med.cds.template.generated.basedatatypes.Id">
			<property name="assigningAuthorityName" formula="'USVHA'" type="java.lang.String" />
			<property name="extension" column="NMBR" type="gov.va.med.cds.persistence.hibernate.common.VistaIntegerToStringUserType"/>
		</component>

		<component name="healthConcernStatus" class="gov.va.med.cds.template.generated.basedatatypes.VACode">
			<property name="alternateCode" column="STATUS" type="java.lang.String" insert="false" update="false"  />
			<property name="alternateCodingSystem" formula="VISTA_HDSI.HDSREPSQLUtil1_StationNumber()||'_9000011_12'" type="java.lang.String"  />
			<property name="alternateDisplayText" type="java.lang.String" >
				<formula>
					(CASE
					WHEN (STATUS = 'A') THEN 'ACTIVE'
					WHEN (STATUS = 'I') THEN 'INACTIVE'
					END)
				</formula>
			</property>
		</component>

		<component name="concernDurations" class="gov.va.med.cds.template.generated.problemlist.HealthConcern$ConcernDurations">
			<component name="singleConcernDuration" class="gov.va.med.cds.template.generated.basedatatypes.TimeInterval">
				<property name="low" formula="STRING(DATE_OF_ONSET,'^',(VISTA_HDSI.HDSREPSQLUtil1_StationNumber()))" type="gov.va.med.cds.persistence.hibernate.common.VistaPointInTimeUserType" />
				<property name="high" formula="STRING(DATE_RESOLVED,'^',(VISTA_HDSI.HDSREPSQLUtil1_StationNumber()))" type="gov.va.med.cds.persistence.hibernate.common.VistaPointInTimeUserType" />
			</component>
		</component>

		<property name="recordDisposition" column="CONDITION" type="java.lang.String" />

		<component name="dataEnterer" class="gov.va.med.cds.template.generated.common.PractitionerParticipationLite" >
			<property name="time" formula="STRING(DATE_ENTERED,'^',(VISTA_HDSI.HDSREPSQLUtil1_StationNumber()))" type="gov.va.med.cds.persistence.hibernate.common.VistaPointInTimeUserType" />
			<component name="practitioner" 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="ENTERED_BY" type="gov.va.med.cds.persistence.hibernate.common.VistaIdentityUserType"/>
					<property name="assigningFacility" formula="VISTA_HDSI.HDSREPSQLUtil1_StationNumber()" type="java.lang.String" insert="false" update="false" />
					<property name="assigningAuthority" formula="'USVHA'" type="java.lang.String" />
				</component>
				<property name="idSourceTable" formula="'VistA200'" type="java.lang.String"  />
				<property name="name" formula="VISTA_HDSI.HDSREPSQLUtil1_MiscNameNE(ENTERED_BY)" type="gov.va.med.cds.persistence.hibernate.common.VistaPersonNameUserType"  />
			</component>
		</component>

		<component name="author" class="gov.va.med.cds.template.generated.common.PractitionerParticipationLite" >
			<property name="time" formula="STRING(DATE_RECORDED,'^',(VISTA_HDSI.HDSREPSQLUtil1_StationNumber()))" type="gov.va.med.cds.persistence.hibernate.common.VistaPointInTimeUserType" />
			<component name="practitioner" 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="RECORDING_PROVIDER" type="gov.va.med.cds.persistence.hibernate.common.VistaIdentityUserType"/>
					<property name="assigningFacility" formula="VISTA_HDSI.HDSREPSQLUtil1_StationNumber()" type="java.lang.String" insert="false" update="false"  />
					<property name="assigningAuthority" formula="'USVHA'" type="java.lang.String" />
				</component>
				<property name="idSourceTable" formula="'VistA200'" type="java.lang.String"  />
				<property name="name" formula="VISTA_HDSI.HDSREPSQLUtil1_MiscNameNE(RECORDING_PROVIDER)" type="gov.va.med.cds.persistence.hibernate.common.VistaPersonNameUserType" />
			</component>
		</component>

		<component name="clinic" class="gov.va.med.cds.template.generated.common.HospitalLocation">
			<component name="locationId" class="gov.va.med.cds.template.generated.basedatatypes.HL72LocationIdentifier">
				<property name="pointOfCare" column="CLINICX" type="java.lang.String"  />
				<property name="room" column="CLINIC" type="gov.va.med.cds.persistence.hibernate.common.VistaIntegerToStringUserType"/>
			</component>
		</component>

		<component name="service" class="gov.va.med.cds.template.generated.common.ServiceDepartment">
			<component name="serviceCode" class="gov.va.med.cds.template.generated.basedatatypes.HL72CodedElement" >
				<property name="code" column="ServiceCodeAbbreviation" type="java.lang.String"  />
				<property name="displayText" column="SERVICEX" type="java.lang.String" />
				<property name="codingSystem" type="java.lang.String" >
					<formula>
						(CASE
						WHEN (ServiceCodeAbbreviation IS NOT NULL OR SERVICEX IS NOT NULL) THEN VISTA_HDSI.HDSREPSQLUtil1_StationNumber()||'_49'
						ELSE NULL 
						END)
					</formula>
				</property>
			</component>
		</component>

		<component name="facility" class="gov.va.med.cds.template.generated.common.VisitLocation">
			<component name="locationCode" class="gov.va.med.cds.template.generated.basedatatypes.HL72CodedElement" >
				<property name="code" column="FACILITY"  type="gov.va.med.cds.persistence.hibernate.common.VistaIntegerToStringUserType" insert="false" update="false" />
				<property name="displayText" column="FACILITYX" type="java.lang.String" />
				<property name="codingSystem" type="java.lang.String">
					<formula>
						(CASE
						WHEN (FACILITY IS NOT NULL OR FACILITYX IS NOT NULL) THEN 'L'
						ELSE NULL
						END)
					</formula>
				</property>
			</component>
		</component>

		<component name="recordSource" class="gov.va.med.cds.template.generated.basedatatypes.HL72FacilityIdentifier">
			<property name="namespaceId" formula="VISTA_HDSI.HDSREPSQLUtil1_StationNumber()||'_55.05'" type="java.lang.String" />
			<property name="universalId" formula="VISTA_HDSI.HDSREPSQLUtil1_KSPDomainName()" type="java.lang.String" />
			<property name="universalIdType" formula="'DNS'" type="java.lang.String" />
		</component>

		<component name="recordIdentifier" class="gov.va.med.cds.template.generated.basedatatypes.HL72EntityIdentifier">
			<property name="identity" column="ROWID" type="gov.va.med.cds.persistence.hibernate.common.VistaIntegerToStringUserType" insert="false" update="false" />
			<property name="namespaceId" formula="VISTA_HDSI.HDSREPSQLUtil1_StationNumber()" type="java.lang.String" />
		</component>

		<component name="responsibleProviders" class="gov.va.med.cds.template.generated.problemlist.HealthConcern$ResponsibleProviders">
			<component name="singleResponsibleProvider" class="gov.va.med.cds.template.generated.common.PractitionerParticipationLite">
				<component name="practitioner" 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="RESPONSIBLE_PROVIDER" type="gov.va.med.cds.persistence.hibernate.common.VistaIdentityUserType"/>
						<property name="assigningFacility" formula="VISTA_HDSI.HDSREPSQLUtil1_StationNumber()" type="java.lang.String" insert="false" update="false" />
						<property name="assigningAuthority" formula="'USVHA'" type="java.lang.String"/>
					</component>
					<property name="idSourceTable" formula="'VistA200'" />
					<property name="name" formula="VISTA_HDSI.HDSREPSQLUtil1_MiscNameNE(RESPONSIBLE_PROVIDER)" type="gov.va.med.cds.persistence.hibernate.common.VistaPersonNameUserType" />
				</component>	
			</component>
		</component>

		<component name="diagnosesList" class="gov.va.med.cds.template.generated.problemlist.HealthConcern$DiagnosesList">
			<component name="singleDiagnosisList" class="gov.va.med.cds.template.generated.problemlist.DiagnosisList">
				<component name="diagnosis" class="gov.va.med.cds.template.generated.common.Diagnosis">
					<component name="icdCodes" class="gov.va.med.cds.template.generated.common.Diagnosis$IcdCodes">
						<component name="singleIcdCode" class="gov.va.med.cds.template.generated.basedatatypes.VACode">
							<property name="alternateCode" column="DIAGNOSISX" type="java.lang.String" />
							<property name="alternateDisplayText" column="DiagnosisDescription" type="java.lang.String"  />
							<property name="alternateCodingSystem" type="java.lang.String" >
								<formula>
									(CASE
									WHEN (DIAGNOSISX IS NOT NULL OR DiagnosisDescription IS NOT NULL) THEN VISTA_HDSI.HDSREPSQLUtil1_StationNumber()||'_80'
									ELSE NULL
									END)
								</formula>
							</property>
						</component>
					</component>
					<property name="inactiveDate" formula="STRING(DiagnosisInactiveDate,'^',(VISTA_HDSI.HDSREPSQLUtil1_StationNumber()))" type="gov.va.med.cds.persistence.hibernate.common.VistaPointInTimeUserType" />
					<component name="inactiveFlag" class="gov.va.med.cds.template.generated.basedatatypes.VACode">
						<property name="alternateCode" column="DiagnosisInactiveFlag" type="java.lang.String" />
						<property name="alternateDisplayText" type="java.lang.String" >
							<formula>
								(CASE
								WHEN (DiagnosisInactiveFlag = '1') THEN 'INACTIVE'
								ELSE NULL
								END) </formula>
						</property>
						<property name="alternateCodingSystem" type="java.lang.String">
							<formula>
								(CASE
								WHEN (DiagnosisInactiveFlag IS NOT NULL) THEN VISTA_HDSI.HDSREPSQLUtil1_StationNumber()||'_80'
								ELSE NULL
								END)
							</formula>
						</property>
					</component>
				</component>
			</component>
		</component>

		<component name="specialInterestsFlag"  class="gov.va.med.cds.template.generated.problemlist.HealthConcern$SpecialInterestsFlag">
			<component name="serviceConnectedSpecialInterestFlag" class="gov.va.med.cds.template.generated.common.TreatmentFactor">
				<component name="factor" class="gov.va.med.cds.template.generated.basedatatypes.HL72CodedElementLite">
					<property name="code" type="java.lang.String">
						<formula>
							(CASE
							WHEN (SERVICE_CONNECTED IS NOT NULL) THEN 'SERVICE_CONNECTED'
							ELSE ''
							END)
						</formula>
					</property>
				</component>
				<component name="factorValue" class="gov.va.med.cds.template.generated.basedatatypes.HL72CodedElementLite">
					<property name="code" column="SERVICE_CONNECTED" type="java.lang.String" />
					<property name="displayText" type="java.lang.String" >
						<formula>
							(CASE
							WHEN (SERVICE_CONNECTED = '0') THEN 'NO'
							WHEN (SERVICE_CONNECTED = '1') THEN 'YES'
							END)
						</formula>
					</property>
				</component>
			</component>
			<component name="agentOrangeExposureSpecialInterestFlag" class="gov.va.med.cds.template.generated.common.TreatmentFactor">
				<component name="factor" class="gov.va.med.cds.template.generated.basedatatypes.HL72CodedElementLite">
					<property name="code" type="java.lang.String" >
						<formula>
							(CASE
							WHEN (AGENT_ORANGE_EXPOSURE IS NOT NULL) THEN 'AGENT_ORANGE_EXPOSURE'
							ELSE ''
							END)
						</formula>
					</property>
				</component>
				<component name="factorValue" class="gov.va.med.cds.template.generated.basedatatypes.HL72CodedElementLite">
					<property name="code" column="AGENT_ORANGE_EXPOSURE" type="java.lang.String" />
					<property name="displayText" type="java.lang.String" >
						<formula>
							(CASE
							WHEN (AGENT_ORANGE_EXPOSURE = '0') THEN 'NO'
							WHEN (AGENT_ORANGE_EXPOSURE = '1') THEN 'YES'
							END)
						</formula>
					</property>
				</component>
			</component>
			<component name="ionizingRadiationExposureSpecialInterestFlag" class="gov.va.med.cds.template.generated.common.TreatmentFactor">
				<component name="factor" class="gov.va.med.cds.template.generated.basedatatypes.HL72CodedElementLite">
					<property name="code" type="java.lang.String" >
						<formula>
							(CASE
							WHEN (IONIZING_RADIATION_EXPOSURE IS NOT NULL) THEN 'IONIZING_RADIATION_EXPOSURE'
							ELSE ''
							END)
						</formula>
					</property>
				</component>
				<component name="factorValue" class="gov.va.med.cds.template.generated.basedatatypes.HL72CodedElementLite">
					<property name="code" column="IONIZING_RADIATION_EXPOSURE" type="java.lang.String"  />
					<property name="displayText" type="java.lang.String" >
						<formula>
							(CASE
							WHEN (IONIZING_RADIATION_EXPOSURE = '0') THEN 'NO'
							WHEN (IONIZING_RADIATION_EXPOSURE = '1') THEN 'YES'
							END)
						</formula>
					</property>
				</component>
			</component>
			<component name="persianGulfExposureSpecialInterestFlag" class="gov.va.med.cds.template.generated.common.TreatmentFactor">
				<component name="factor" class="gov.va.med.cds.template.generated.basedatatypes.HL72CodedElementLite">
					<property name="code" type="java.lang.String" >
						<formula>
							(CASE
							WHEN (PERSIAN_GULF_EXPOSURE IS NOT NULL) THEN 'PERSIAN_GULF_EXPOSURE'
							ELSE ''
							END)
						</formula>
					</property>
				</component>
				<component name="factorValue" class="gov.va.med.cds.template.generated.basedatatypes.HL72CodedElementLite">
					<property name="code" column="PERSIAN_GULF_EXPOSURE" type="java.lang.String"/>
					<property name="displayText" type="java.lang.String" >
						<formula>
							(CASE
							WHEN (PERSIAN_GULF_EXPOSURE = '0') THEN 'NO'
							WHEN (PERSIAN_GULF_EXPOSURE = '1') THEN 'YES'
							END)
						</formula>
					</property>
				</component>
			</component>
			<component name="headAndOrNeckCancerSpecialInterestFlag" class="gov.va.med.cds.template.generated.common.TreatmentFactor">
				<component name="factor" class="gov.va.med.cds.template.generated.basedatatypes.HL72CodedElementLite">
					<property name="code" type="java.lang.String" >
						<formula>
							(CASE
							WHEN (HEAD_ANDOR_NECK_CANCER IS NOT NULL) THEN 'HEAD_ANDOR_NECK_CANCER'
							ELSE ''
							END)
						</formula>
					</property>
				</component>
				<component name="factorValue" class="gov.va.med.cds.template.generated.basedatatypes.HL72CodedElementLite">
					<property name="code" column="HEAD_ANDOR_NECK_CANCER" type="java.lang.String"  />
					<property name="displayText" type="java.lang.String" >
						<formula>
							(CASE
							WHEN (HEAD_ANDOR_NECK_CANCER = '0') THEN 'NO'
							WHEN (HEAD_ANDOR_NECK_CANCER = '1') THEN 'YES'
							END)
						</formula>
					</property>
				</component>
			</component>
			<component name="militarySexualTramaSpecialInterestFlag" class="gov.va.med.cds.template.generated.common.TreatmentFactor">
				<component name="factor" class="gov.va.med.cds.template.generated.basedatatypes.HL72CodedElementLite">
					<property name="code" type="java.lang.String" >
						<formula>
							(CASE
							WHEN (MILITARY_SEXUAL_TRAUMA IS NOT NULL) THEN 'MILITARY_SEXUAL_TRAUMA'
							ELSE ''
							END)
						</formula>
					</property>
				</component>
				<component name="factorValue" class="gov.va.med.cds.template.generated.basedatatypes.HL72CodedElementLite">
					<property name="code" column="MILITARY_SEXUAL_TRAUMA" type="java.lang.String" />
					<property name="displayText" type="java.lang.String" >
						<formula>
							(CASE
							WHEN (MILITARY_SEXUAL_TRAUMA = '0') THEN 'NO'
							WHEN (MILITARY_SEXUAL_TRAUMA = '1') THEN 'YES'
							END)
						</formula>
					</property>
				</component>
			</component>
			<component name="combatVeteranSpecialInterestFlag" class="gov.va.med.cds.template.generated.common.TreatmentFactor">
				<component name="factor" class="gov.va.med.cds.template.generated.basedatatypes.HL72CodedElementLite">
					<property name="code" type="java.lang.String">
						<formula>
							(CASE
							WHEN (CombatVeteran IS NOT NULL) THEN 'CombatVeteran'
							ELSE ''
							END)
						</formula>
					</property>
				</component>
				<component name="factorValue" class="gov.va.med.cds.template.generated.basedatatypes.HL72CodedElementLite">
					<property name="code" column="CombatVeteran" type="java.lang.String"/>
					<property name="displayText" type="java.lang.String">
						<formula>
							(CASE
							WHEN (CombatVeteran = '0') THEN 'NO'
							WHEN (CombatVeteran = '1') THEN 'YES'
							END)
						</formula>
					</property>
				</component>
			</component>
			<component name="shipboardHazardDefenseSpecialInterestFlag" class="gov.va.med.cds.template.generated.common.TreatmentFactor">
				<component name="factor" class="gov.va.med.cds.template.generated.basedatatypes.HL72CodedElementLite">
					<property name="code" type="java.lang.String">
						<formula>
							(CASE
							WHEN (ShipboardHazardDefense IS NOT NULL) THEN 'ShipboardHazardDefense'
							ELSE ''
							END)
						</formula>
					</property>
				</component>
				<component name="factorValue" class="gov.va.med.cds.template.generated.basedatatypes.HL72CodedElementLite">
					<property name="code" column="ShipboardHazardDefense" type="java.lang.String" />
					<property name="displayText" type="java.lang.String" >
						<formula>
							(CASE
							WHEN (ShipboardHazardDefense = '0') THEN 'NO'
							WHEN (ShipboardHazardDefense = '1') THEN 'YES'
							END)
						</formula>
					</property>
				</component>
			</component>
		</component>

		<component name="expression" class="gov.va.med.cds.template.generated.problemlist.Expression">
			<property name="expressionText" column="PROBLEMX" type="java.lang.String" insert="false" update="false"  />
			<component name="expressionCode" class="gov.va.med.cds.template.generated.basedatatypes.VACode">
				<property name="alternateCode" column="PROBLEM" type="gov.va.med.cds.persistence.hibernate.common.VistaIntegerToStringUserType" insert="false" update="false" />
				<property name="alternateCodingSystem" formula="VISTA_HDSI.HDSREPSQLUtil1_StationNumber()||'_757_01'" type="java.lang.String"  />
				<property name="alternateDisplayText" column="PROBLEMX" type="java.lang.String" insert="false" update="false"  />
			</component>
		</component>

		<component name="providerNarrative" class="gov.va.med.cds.template.generated.problemlist.ProviderNarrative">
			<property name="narrativeText" column="PROVIDERNARRATIVEX" type="java.lang.String" insert="false" update="false"/>
			<component name="narrativeCode" class="gov.va.med.cds.template.generated.basedatatypes.VACode">
				<property name="alternateDisplayText" column="PROVIDERNARRATIVEX" type="java.lang.String" insert="false" update="false" />
			</component>
		</component>

		<!-- Status used for only filter purpose -->
		<property name="statusRef" column="STATUS" type="java.lang.String" insert="false" update="false"  />

	</class>

	<!-- Patient Query -->
	<query name="ProblemListRead2.HealthConcern.healthConcerns">
		<![CDATA[ 
        	from ProblemListRead2 plr
        	where plr.patient.identifier.identity in ( :pids )
        	and plr.recordDisposition not in ( 'H', 'h' )
		]]>
	</query>

	<!-- Patient Query with Dates -->
	<query name="ProblemListRead2.HealthConcern.healthConcerns.date">
		<![CDATA[ 
        	from ProblemListRead2 plr
        	where plr.patient.identifier.identity in ( :pids )
        	and plr.dateLastModified.timestamp between :startDate and :endDate
        	and plr.recordDisposition not in ( 'H', 'h' )
		]]>
	</query>

	<!-- Patient Query with Status -->
	<query name="ProblemListRead2.HealthConcern.healthConcerns.status">
		<![CDATA[ 
        	from ProblemListRead2 plr
        	where plr.patient.identifier.identity in ( :pids )
        	and plr.statusRef in (:status)
        	and plr.recordDisposition not in ( 'H', 'h' )
		]]>
	</query>

	<!-- Patient Query with Dates and Status -->
	<query name="ProblemListRead2.HealthConcern.healthConcerns.date.status">
		<![CDATA[ 
        	from ProblemListRead2 plr
        	where plr.patient.identifier.identity in ( :pids )
        	and plr.dateLastModified.timestamp between :startDate and :endDate
        	and plr.statusRef in (:status)
        	and plr.recordDisposition not in ( 'H', 'h' )
		]]>
	</query>

	<!-- Patient Query with Condition -->
	<query name="ProblemListRead2.HealthConcern.healthConcerns.condition">
		<![CDATA[ 
        	from ProblemListRead2 plr
        	where plr.patient.identifier.identity in ( :pids )
        	and ( plr.recordDisposition not in ( :condition ) or plr.recordDisposition in ( :condition ) or plr.recordDisposition is null )
		]]>
	</query>

	<!-- Patient Query with Dates and Condition -->
	<query name="ProblemListRead2.HealthConcern.healthConcerns.date.condition">
		<![CDATA[ 
        	from ProblemListRead2 plr
        	where plr.patient.identifier.identity in ( :pids )
        	and plr.dateLastModified.timestamp between :startDate and :endDate
        	and ( plr.recordDisposition not in ( :condition ) or plr.recordDisposition in ( :condition ) or plr.recordDisposition is null )
		]]>
	</query>

	<!-- Patient Query with Status and Condition -->
	<query name="ProblemListRead2.HealthConcern.healthConcerns.status.condition">
		<![CDATA[ 
        	from ProblemListRead2 plr
        	where plr.patient.identifier.identity in ( :pids )
        	and plr.statusRef in (:status)
        	and ( plr.recordDisposition not in ( :condition ) or plr.recordDisposition in ( :condition ) or plr.recordDisposition is null )
		]]>
	</query>

	<!-- Patient Query with Condition and Status -->
	<query name="ProblemListRead2.HealthConcern.healthConcerns.condition.status">
		<![CDATA[ 
        	from ProblemListRead2 plr
        	where plr.patient.identifier.identity in ( :pids )
        	and ( plr.recordDisposition not in ( :condition ) or plr.recordDisposition in ( :condition ) or plr.recordDisposition is null )
        	and plr.statusRef in (:status)
		]]>
	</query>

	<!-- Patient Query with Dates, Status, and Condition -->
	<query name="ProblemListRead2.HealthConcern.healthConcerns.date.status.condition">
		<![CDATA[ 
        	from ProblemListRead2 plr
        	where plr.patient.identifier.identity in ( :pids )
        	and plr.dateLastModified.timestamp between :startDate and :endDate
        	and plr.statusRef in (:status)
        	and ( plr.recordDisposition not in ( :condition ) or plr.recordDisposition in ( :condition ) or plr.recordDisposition is null )
		]]>
	</query>

	<!-- Patient Query with Dates, Condition, and Status -->
	<query name="ProblemListRead2.HealthConcern.healthConcerns.date.condition.status">
		<![CDATA[ 
        	from ProblemListRead2 plr
        	where plr.patient.identifier.identity in ( :pids )
        	and plr.dateLastModified.timestamp between :startDate and :endDate
        	and ( plr.recordDisposition not in ( :condition ) or plr.recordDisposition in ( :condition ) or plr.recordDisposition is null )
        	and plr.statusRef in (:status)
		]]>
	</query>

</hibernate-mapping>	
