-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,805 changed files
with
93,409 additions
and
62,091 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,4 @@ src/main/resources/uiResources_*.properties | |
.settings/ | ||
.vscode/ | ||
tmp/ | ||
.aider* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.oscarehr.common.dao; | ||
|
||
import java.util.Date; | ||
import java.util.List; | ||
import org.oscarehr.common.PaginationQuery; | ||
import org.oscarehr.common.model.ConsultationRequest; | ||
import org.oscarehr.consultations.ConsultationQuery; | ||
import org.oscarehr.consultations.ConsultationRequestSearchFilter; | ||
|
||
public interface ConsultRequestDao extends AbstractDao<ConsultationRequest> { | ||
|
||
int getConsultationCount(PaginationQuery paginationQuery); | ||
|
||
List<ConsultationRequest> listConsultationRequests(ConsultationQuery consultationQuery); | ||
|
||
int getConsultationCount2(ConsultationRequestSearchFilter filter); | ||
|
||
List<Object[]> search(ConsultationRequestSearchFilter filter); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.oscarehr.common.dao; | ||
|
||
import java.util.Date; | ||
import java.util.List; | ||
import javax.persistence.Query; | ||
import org.apache.commons.lang.StringEscapeUtils; | ||
import org.apache.commons.lang.StringUtils; | ||
import org.apache.commons.lang.time.DateFormatUtils; | ||
import org.apache.commons.lang.time.FastDateFormat; | ||
import org.oscarehr.common.PaginationQuery; | ||
import org.oscarehr.common.model.ConsultationRequest; | ||
import org.oscarehr.consultations.ConsultationQuery; | ||
import org.oscarehr.consultations.ConsultationRequestSearchFilter; | ||
import org.oscarehr.consultations.ConsultationRequestSearchFilter.SORTMODE; | ||
import org.oscarehr.util.MiscUtils; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public class ConsultRequestDaoImpl extends AbstractDaoImpl<ConsultationRequest> implements ConsultRequestDao { | ||
|
||
public ConsultRequestDaoImpl() { | ||
super(ConsultationRequest.class); | ||
} | ||
|
||
// ... rest of the methods implementation | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.oscarehr.common.dao; | ||
|
||
import java.util.List; | ||
import org.oscarehr.common.model.CtlBillingService; | ||
|
||
public interface CtlBillingServiceDao extends AbstractDao<CtlBillingService> { | ||
List<CtlBillingService> findAll(); | ||
List<Object[]> getUniqueServiceTypes(String serviceStatus); | ||
List<Object[]> getUniqueServiceTypes(); | ||
List<CtlBillingService> findByServiceTypeId(String serviceTypeId); | ||
List<CtlBillingService> findByServiceGroupAndServiceTypeId(String serviceGroup, String serviceTypeId); | ||
List<CtlBillingService> findByServiceType(String serviceTypeId); | ||
List<CtlBillingService> getServiceTypeList(); | ||
List<Object[]> getAllServiceTypes(); | ||
List<CtlBillingService> findByServiceGroup(String serviceGroup); | ||
List<CtlBillingService> findByServiceGroupAndServiceType(String serviceGroup, String serviceType); | ||
List<Object[]> findUniqueServiceTypesByCode(String serviceCode); | ||
List<Object[]> findServiceTypes(); | ||
List<Object[]> findServiceTypesByStatus(String status); | ||
List<Object> findServiceCodesByType(String serviceType); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
package org.oscarehr.common.dao; | ||
|
||
import java.util.List; | ||
import javax.persistence.Query; | ||
import org.oscarehr.common.model.CtlBillingService; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
@SuppressWarnings("unchecked") | ||
public class CtlBillingServiceDaoImpl extends AbstractDaoImpl<CtlBillingService> implements CtlBillingServiceDao { | ||
|
||
public static final String DEFAULT_STATUS = "A"; | ||
|
||
public CtlBillingServiceDaoImpl() { | ||
super(CtlBillingService.class); | ||
} | ||
|
||
public List<CtlBillingService> findAll() { | ||
Query query = entityManager.createQuery("SELECT x FROM " + modelClass.getSimpleName() + " x"); | ||
List<CtlBillingService> results = query.getResultList(); | ||
return results; | ||
} | ||
|
||
/** | ||
* Gets distinct service type for services with the specific service status | ||
* | ||
* @param serviceStatus | ||
* Status of the service to be retrieved | ||
* @return | ||
* Returns list containing arrays of strings, where the first element represents the service type and the second element is the service type name. | ||
*/ | ||
public List<Object[]> getUniqueServiceTypes(String serviceStatus) { | ||
Query query = entityManager.createQuery("SELECT DISTINCT b.serviceType, b.serviceTypeName FROM CtlBillingService b WHERE b.status = :serviceStatus"); | ||
query.setParameter("serviceStatus", serviceStatus); | ||
|
||
|
||
List<Object[]> results = query.getResultList(); | ||
return results; | ||
} | ||
|
||
/** | ||
* Gets distinct service type for services with {@link #DEFAULT_STATUS} | ||
* | ||
* @return | ||
* Returns list containing arrays of strings, where the first element represents the service type code and the second element is the service type name. | ||
*/ | ||
public List<Object[]> getUniqueServiceTypes() { | ||
return getUniqueServiceTypes(DEFAULT_STATUS); | ||
} | ||
|
||
public List<CtlBillingService> findByServiceTypeId(String serviceTypeId) { | ||
Query query = entityManager.createQuery("select b from CtlBillingService b where b.status='A' and b.serviceType like ?"); | ||
query.setParameter(1, serviceTypeId); | ||
|
||
|
||
List<CtlBillingService> results = query.getResultList(); | ||
|
||
return results; | ||
} | ||
|
||
public List<CtlBillingService> findByServiceGroupAndServiceTypeId(String serviceGroup, String serviceTypeId) { | ||
Query query = entityManager.createQuery("select b from CtlBillingService b where b.status='A' and b.serviceGroup = ? and b.serviceType like ?"); | ||
query.setParameter(1, serviceGroup); | ||
query.setParameter(2, serviceTypeId); | ||
|
||
|
||
List<CtlBillingService> results = query.getResultList(); | ||
|
||
return results; | ||
} | ||
|
||
public List<CtlBillingService> findByServiceType(String serviceTypeId) { | ||
Query query = entityManager.createQuery("select b from CtlBillingService b where b.serviceType like ?"); | ||
query.setParameter(1, serviceTypeId); | ||
|
||
|
||
List<CtlBillingService> results = query.getResultList(); | ||
|
||
return results; | ||
} | ||
|
||
public List<CtlBillingService> getServiceTypeList() { | ||
Query query = entityManager.createQuery("SELECT bs FROM " + modelClass.getSimpleName() + " bs GROUP BY bs.serviceTypeName HAVING COUNT(bs.serviceTypeName) > -1"); | ||
List<CtlBillingService> results = query.getResultList(); | ||
return results; | ||
} | ||
|
||
/** | ||
* Gets all service type names and service types from the {@link CtlBillingService} instances. | ||
*/ | ||
|
||
public List<Object[]> getAllServiceTypes() { | ||
Query query = entityManager.createQuery("SELECT bs.serviceTypeName, bs.serviceType FROM " + modelClass.getSimpleName() + " bs GROUP BY bs.serviceType, bs.serviceTypeName"); | ||
return query.getResultList(); | ||
} | ||
|
||
/** | ||
* Gets all {@link CtlBillingService} instance with the specified service group | ||
* | ||
* @param serviceGroup | ||
* Service group to ge services for | ||
* @return | ||
* Returns all persistent services found | ||
*/ | ||
public List<CtlBillingService> findByServiceGroup(String serviceGroup) { | ||
return findByServiceGroupAndServiceType(serviceGroup, null); | ||
} | ||
|
||
/** | ||
* Gets all {@link CtlBillingService} instance with the specified service group | ||
* | ||
* @param serviceGroup | ||
* Service group to ge services for | ||
* @return | ||
* Returns all persistent services found | ||
*/ | ||
|
||
public List<CtlBillingService> findByServiceGroupAndServiceType(String serviceGroup, String serviceType) { | ||
StringBuilder buf = new StringBuilder("FROM " + modelClass.getSimpleName() + " bs WHERE bs.serviceGroup = :serviceGroup"); | ||
boolean isServiceTypeSpecified = serviceType != null; | ||
if (isServiceTypeSpecified) | ||
buf.append(" AND bs.serviceType = :serviceType"); | ||
Query query = entityManager.createQuery(buf.toString()); | ||
query.setParameter("serviceGroup", serviceGroup); | ||
if (isServiceTypeSpecified) | ||
query.setParameter("serviceType", serviceType); | ||
return query.getResultList(); | ||
} | ||
|
||
|
||
public List<Object[]> findUniqueServiceTypesByCode(String serviceCode) { | ||
String sql = "SELECT DISTINCT s.serviceTypeName, s.serviceType from CtlBillingService s " + | ||
"WHERE s.status='A' " + | ||
"AND s.serviceCode = :serviceCode"; | ||
Query query = entityManager.createQuery(sql); | ||
query.setParameter("serviceCode", serviceCode); | ||
return query.getResultList(); | ||
} | ||
|
||
public List<Object[]> findServiceTypes() { | ||
String sql = "SELECT DISTINCT s.serviceType, s.serviceTypeName FROM CtlBillingService s " + | ||
"WHERE s.status != 'D' " + | ||
"AND s.serviceType IS NOT NULL " + | ||
"AND LENGTH(TRIM(s.serviceType)) > 0"; | ||
Query query = entityManager.createQuery(sql); | ||
return query.getResultList(); | ||
} | ||
|
||
public List<Object[]> findServiceTypesByStatus(String status) { | ||
String sql = "SELECT DISTINCT s.serviceTypeName, s.serviceType " + | ||
"FROM CtlBillingService s " + | ||
"WHERE s.status = :status"; | ||
Query query = entityManager.createQuery(sql); | ||
query.setParameter("status", status); | ||
return query.getResultList(); | ||
} | ||
|
||
public List<Object> findServiceCodesByType(String serviceType) { | ||
String sql = "SELECT DISTINCT bs.serviceCode FROM CtlBillingService bs " + | ||
"WHERE bs.status <> 'D' " + | ||
"AND bs.serviceType = :serviceType"; | ||
Query query = entityManager.createQuery(sql); | ||
query.setParameter("serviceType", serviceType); | ||
return query.getResultList(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.oscarehr.common.dao; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import org.oscarehr.common.model.Document; | ||
import oscar.oscarLab.ca.on.LabResultData; | ||
|
||
public interface DocumentResultsDao extends AbstractDao<Document> { | ||
boolean isSentToValidProvider(String docNo); | ||
boolean isSentToProvider(String docNo, String providerNo); | ||
ArrayList<LabResultData> populateDocumentResultsDataOfAllProviders(String providerNo, String demographicNo, String status); | ||
ArrayList<LabResultData> populateDocumentResultsDataLinkToProvider(String providerNo, String demographicNo, String status); | ||
ArrayList<LabResultData> populateDocumentResultsData(String providerNo, String demographicNo, String status); | ||
List<Document> getPhotosByAppointmentNo(int appointmentNo); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.oscarehr.common.dao; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import javax.persistence.Query; | ||
import org.apache.commons.lang.StringUtils; | ||
import org.apache.logging.log4j.Logger; | ||
import org.oscarehr.common.model.Demographic; | ||
import org.oscarehr.common.model.Document; | ||
import org.oscarehr.common.model.ProviderInboxItem; | ||
import org.oscarehr.util.MiscUtils; | ||
import org.oscarehr.util.SpringUtils; | ||
import oscar.oscarLab.ca.on.CommonLabResultData; | ||
import oscar.oscarLab.ca.on.LabResultData; | ||
|
||
public class DocumentResultsDaoImpl extends AbstractDaoImpl<Document> implements DocumentResultsDao { | ||
|
||
Logger logger = org.oscarehr.util.MiscUtils.getLogger(); | ||
|
||
public DocumentResultsDaoImpl() { | ||
super(Document.class); | ||
} | ||
|
||
// ... rest of the methods implementation ... | ||
} |
Oops, something went wrong.