public interface DiagnosisService extends OpenmrsService
API methods for managing diagnoses
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
|
List<Diagnosis> |
getPrimaryDiagnoses(Encounter encounter)
Deprecated.
since 2.5.0, use
getDiagnosesByEncounter(org.openmrs.Encounter, boolean, boolean) |
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
|
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
@Authorized(value="Edit Diagnoses") Diagnosis save(Diagnosis diagnosis)
diagnosis
- - the diagnosis to be saved@Authorized(value="Edit Diagnoses") Diagnosis voidDiagnosis(Diagnosis diagnosis, String voidReason)
diagnosis
- - the diagnosis to be voidedvoidReason
- - the reason for voiding the diagnosis@Authorized(value="Get Diagnoses") Diagnosis getDiagnosisByUuid(String uuid)
uuid
- - uuid of the diagnosis to be returned@Authorized(value="Get Diagnoses") List<Diagnosis> getDiagnoses(Patient patient, Date fromDate)
patient
- the patient whose diagnosis we are to getfromDate
- the date used to filter diagnosis which happened from this date and later@Authorized(value="Get Diagnoses") List<Diagnosis> getDiagnosesByEncounter(Encounter encounter, boolean primaryOnly, boolean confirmedOnly)
encounter
- the encounter for which to fetch diagnosesprimaryOnly
- whether to return only primary diagnosesconfirmedOnly
- whether to return only confirmed diagnoses@Authorized(value="Get Diagnoses") List<Diagnosis> getDiagnosesByVisit(Visit visit, boolean primaryOnly, boolean confirmedOnly)
visit
- the visit for which to fetch diagnosesprimaryOnly
- whether to return only primary diagnosesconfirmedOnly
- whether to return only confirmed diagnoses@Deprecated List<Diagnosis> getPrimaryDiagnoses(Encounter encounter)
getDiagnosesByEncounter(org.openmrs.Encounter, boolean, boolean)
encounter
- the encounter whose diagnoses we are to getList<Diagnosis> getUniqueDiagnoses(Patient patient, Date fromDate)
patient
- the patient whose diagnosis we are to getfromDate
- the date used to filter diagnosis which happened from this date and later@Authorized(value="Get Diagnoses") Diagnosis getDiagnosis(Integer diagnosisId)
diagnosisId
- - id of the diagnosis to be returned@Authorized(value="Edit Diagnoses") Diagnosis unvoidDiagnosis(Diagnosis diagnosis) throws APIException
diagnosis
- diagnosis to unvoidAPIException
- Should unset voided bit on given diagnosis@Authorized(value="Delete Diagnoses") void purgeDiagnosis(Diagnosis diagnosis) throws APIException
diagnosis
- diagnosis to remove from the databaseAPIException
Should delete the given diagnosis from th e database
@Authorized(value="Get Diagnoses Attribute Types") List<DiagnosisAttributeType> getAllDiagnosisAttributeTypes() throws APIException
DiagnosisAttributeType
sAPIException
@Authorized(value="Get Diagnoses Attribute Types") DiagnosisAttributeType getDiagnosisAttributeTypeById(Integer id) throws APIException
id
- the id of the diagnosis attribute type to fetchDiagnosisAttributeType
with the given idAPIException
@Authorized(value="Get Diagnoses Attribute Types") DiagnosisAttributeType getDiagnosisAttributeTypeByUuid(String uuid) throws APIException
uuid
- the uuid of the diagnosis attribute type to fetchDiagnosisAttributeType
with the given uuidAPIException
@Authorized(value="Edit Diagnoses") DiagnosisAttributeType saveDiagnosisAttributeType(DiagnosisAttributeType diagnosisAttributeType) throws APIException
diagnosisAttributeType
- the diagnosis attribute type to save or updateAPIException
@Authorized(value="Edit Diagnoses") DiagnosisAttributeType retireDiagnosisAttributeType(DiagnosisAttributeType diagnosisAttributeType, String reason) throws APIException
diagnosisAttributeType
- the diagnosis attribute type to retirereason
- the reason why the diagnosis attribute type is being retiredAPIException
@Authorized(value="Edit Diagnoses") DiagnosisAttributeType unretireDiagnosisAttributeType(DiagnosisAttributeType diagnosisAttributeType) throws APIException
diagnosisAttributeType
- the diagnosis attribute type to unretire.APIException
@Authorized(value="Delete Diagnoses") void purgeDiagnosisAttributeType(DiagnosisAttributeType diagnosisAttributeType) throws APIException
diagnosisAttributeType
- the diagnosis attribute type to purgeAPIException
@Authorized(value="Get Diagnoses") DiagnosisAttribute getDiagnosisAttributeByUuid(String uuid) throws APIException
uuid
- the uuid of the diagnosis attribute to fetchDiagnosisAttribute
with the given uuidAPIException
Copyright © 2024 OpenMRS Inc.. All rights reserved.