@Transactional public class DiagnosisServiceImpl extends BaseOpenmrsService implements DiagnosisService
Constructor and Description |
---|
DiagnosisServiceImpl() |
Modifier and Type | Method and Description |
---|---|
List<DiagnosisAttributeType> |
getAllDiagnosisAttributeTypes()
Fetches all diagnosis attribute types including retired ones.
|
List<Diagnosis> |
getDiagnoses(Patient patient,
Date fromDate)
Gets diagnoses since date, sorted in reverse chronological order
|
List<Diagnosis> |
getDiagnosesByEncounter(Encounter encounter,
boolean primaryOnly,
boolean confirmedOnly)
Gets diagnoses for an Encounter.
|
List<Diagnosis> |
getDiagnosesByVisit(Visit visit,
boolean primaryOnly,
boolean confirmedOnly)
Gets diagnoses for a Visit.
|
Diagnosis |
getDiagnosis(Integer diagnosisId)
Gets a diagnosis by id.
|
DiagnosisAttribute |
getDiagnosisAttributeByUuid(String uuid)
Fetches a given diagnosis attribute using the provided uuid
|
DiagnosisAttributeType |
getDiagnosisAttributeTypeById(Integer id)
Fetches a given diagnosis attribute type using the provided id
|
DiagnosisAttributeType |
getDiagnosisAttributeTypeByUuid(String uuid)
Fetches a given diagnosis attribute type using the provided uuid
|
Diagnosis |
getDiagnosisByUuid(String uuid)
Gets a diagnosis based on the uuid
|
DiagnosisDAO |
getDiagnosisDAO()
Gets the diagnosis data access object
|
List<Diagnosis> |
getPrimaryDiagnoses(Encounter encounter)
Finds the primary diagnoses for a given encounter
The diagnosis order is identified using the integer rank value.
|
List<Diagnosis> |
getUniqueDiagnoses(Patient patient,
Date fromDate)
Gets unique diagnoses since date, sorted in reverse chronological order
|
void |
purgeDiagnosis(Diagnosis diagnosis)
Completely remove a diagnosis from the database.
|
void |
purgeDiagnosisAttributeType(DiagnosisAttributeType diagnosisAttributeType)
Completely removes a diagnosis attribute type from the database
|
DiagnosisAttributeType |
retireDiagnosisAttributeType(DiagnosisAttributeType diagnosisAttributeType,
String reason)
Retires the given diagnosis attribute type in the database
|
Diagnosis |
save(Diagnosis diagnosis)
Saves a diagnosis
|
DiagnosisAttributeType |
saveDiagnosisAttributeType(DiagnosisAttributeType diagnosisAttributeType)
Creates or updates the given diagnosis attribute type in the database
|
void |
setDiagnosisDAO(DiagnosisDAO diagnosisDAO)
Sets the diagnosis data access object
|
DiagnosisAttributeType |
unretireDiagnosisAttributeType(DiagnosisAttributeType diagnosisAttributeType)
Restores a diagnosis attribute type that was previously retired
|
Diagnosis |
unvoidDiagnosis(Diagnosis diagnosis)
Revive a diagnosis (pull a Lazarus)
|
Diagnosis |
voidDiagnosis(Diagnosis diagnosis,
String voidReason)
Voids a diagnosis
|
onShutdown, onStartup
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onShutdown, onStartup
public Diagnosis save(Diagnosis diagnosis)
save
in interface DiagnosisService
diagnosis
- - the diagnosis to be savedpublic Diagnosis voidDiagnosis(Diagnosis diagnosis, String voidReason)
voidDiagnosis
in interface DiagnosisService
diagnosis
- - the diagnosis to be voidedvoidReason
- - the reason for voiding the diagnosispublic Diagnosis getDiagnosisByUuid(String uuid)
getDiagnosisByUuid
in interface DiagnosisService
uuid
- - uuid of the diagnosis to be returned@Transactional(readOnly=true) public List<Diagnosis> getDiagnoses(Patient patient, Date fromDate)
getDiagnoses
in interface DiagnosisService
patient
- the patient whose diagnosis we are to getfromDate
- the date used to filter diagnosis which happened from this date and later@Transactional(readOnly=true) public List<Diagnosis> getDiagnosesByEncounter(Encounter encounter, boolean primaryOnly, boolean confirmedOnly)
DiagnosisService
getDiagnosesByEncounter
in interface DiagnosisService
encounter
- the encounter for which to fetch diagnosesprimaryOnly
- whether to return only primary diagnosesconfirmedOnly
- whether to return only confirmed diagnosesDiagnosisService.getDiagnosesByEncounter(Encounter, boolean, boolean)
@Transactional(readOnly=true) public List<Diagnosis> getDiagnosesByVisit(Visit visit, boolean primaryOnly, boolean confirmedOnly)
DiagnosisService
getDiagnosesByVisit
in interface DiagnosisService
visit
- the visit for which to fetch diagnosesprimaryOnly
- whether to return only primary diagnosesconfirmedOnly
- whether to return only confirmed diagnosesDiagnosisService.getDiagnosesByVisit(Visit, boolean, boolean)
@Transactional(readOnly=true) public List<Diagnosis> getPrimaryDiagnoses(Encounter encounter)
getPrimaryDiagnoses
in interface DiagnosisService
encounter
- the encounter whose diagnoses we are to get@Transactional(readOnly=true) public List<Diagnosis> getUniqueDiagnoses(Patient patient, Date fromDate)
getUniqueDiagnoses
in interface DiagnosisService
patient
- the patient whose diagnosis we are to getfromDate
- the date used to filter diagnosis which happened from this date and later@Transactional(readOnly=true) public Diagnosis getDiagnosis(Integer diagnosisId)
getDiagnosis
in interface DiagnosisService
diagnosisId
- - id of the diagnosis to be returnedpublic Diagnosis unvoidDiagnosis(Diagnosis diagnosis)
unvoidDiagnosis
in interface DiagnosisService
diagnosis
- diagnosis to unvoidAPIException
- Should unset voided bit on given diagnosispublic void purgeDiagnosis(Diagnosis diagnosis)
purgeDiagnosis
in interface DiagnosisService
diagnosis
- diagnosis to remove from the databaseAPIException
- Should delete the given diagnosis from th e databasepurgeDiagnosis(Diagnosis)
public DiagnosisDAO getDiagnosisDAO()
public void setDiagnosisDAO(DiagnosisDAO diagnosisDAO)
diagnosisDAO
- @Transactional(readOnly=true) public List<DiagnosisAttributeType> getAllDiagnosisAttributeTypes() throws APIException
DiagnosisService
getAllDiagnosisAttributeTypes
in interface DiagnosisService
DiagnosisAttributeType
sAPIException
DiagnosisService.getAllDiagnosisAttributeTypes()
@Transactional(readOnly=true) public DiagnosisAttributeType getDiagnosisAttributeTypeById(Integer id) throws APIException
DiagnosisService
getDiagnosisAttributeTypeById
in interface DiagnosisService
id
- the id of the diagnosis attribute type to fetchDiagnosisAttributeType
with the given idAPIException
DiagnosisService.getDiagnosisAttributeTypeById(Integer)
@Transactional(readOnly=true) public DiagnosisAttributeType getDiagnosisAttributeTypeByUuid(String uuid) throws APIException
DiagnosisService
getDiagnosisAttributeTypeByUuid
in interface DiagnosisService
uuid
- the uuid of the diagnosis attribute type to fetchDiagnosisAttributeType
with the given uuidAPIException
DiagnosisService.getDiagnosisAttributeTypeByUuid(String)
public DiagnosisAttributeType saveDiagnosisAttributeType(DiagnosisAttributeType diagnosisAttributeType) throws APIException
DiagnosisService
saveDiagnosisAttributeType
in interface DiagnosisService
diagnosisAttributeType
- the diagnosis attribute type to save or updateAPIException
DiagnosisService.saveDiagnosisAttributeType(DiagnosisAttributeType)
public DiagnosisAttributeType retireDiagnosisAttributeType(DiagnosisAttributeType diagnosisAttributeType, String reason) throws APIException
DiagnosisService
retireDiagnosisAttributeType
in interface DiagnosisService
diagnosisAttributeType
- the diagnosis attribute type to retirereason
- the reason why the diagnosis attribute type is being retiredAPIException
DiagnosisService.retireDiagnosisAttributeType(DiagnosisAttributeType, String)
public DiagnosisAttributeType unretireDiagnosisAttributeType(DiagnosisAttributeType diagnosisAttributeType) throws APIException
DiagnosisService
unretireDiagnosisAttributeType
in interface DiagnosisService
diagnosisAttributeType
- the diagnosis attribute type to unretire.APIException
DiagnosisService.unretireDiagnosisAttributeType(DiagnosisAttributeType)
public void purgeDiagnosisAttributeType(DiagnosisAttributeType diagnosisAttributeType) throws APIException
DiagnosisService
purgeDiagnosisAttributeType
in interface DiagnosisService
diagnosisAttributeType
- the diagnosis attribute type to purgeAPIException
DiagnosisService.purgeDiagnosisAttributeType(DiagnosisAttributeType)
@Transactional(readOnly=true) public DiagnosisAttribute getDiagnosisAttributeByUuid(String uuid) throws APIException
DiagnosisService
getDiagnosisAttributeByUuid
in interface DiagnosisService
uuid
- the uuid of the diagnosis attribute to fetchDiagnosisAttribute
with the given uuidAPIException
DiagnosisService.getDiagnosisAttributeByUuid(String)
Copyright © 2024 OpenMRS Inc.. All rights reserved.