Skip to content

SQL-110: EbillPatientQueryProvider.GetPatient

This statement is a read operation invoked through ORM (NHibernate LINQ). Executed by EbillPatientQueryProvider.GetPatient.

Classification

Field Value
SQL ID SQL-110
Operation type Read
Execution method ORM (NHibernate LINQ)
Database Oracle*
Schema [unqualified]**
Command type N/A (ORM-generated)
Business object EbillPatientQueryProvider
Criteria property N/A — ORM
Lifecycle method GetPatient

Parameters

Parameter Direction Type Max length Description
patientId Input long N/A Method argument of EbillPatientQueryProvider.GetPatient bound into the ORM expression; NHibernate generates the bind variable at runtime

Tables

Table Access Columns used
EBILL_PATIENT SELECT EBILL_PATIENT_SEQ_NUM, UPDATE_NUM, SUBSCRIBER_NAME, SUBSCRIBER_LEVEL_NUMBER, PATIENT_LEVEL_NUMBER, CLAIM_NUM, BIRTH_DATE, GENDER_CODE, PATIENT_LAST_NAME, PATIENT_FIRST_NAME, PATIENT_MIDDLE_NAME, PATIENT_NAME_EXTENSION, PATIENT_ID, PATIENT_TAX_ID, UPDATE_USER, UPDATE_DATE, CLAIM_ID, EBILL_PROVIDER_SEQ_NUM, SUBSCRIBER_ADDRESS_SEQ_NUM, PATIENT_ADDRESS_SEQ_NUM

LINQ statement

Source: Data/SAIF.Data/Queries/Claims/Ebilling/EbillPatientQueryProvider.cs:20

// Data/SAIF.Data/Queries/Claims/Ebilling/EbillPatientQueryProvider.cs:15
repository = Factory.GetRepository<EbillPatient>().Query();

// Data/SAIF.Data/Queries/Claims/Ebilling/EbillPatientQueryProvider.cs:20
return repository.FirstOrDefault(p => p.Id == patientId);

Sample SQL

Inferred SQL: This SQL was inferred from the LINQ statement above and the NHibernate mappings. It is not concrete SQL from source code; NHibernate generates the executed statement at runtime, so aliases, column order, join syntax, and bind-parameter names may differ.

-- Inferred from LINQ (NHibernate mapping translation); not concrete SQL
SELECT *
FROM (
  SELECT
    EP.EBILL_PATIENT_SEQ_NUM,
    EP.UPDATE_NUM,
    EP.SUBSCRIBER_NAME,
    EP.SUBSCRIBER_LEVEL_NUMBER,
    EP.PATIENT_LEVEL_NUMBER,
    EP.CLAIM_NUM,
    EP.BIRTH_DATE,
    EP.GENDER_CODE,
    EP.PATIENT_LAST_NAME,
    EP.PATIENT_FIRST_NAME,
    EP.PATIENT_MIDDLE_NAME,
    EP.PATIENT_NAME_EXTENSION,
    EP.PATIENT_ID,
    EP.PATIENT_TAX_ID,
    EP.UPDATE_USER,
    EP.UPDATE_DATE,
    EP.CLAIM_ID,
    EP.EBILL_PROVIDER_SEQ_NUM,
    EP.SUBSCRIBER_ADDRESS_SEQ_NUM,
    EP.PATIENT_ADDRESS_SEQ_NUM
  FROM EBILL_PATIENT EP
  WHERE EP.EBILL_PATIENT_SEQ_NUM = :patientId
)
WHERE ROWNUM <= 1

Translation notes:

  • Oracle10 row limit for FirstOrDefault(): the query (including any ORDER BY) is wrapped in ROWNUM <= 1 (limit written inline; NHibernate binds it as a parameter at runtime).

Operations and processes

Sources

  • Data/SAIF.Data/Queries/Claims/Ebilling/EbillPatientQueryProvider.cs:20