Circle V2 API Docs
Preparing search index...
@repo/legacy
chart-review
PatientAdmissionsRepo
Class PatientAdmissionsRepo
Hierarchy (
View Summary
)
DbRepo
PatientAdmissionsRepo
Index
Constructors
constructor
Properties
supabase
Methods
create
get
Active
Admissions
By
Integration
Id
get
All
For
Integration
get
By
External
Admission
Id
get
By
Id
get
By
Patient
Id
get
By
Patient
Id
With
Integration
get
Ids
By
Patient
And
Integration
get
Latest
By
Patient
Id
get
Maybe
Latest
By
Patient
Id
list
By
Id
move
To
Patient
By
Ids
update
upsert
with
Db
Constructors
constructor
new
PatientAdmissionsRepo
(
options
:
DbRepoOptions
)
:
PatientAdmissionsRepo
Parameters
options
:
DbRepoOptions
Returns
PatientAdmissionsRepo
Properties
Protected
Readonly
supabase
supabase
:
SupabaseClient
<
Database
>
Methods
create
create
(
patientAdmission
:
{
admitted_at
:
string
;
created_at
?:
string
;
discharged_at
?:
string
|
null
;
external_admission_id
?:
string
|
null
;
id
?:
number
;
integration_id
?:
string
|
null
;
last_sync
?:
string
|
null
;
level_of_care_id
?:
number
|
null
;
patient_id
?:
number
|
null
;
updated_at
?:
string
;
}
,
)
:
Promise
<
{
admitted_at
:
string
;
created_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
last_sync
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient_id
:
number
|
null
;
updated_at
:
string
;
}
,
>
Parameters
patientAdmission
:
{
admitted_at
:
string
;
created_at
?:
string
;
discharged_at
?:
string
|
null
;
external_admission_id
?:
string
|
null
;
id
?:
number
;
integration_id
?:
string
|
null
;
last_sync
?:
string
|
null
;
level_of_care_id
?:
number
|
null
;
patient_id
?:
number
|
null
;
updated_at
?:
string
;
}
Returns
Promise
<
{
admitted_at
:
string
;
created_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
last_sync
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient_id
:
number
|
null
;
updated_at
:
string
;
}
,
>
get
Active
Admissions
By
Integration
Id
getActiveAdmissionsByIntegrationId
(
integrationId
:
string
,
)
:
Promise
<
{
admitted_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient
:
{
entity_id
:
number
|
null
;
facility_id
:
string
|
null
}
;
patient_id
:
number
|
null
;
patient_utilization_reviews
:
{
end_date
:
string
|
null
;
id
:
string
;
start_date
:
string
|
null
;
}
[]
;
}
[]
,
>
Parameters
integrationId
:
string
Returns
Promise
<
{
admitted_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient
:
{
entity_id
:
number
|
null
;
facility_id
:
string
|
null
}
;
patient_id
:
number
|
null
;
patient_utilization_reviews
:
{
end_date
:
string
|
null
;
id
:
string
;
start_date
:
string
|
null
;
}
[]
;
}
[]
,
>
get
All
For
Integration
getAllForIntegration
(
patientId
:
number
,
integrationId
:
string
,
)
:
Promise
<
PatientAdmissionWithLevelOfCare
[]
>
Parameters
patientId
:
number
integrationId
:
string
Returns
Promise
<
PatientAdmissionWithLevelOfCare
[]
>
get
By
External
Admission
Id
getByExternalAdmissionId
(
externalAdmissionId
:
string
,
)
:
Promise
<
{
admitted_at
:
string
;
created_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
last_sync
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient_id
:
number
|
null
;
updated_at
:
string
;
}
[]
,
>
Parameters
externalAdmissionId
:
string
Returns
Promise
<
{
admitted_at
:
string
;
created_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
last_sync
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient_id
:
number
|
null
;
updated_at
:
string
;
}
[]
,
>
get
By
Id
getById
(
patientAdmissionId
:
number
,
)
:
Promise
<
{
admitted_at
:
string
;
created_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
last_sync
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient_id
:
number
|
null
;
updated_at
:
string
;
}
,
>
Parameters
patientAdmissionId
:
number
Returns
Promise
<
{
admitted_at
:
string
;
created_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
last_sync
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient_id
:
number
|
null
;
updated_at
:
string
;
}
,
>
get
By
Patient
Id
getByPatientId
(
patientId
:
number
,
)
:
Promise
<
{
admitted_at
:
string
;
created_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
last_sync
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient_id
:
number
|
null
;
updated_at
:
string
;
}
[]
,
>
Parameters
patientId
:
number
Returns
Promise
<
{
admitted_at
:
string
;
created_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
last_sync
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient_id
:
number
|
null
;
updated_at
:
string
;
}
[]
,
>
get
By
Patient
Id
With
Integration
getByPatientIdWithIntegration
(
patientId
:
number
,
)
:
Promise
<
{
admitted_at
:
string
;
created_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
integrations
:
{
facility_id
:
string
|
null
;
id
:
string
}
;
last_sync
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient_id
:
number
|
null
;
updated_at
:
string
;
}
[]
,
>
Get admissions for a patient with their integration's facility_id.
Parameters
patientId
:
number
Returns
Promise
<
{
admitted_at
:
string
;
created_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
integrations
:
{
facility_id
:
string
|
null
;
id
:
string
}
;
last_sync
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient_id
:
number
|
null
;
updated_at
:
string
;
}
[]
,
>
get
Ids
By
Patient
And
Integration
getIdsByPatientAndIntegration
(
patientId
:
number
,
integrationId
:
string
,
)
:
Promise
<
number
[]
>
Parameters
patientId
:
number
integrationId
:
string
Returns
Promise
<
number
[]
>
get
Latest
By
Patient
Id
getLatestByPatientId
(
patientId
:
number
,
)
:
Promise
<
{
admitted_at
:
string
;
created_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
last_sync
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient_id
:
number
|
null
;
updated_at
:
string
;
}
,
>
Parameters
patientId
:
number
Returns
Promise
<
{
admitted_at
:
string
;
created_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
last_sync
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient_id
:
number
|
null
;
updated_at
:
string
;
}
,
>
get
Maybe
Latest
By
Patient
Id
getMaybeLatestByPatientId
(
patientId
:
number
,
)
:
Promise
<
|
{
admitted_at
:
string
;
created_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
last_sync
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient_id
:
number
|
null
;
updated_at
:
string
;
}
|
null
,
>
Parameters
patientId
:
number
Returns
Promise
<
|
{
admitted_at
:
string
;
created_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
last_sync
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient_id
:
number
|
null
;
updated_at
:
string
;
}
|
null
,
>
list
By
Id
listById
(
admissionIds
:
number
[]
,
)
:
Promise
<
{
admitted_at
:
string
;
created_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
last_sync
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient_id
:
number
|
null
;
updated_at
:
string
;
}
[]
,
>
Parameters
admissionIds
:
number
[]
Returns
Promise
<
{
admitted_at
:
string
;
created_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
last_sync
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient_id
:
number
|
null
;
updated_at
:
string
;
}
[]
,
>
move
To
Patient
By
Ids
moveToPatientByIds
(
ids
:
number
[]
,
targetPatientId
:
number
)
:
Promise
<
number
[]
>
Parameters
ids
:
number
[]
targetPatientId
:
number
Returns
Promise
<
number
[]
>
update
update
(
id
:
number
,
params
:
{
admitted_at
?:
string
;
created_at
?:
string
;
discharged_at
?:
string
|
null
;
external_admission_id
?:
string
|
null
;
id
?:
number
;
integration_id
?:
string
|
null
;
last_sync
?:
string
|
null
;
level_of_care_id
?:
number
|
null
;
patient_id
?:
number
|
null
;
updated_at
?:
string
;
}
,
)
:
Promise
<
{
admitted_at
:
string
;
created_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
last_sync
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient_id
:
number
|
null
;
updated_at
:
string
;
}
,
>
Parameters
id
:
number
params
:
{
admitted_at
?:
string
;
created_at
?:
string
;
discharged_at
?:
string
|
null
;
external_admission_id
?:
string
|
null
;
id
?:
number
;
integration_id
?:
string
|
null
;
last_sync
?:
string
|
null
;
level_of_care_id
?:
number
|
null
;
patient_id
?:
number
|
null
;
updated_at
?:
string
;
}
Returns
Promise
<
{
admitted_at
:
string
;
created_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
last_sync
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient_id
:
number
|
null
;
updated_at
:
string
;
}
,
>
upsert
upsert
(
params
:
{
admitted_at
:
string
;
created_at
?:
string
;
discharged_at
?:
string
|
null
;
external_admission_id
?:
string
|
null
;
id
?:
number
;
integration_id
?:
string
|
null
;
last_sync
?:
string
|
null
;
level_of_care_id
?:
number
|
null
;
patient_id
?:
number
|
null
;
updated_at
?:
string
;
}
,
)
:
Promise
<
{
admitted_at
:
string
;
created_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
last_sync
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient_id
:
number
|
null
;
updated_at
:
string
;
}
,
>
Parameters
params
:
{
admitted_at
:
string
;
created_at
?:
string
;
discharged_at
?:
string
|
null
;
external_admission_id
?:
string
|
null
;
id
?:
number
;
integration_id
?:
string
|
null
;
last_sync
?:
string
|
null
;
level_of_care_id
?:
number
|
null
;
patient_id
?:
number
|
null
;
updated_at
?:
string
;
}
Returns
Promise
<
{
admitted_at
:
string
;
created_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
last_sync
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient_id
:
number
|
null
;
updated_at
:
string
;
}
,
>
upsert
(
params
:
{
admitted_at
:
string
;
created_at
?:
string
;
discharged_at
?:
string
|
null
;
external_admission_id
?:
string
|
null
;
id
?:
number
;
integration_id
?:
string
|
null
;
last_sync
?:
string
|
null
;
level_of_care_id
?:
number
|
null
;
patient_id
?:
number
|
null
;
updated_at
?:
string
;
}
[]
,
)
:
Promise
<
{
admitted_at
:
string
;
created_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
last_sync
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient_id
:
number
|
null
;
updated_at
:
string
;
}
[]
,
>
Parameters
params
:
{
admitted_at
:
string
;
created_at
?:
string
;
discharged_at
?:
string
|
null
;
external_admission_id
?:
string
|
null
;
id
?:
number
;
integration_id
?:
string
|
null
;
last_sync
?:
string
|
null
;
level_of_care_id
?:
number
|
null
;
patient_id
?:
number
|
null
;
updated_at
?:
string
;
}
[]
Returns
Promise
<
{
admitted_at
:
string
;
created_at
:
string
;
discharged_at
:
string
|
null
;
external_admission_id
:
string
|
null
;
id
:
number
;
integration_id
:
string
|
null
;
last_sync
:
string
|
null
;
level_of_care_id
:
number
|
null
;
patient_id
:
number
|
null
;
updated_at
:
string
;
}
[]
,
>
with
Db
withDb
(
options
:
{
supabase
:
SupabaseClient
<
Database
>
}
)
:
this
Parameters
options
:
{
supabase
:
SupabaseClient
<
Database
>
}
Returns
this
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Properties
supabase
Methods
create
get
Active
Admissions
By
Integration
Id
get
All
For
Integration
get
By
External
Admission
Id
get
By
Id
get
By
Patient
Id
get
By
Patient
Id
With
Integration
get
Ids
By
Patient
And
Integration
get
Latest
By
Patient
Id
get
Maybe
Latest
By
Patient
Id
list
By
Id
move
To
Patient
By
Ids
update
upsert
with
Db
Circle V2 API Docs
Loading...
Get admissions for a patient with their integration's facility_id.