@Entity public class Encounter extends BaseChangeableOpenmrsData
Obs
,
Order
,
Serialized FormModifier and Type | Field and Description |
---|---|
static long |
serialVersionUID |
creator
Constructor and Description |
---|
Encounter()
default constructor
|
Encounter(Integer encounterId) |
Modifier and Type | Method and Description |
---|---|
void |
addAllergy(Allergy allergy)
Add the given allergy to the set of allergies for this encounter.
|
void |
addCondition(Condition condition)
Add the given condition to the set of conditions for this encounter.
|
void |
addObs(Obs observation)
Add the given Obs to the list of obs for this Encounter.
|
void |
addOrder(Order order)
Add the given Order to the list of orders for this Encounter
|
void |
addProvider(EncounterRole role,
Provider provider)
Adds a new provider for the encounter, with the given role.
|
Encounter |
copyAndAssignToAnotherPatient(Patient patient)
Copied encounter will not have visit field copied.
|
Set<EncounterProvider> |
getActiveEncounterProviders()
Returns only the non-voided encounter providers for this encounter.
|
Set<Allergy> |
getAllergies()
Basic property getter for the encounter's non-voided allergies.
|
Set<Allergy> |
getAllergies(boolean includeVoided)
Returns all allergies where 'Allergy.encounterId = Encounter.encounterId'.
|
Set<Obs> |
getAllFlattenedObs(boolean includeVoided)
Returns all encounter obs as a flatten list(Set) of obs.
|
Set<Obs> |
getAllObs()
Convenience method to call
getAllObs(boolean) with a false parameter |
Set<Obs> |
getAllObs(boolean includeVoided)
Returns all Obs where Obs.encounterId = Encounter.encounterId In practice, this method should
not be used very often...
|
Set<Condition> |
getConditions()
Basic property getter for the encounter's non-voided conditions.
|
Set<Condition> |
getConditions(boolean includeVoided)
Returns all conditions where 'Condition.encounterId = Encounter.encounterId'.
|
Set<Diagnosis> |
getDiagnoses()
Gets the set of diagnoses
|
Date |
getEncounterDatetime() |
Integer |
getEncounterId() |
Set<EncounterProvider> |
getEncounterProviders()
Basic property accessor for encounterProviders.
|
EncounterType |
getEncounterType() |
Form |
getForm() |
Integer |
getId() |
Location |
getLocation() |
Set<Obs> |
getObs() |
Set<Obs> |
getObsAtTopLevel(boolean includeVoided)
Returns a Set<Obs> of all root-level Obs of an Encounter, including obsGroups
|
List<OrderGroup> |
getOrderGroups()
Takes in a list of orders and pulls out the orderGroups within them
|
Set<Order> |
getOrders() |
List<Order> |
getOrdersWithoutOrderGroups()
Takes in a list of orders and filters out the orders which have orderGroups
|
Patient |
getPatient() |
Set<Provider> |
getProvidersByRole(EncounterRole role)
Gets unvoided providers who had the given role in this encounter.
|
Set<Provider> |
getProvidersByRole(EncounterRole role,
boolean includeVoided)
Gets providers who had the given role in this encounter.
|
Map<EncounterRole,Set<Provider>> |
getProvidersByRoles()
Gets all unvoided providers, grouped by role.
|
Map<EncounterRole,Set<Provider>> |
getProvidersByRoles(boolean includeVoided)
Gets all providers, grouped by role.
|
Visit |
getVisit()
Gets the visit.
|
Boolean |
hasDiagnosis(Diagnosis diagnosis)
Check if encounter has a particular diagnosis
|
void |
removeAllergy(Allergy allergy)
Remove the given allergy from the set of allergies for this encounter.
|
void |
removeCondition(Condition condition)
Remove the given condition from the set of conditions for this encounter.
|
void |
removeObs(Obs observation)
Remove the given observation from the list of obs for this Encounter
|
void |
removeOrder(Order order)
Remove the given order from the list of orders for this Encounter
|
void |
removeProvider(EncounterRole role,
Provider provider)
Removes the provider for a given role.
|
void |
setAllergies(Set<Allergy> allergies)
Basic property setter for allergies
|
void |
setConditions(Set<Condition> conditions)
Basic property setter for conditions
|
void |
setDiagnoses(Set<Diagnosis> diagnoses)
Sets a set of diagnoses for the current Encounter
|
void |
setEncounterDatetime(Date encounterDatetime) |
void |
setEncounterId(Integer encounterId) |
void |
setEncounterProviders(Set<EncounterProvider> encounterProviders)
Basic property setter for encounterProviders.
|
void |
setEncounterType(EncounterType encounterType) |
void |
setForm(Form form) |
void |
setId(Integer id) |
void |
setLocation(Location location) |
void |
setObs(Set<Obs> obs) |
void |
setOrders(Set<Order> orders) |
void |
setPatient(Patient patient) |
void |
setProvider(EncounterRole role,
Provider provider)
Sets the provider for the given role.
|
void |
setVisit(Visit visit)
Sets the visit
|
String |
toString()
Returns a string equal to the value of: ClassName{hashCode=...,
uuid=...}
|
getChangedBy, getCreator, getDateChanged, getDateCreated, getDateVoided, getVoided, getVoidedBy, getVoidReason, isVoided, setChangedBy, setCreator, setDateChanged, setDateCreated, setDateVoided, setVoided, setVoidedBy, setVoidReason
equals, getUuid, hashCode, setUuid
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getUuid, setUuid
public static final long serialVersionUID
public Encounter()
public Encounter(Integer encounterId)
encounterId
- Should set encounter idpublic Date getEncounterDatetime()
public void setEncounterDatetime(Date encounterDatetime)
encounterDatetime
- The encounterDatetime to set.public Integer getEncounterId()
public void setEncounterId(Integer encounterId)
encounterId
- The encounterId to set.public EncounterType getEncounterType()
public void setEncounterType(EncounterType encounterType)
encounterType
- The encounterType to set.public Location getLocation()
public void setLocation(Location location)
location
- The location to set.public Set<Obs> getObs()
public Set<Obs> getAllObs(boolean includeVoided)
includeVoided
- specifies whether or not to include voided Obspublic Set<Obs> getAllObs()
getAllObs(boolean)
with a false parameterpublic Set<Obs> getAllFlattenedObs(boolean includeVoided)
includeVoided
- indicates whether or not to include voided obspublic Set<Obs> getObsAtTopLevel(boolean includeVoided)
includeVoided
- specifies whether or not to include voided Obspublic void addObs(Obs observation)
observation
- the Obs to add to this encounter
Should add obs with null values
Should not fail with null obs
Should set encounter attribute on obs
Should add obs to non null initial obs set
Should add encounter attrs to obs if attributes are null
Should add encounter attrs to obs groupMembers if attributes are nullpublic void removeObs(Obs observation)
observation
- Should remove obs successfully
Should not throw error when removing null obs from empty set
Should not throw error when removing null obs from non empty setpublic void addOrder(Order order)
order
- Should add order with null values
Should not fail with null obs passed to add order
Should set encounter attribute
Should add order to non null initial order set
Should add order to encounter when adding order to set returned from getOrderspublic void removeOrder(Order order)
order
- Should remove order from encounter
Should not fail when removing null order
Should not fail when removing non existent orderpublic Patient getPatient()
public void setPatient(Patient patient)
patient
- The patient to set.public Set<Diagnosis> getDiagnoses()
public void setDiagnoses(Set<Diagnosis> diagnoses)
diagnoses
- the set of Diagnosis to set.public Set<Condition> getConditions()
public Set<Condition> getConditions(boolean includeVoided)
includeVoided
- - Specifies whether or not to include voided conditions.public void setConditions(Set<Condition> conditions)
conditions
- - set of conditionspublic void addCondition(Condition condition)
condition
- - the condition to addpublic void removeCondition(Condition condition)
condition
- - the condition to removepublic Set<EncounterProvider> getEncounterProviders()
getProvidersByRole(EncounterRole)
,
getProvidersByRoles()
public void setEncounterProviders(Set<EncounterProvider> encounterProviders)
encounterProviders
- the list of EncounterProvider objects to set. Overwrites list as
normal setter is inclined to doaddProvider(EncounterRole, Provider)
,
removeProvider(EncounterRole, Provider)
,
setProvider(EncounterRole, Provider)
public Set<EncounterProvider> getActiveEncounterProviders()
getEncounterProviders()
getEncounterProviders()
public Form getForm()
public void setForm(Form form)
form
- The form to set.public String toString()
BaseOpenmrsObject
ClassName{hashCode=..., uuid=...}
If the uuid
field is null
, it returns:
ClassName{hashCode=...}Should include hashCode if uuid is null Should include uuid if not null
toString
in class BaseOpenmrsObject
Should not fail with empty object
public Integer getId()
OpenmrsObject.getId()
public void setId(Integer id)
id
- - The unique Identifier for the objectOpenmrsObject.setId(java.lang.Integer)
public Visit getVisit()
public void setVisit(Visit visit)
visit
- the visit to set.public Map<EncounterRole,Set<Provider>> getProvidersByRoles()
public Map<EncounterRole,Set<Provider>> getProvidersByRoles(boolean includeVoided)
includeVoided
- set to true to include voided providers, else set to falsepublic Set<Provider> getProvidersByRole(EncounterRole role)
role
- public Set<Provider> getProvidersByRole(EncounterRole role, boolean includeVoided)
role
- includeVoided
- set to true to include voided providers, else set to falsepublic void addProvider(EncounterRole role, Provider provider)
role
- provider
- public void setProvider(EncounterRole role, Provider provider)
If the encounter already had any providers for the given role, those are removed.
role
- provider
- public void removeProvider(EncounterRole role, Provider provider)
role
- the role.provider
- the provider.public Encounter copyAndAssignToAnotherPatient(Patient patient)
patient
- the Patient that will be assign to copied Encounterpublic List<OrderGroup> getOrderGroups()
public List<Order> getOrdersWithoutOrderGroups()
public Boolean hasDiagnosis(Diagnosis diagnosis)
diagnosis
- the diagnosis to check if it belongs to this given encounterpublic Set<Allergy> getAllergies()
public Set<Allergy> getAllergies(boolean includeVoided)
includeVoided
- - Specifies whether or not to include voided allergies.public void setAllergies(Set<Allergy> allergies)
allergies
- - set of allergiespublic void addAllergy(Allergy allergy)
allergy
- - the allergy to addpublic void removeAllergy(Allergy allergy)
allergy
- - the allergy to removeCopyright © 2024 OpenMRS Inc.. All rights reserved.