# Class CheckInactivePatientsJob

Namespace
  adas_core.Application.Services

Assembly
  adas-core.Application.dll

Represents a scheduled job that checks for inactive patients.

    [DisallowConcurrentExecution]
    public class CheckInactivePatientsJob : IJob

Inheritance
  object
  CheckInactivePatientsJob

Implements
  IJob

Inherited Members
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)
  object.ToString()

Extension Methods
  NumberUtils.IsNumber(object)
  NumberUtils.ToDouble(object)
  ObjectUtils.ToStr(object?)

## Remarks

The DisallowConcurrentExecution attribute prevents multiple instances of this job from running simultaneously.

## Properties

### PatientService

    public static IPatientService PatientService { get; set; }

#### Property Value

IPatientService

## Methods

### Execute(IJobExecutionContext)

Executes the scheduled job that discharges patients who have been inactive (without observations) for a configured period of hours. Skips processing when another instance is already running, as indicated by the global `isCheckingInactivePatients` flag, and logs the elapsed execution time.

    public Task Execute(IJobExecutionContext context)

#### Parameters

`context` IJobExecutionContext

  The Quartz job execution context whose Quartz.IJobExecutionContext.JobDetail data map supplies the inactivity and discharge thresholds.

#### Returns

Task