View Javadoc
1   package ca.uhn.fhir.jpa.dao.data;
2   
3   import ca.uhn.fhir.jpa.entity.TermConceptParentChildLink;
4   import org.springframework.data.domain.Pageable;
5   import org.springframework.data.domain.Slice;
6   import org.springframework.data.jpa.repository.JpaRepository;
7   import org.springframework.data.jpa.repository.Query;
8   import org.springframework.data.repository.query.Param;
9   
10  import java.util.Collection;
11  
12  /*
13   * #%L
14   * HAPI FHIR JPA Server
15   * %%
16   * Copyright (C) 2014 - 2018 University Health Network
17   * %%
18   * Licensed under the Apache License, Version 2.0 (the "License");
19   * you may not use this file except in compliance with the License.
20   * You may obtain a copy of the License at
21   * 
22   *      http://www.apache.org/licenses/LICENSE-2.0
23   * 
24   * Unless required by applicable law or agreed to in writing, software
25   * distributed under the License is distributed on an "AS IS" BASIS,
26   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27   * See the License for the specific language governing permissions and
28   * limitations under the License.
29   * #L%
30   */
31  
32  public interface ITermConceptParentChildLinkDao extends JpaRepository<TermConceptParentChildLink, Long> {
33  
34  	@Query("SELECT COUNT(t) FROM TermConceptParentChildLink t WHERE t.myCodeSystem.myId = :cs_pid")
35  	Integer countByCodeSystemVersion(@Param("cs_pid") Long thePid);
36  
37  	@Query("SELECT t.myParentPid FROM TermConceptParentChildLink t WHERE t.myChildPid = :child_pid")
38  	Collection<Long> findAllWithChild(@Param("child_pid") Long theConceptPid);
39  
40  	@Query("SELECT t FROM TermConceptParentChildLink t WHERE t.myCodeSystem.myId = :cs_pid")
41  	Slice<TermConceptParentChildLink> findByCodeSystemVersion(Pageable thePage, @Param("cs_pid") Long thePid);
42  
43  }