public class Encounter extends BaseOpenmrsData implements java.io.Serializable
Obs
,
Order
,
Serialized FormModifier and Type | Field and Description |
---|---|
static long |
serialVersionUID |
creator
Constructor and Description |
---|
Encounter()
default constructor
|
Encounter(java.lang.Integer encounterId) |
Modifier and Type | Method and Description |
---|---|
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.
|
java.util.Set<EncounterProvider> |
getActiveEncounterProviders()
Returns only the non-voided encounter providers for this encounter.
|
java.util.Set<Obs> |
getAllObs()
Convenience method to call
getAllObs(boolean) with a false parameter |
java.util.Set<Obs> |
getAllObs(boolean includeVoided)
Returns all Obs where Obs.encounterId = Encounter.encounterId In practice, this method should
not be used very often...
|
java.util.Date |
getEncounterDatetime() |
java.lang.Integer |
getEncounterId() |
java.util.Set<EncounterProvider> |
getEncounterProviders()
Basic property accessor for encounterProviders.
|
EncounterType |
getEncounterType() |
Form |
getForm() |
java.lang.Integer |
getId() |
Location |
getLocation() |
java.util.Set<Obs> |
getObs() |
java.util.Set<Obs> |
getObsAtTopLevel(boolean includeVoided)
Returns a Set
|
java.util.Set<Order> |
getOrders() |
Patient |
getPatient() |
java.lang.Integer |
getPatientId()
Deprecated.
due to duplication. Use Encounter.Patient instead
|
Person |
getProvider()
Deprecated.
since 1.9, use
getProvidersByRole(EncounterRole) |
java.util.Set<Provider> |
getProvidersByRole(EncounterRole role)
Gets unvoided providers who had the given role in this encounter.
|
java.util.Set<Provider> |
getProvidersByRole(EncounterRole role,
boolean includeVoided)
Gets providers who had the given role in this encounter.
|
java.util.Map<EncounterRole,java.util.Set<Provider>> |
getProvidersByRoles()
Gets all unvoided providers, grouped by role.
|
java.util.Map<EncounterRole,java.util.Set<Provider>> |
getProvidersByRoles(boolean includeVoided)
Gets all providers, grouped by role.
|
Visit |
getVisit()
Gets the visit.
|
void |
removeObs(Obs observation)
Remove the given observation from the list of obs for this Encounter
|
void |
removeOrder(Order order)
Remove the given observation from the list of orders for this Encounter
|
void |
removeProvider(EncounterRole role,
Provider provider)
Removes the provider for a given role.
|
void |
setEncounterDatetime(java.util.Date encounterDatetime) |
void |
setEncounterId(java.lang.Integer encounterId) |
void |
setEncounterProviders(java.util.Set<EncounterProvider> encounterProviders)
Basic property setter for encounterProviders.
|
void |
setEncounterType(EncounterType encounterType) |
void |
setForm(Form form) |
void |
setId(java.lang.Integer id) |
void |
setLocation(Location location) |
void |
setObs(java.util.Set<Obs> obs) |
void |
setOrders(java.util.Set<Order> orders) |
void |
setPatient(Patient patient) |
void |
setPatientId(java.lang.Integer patientId)
Deprecated.
due to duplication. Use Encounter.Patient instead
|
void |
setProvider(EncounterRole role,
Provider provider)
Sets the provider for the given role.
|
void |
setProvider(Person provider)
Deprecated.
since 1.9, use
setProvider(EncounterRole, Provider) |
void |
setProvider(User provider)
Deprecated.
|
void |
setVisit(Visit visit)
Sets the visit
|
java.lang.String |
toString()
Returns a string consisting of the name of the class of which the object is an instance and
the
uuid field surrounded by [ and ] . |
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(java.lang.Integer encounterId)
encounterId
- public java.util.Date getEncounterDatetime()
public void setEncounterDatetime(java.util.Date encounterDatetime)
encounterDatetime
- The encounterDatetime to set.public java.lang.Integer getEncounterId()
public void setEncounterId(java.lang.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 java.util.Set<Obs> getObs()
public java.util.Set<Obs> getAllObs(boolean includeVoided)
includeVoided
- specifies whether or not to include voided Obspublic java.util.Set<Obs> getAllObs()
getAllObs(boolean)
with a false parameterpublic java.util.Set<Obs> getObsAtTopLevel(boolean includeVoided)
includeVoided
- specifies whether or not to include voided Obspublic void setObs(java.util.Set<Obs> obs)
obs
- The obs to set.public void addObs(Obs observation)
observation
- the Obs to add to this encounterpublic void removeObs(Obs observation)
observation
- public java.util.Set<Order> getOrders()
public void setOrders(java.util.Set<Order> orders)
orders
- The orders to set.public void addOrder(Order order)
order
- public void removeOrder(Order order)
order
- public Patient getPatient()
public void setPatient(Patient patient)
patient
- The patient to set.@Deprecated public java.lang.Integer getPatientId()
@Deprecated public void setPatientId(java.lang.Integer patientId)
patientId
- the patientId to setpublic java.util.Set<EncounterProvider> getEncounterProviders()
getProvidersByRole(EncounterRole)
,
getProvidersByRoles()
public void setEncounterProviders(java.util.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 java.util.Set<EncounterProvider> getActiveEncounterProviders()
getEncounterProviders()
getEncounterProviders()
public Person getProvider()
getProvidersByRole(EncounterRole)
public void setProvider(User provider)
setProvider(Person)
provider
- The provider to set.public void setProvider(Person provider)
setProvider(EncounterRole, Provider)
provider
- The provider to set.public Form getForm()
public void setForm(Form form)
form
- The form to set.public java.lang.String toString()
BaseOpenmrsObject
uuid
field surrounded by [
and ]
. In other words,
this method returns a string equal to the value of: getClass().getName() + '[' + uuid + ']'
If the uuid
field is null
, it delegates to
Object.toString()
toString
in class BaseOpenmrsObject
Object.toString()
public java.lang.Integer getId()
getId
in interface OpenmrsObject
OpenmrsObject.getId()
public void setId(java.lang.Integer id)
setId
in interface OpenmrsObject
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 java.util.Map<EncounterRole,java.util.Set<Provider>> getProvidersByRoles()
public java.util.Map<EncounterRole,java.util.Set<Provider>> getProvidersByRoles(boolean includeVoided)
includeVoided
- set to true to include voided providers, else set to falsepublic java.util.Set<Provider> getProvidersByRole(EncounterRole role)
role
- public java.util.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.Copyright © 2018 OpenMRS Inc.. All Rights Reserved.