Interface I_EhrAccess
- All Superinterfaces:
I_SimpleCRUD
- All Known Implementing Classes:
EhrAccess
Ehr access layer
This interface deals with the main Ehr table as well as Status. Status provides the information related to the actual Ehr owner (eg. patient or Named Subject generally). Created by Christian Chevalley on 4/21/2015.
This interface deals with the main Ehr table as well as Status. Status provides the information related to the actual Ehr owner (eg. patient or Named Subject generally). Created by Christian Chevalley on 4/21/2015.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidInvoke physical deletion.static booleancheckExist(I_DomainAccess domainAccess, UUID partyId) fetchSubjectIdentifiers(I_DomainAccess domainAccess, UUID ehrId) retrieve the list of identifiers for a subject owning an Ehr
the identifiers are formatted as: "CODE:ISSUER"getCompositionList(I_DomainAccess domainAccess, UUID ehrId) TODO: docgetId()static I_EhrAccessgetInstance(I_DomainAccess domain, UUID partyId, UUID systemId, UUID accessId, UUID ehrId, String tenantIdentifier) get a new Ehr access layer instancecom.nedap.archie.rm.datastructures.ItemStructuregetParty()com.nedap.archie.rm.ehr.EhrStatusGets latest EHR_STATUS, which is attached to this EHR instance after retrieving it.static booleanhasEhr(I_DomainAccess domainAccess, UUID ehrId) Check for existence of given ID as EHR.static BooleanisModifiable(I_DomainAccess domainAccess, UUID ehrId) Check if the EHR identified by the given ID is marked as modifiable.booleanisNew()check if Ehr is newly created (uncommitted)reload()TODO: doc or is this one really not needed anymore? delete if so.static I_EhrAccessretrieveInstance(I_DomainAccess domainAccess, UUID ehrId) Retrieve the Ehr entry from its ID (incl latest STATUS).static I_EhrAccessretrieveInstanceByStatus(I_DomainAccess domainAccess, UUID ehrId, UUID status, int version) retrieve an Ehr for a known status entrystatic UUIDretrieveInstanceBySubject(I_DomainAccess domainAccess, String subjectId, String issuerSpace) // TODO: keep! likely to be used by EHR controller retrieve an Ehr for a subject identification with an identifier
a subject identification consists of the issuer identification (ex.static UUIDretrieveInstanceBySubject(I_DomainAccess domainAccess, UUID subjectUuid) // TODO: keep! likely to be used by EHR controller retrieve an Ehr for a subject UUID
a subject identification consists of the issuer identification (ex.static UUIDretrieveInstanceBySubjectExternalRef(I_DomainAccess domainAccess, String subjectId, String issuerSpace) // TODO: keep! likely to be used by EHR controller retrieve an Ehr for a subject identification by external reference
a subject identification consists of the issuer identification (ex.voidset access idvoidsetArchetypeNodeId(String archetypeNodeId) voidsetContributionAccess(I_ContributionAccess contributionAccess) voidsetModifiable(Boolean modifiable) voidsetName(com.nedap.archie.rm.datavalues.DvCodedText name) voidsetName(com.nedap.archie.rm.datavalues.DvText name) voidsetOtherDetails(com.nedap.archie.rm.datastructures.ItemStructure otherDetails, String templateId) voidvoidsetQueryable(Boolean queryable) voidsetStatus(com.nedap.archie.rm.ehr.EhrStatus status) voidsetStatusAccess(I_StatusAccess statusAccess) voidset system Idupdate(UUID committerId, UUID systemId, UUID contributionId, ContributionDef.ContributionState state, I_ConceptAccess.ContributionChangeType contributionChangeType, String description, UUID audit) Updates the whole EHR access in the DB, e.g.
-
Field Details
-
TAG_TEMPLATE_ID
- See Also:
-
-
Method Details
-
getInstance
static I_EhrAccess getInstance(I_DomainAccess domain, UUID partyId, UUID systemId, UUID accessId, UUID ehrId, String tenantIdentifier) get a new Ehr access layer instance- Parameters:
domain- SQL accesspartyId- owner UUID (patient)systemId- system on which the Ehr is initiated (UUID)accessId- optional access strategy IdehrId- optional custom ehrID- Returns:
- I_EhrAccess
- Throws:
InternalServerException- if creating or retrieving system failed
-
retrieveInstanceBySubject
static UUID retrieveInstanceBySubject(I_DomainAccess domainAccess, String subjectId, String issuerSpace) // TODO: keep! likely to be used by EHR controller retrieve an Ehr for a subject identification with an identifier
a subject identification consists of the issuer identification (ex. NHS) and an identification code- Parameters:
domainAccess- SQL accesssubjectId- the subject code or numberissuerSpace- the issuer identifier- Returns:
- UUID of corresponding Ehr or null
- Throws:
IllegalArgumentException- if retrieving failed for given input
-
retrieveInstanceBySubject
// TODO: keep! likely to be used by EHR controller retrieve an Ehr for a subject UUID
a subject identification consists of the issuer identification (ex. NHS) and an identification code- Parameters:
domainAccess- SQL accesssubjectUuid- the subject uuid- Returns:
- UUID of corresponding Ehr or null
- Throws:
IllegalArgumentException- if retrieving failed for given input
-
retrieveInstanceBySubjectExternalRef
static UUID retrieveInstanceBySubjectExternalRef(I_DomainAccess domainAccess, String subjectId, String issuerSpace) // TODO: keep! likely to be used by EHR controller retrieve an Ehr for a subject identification by external reference
a subject identification consists of the issuer identification (ex. NHS) and an identification code- Parameters:
domainAccess- SQL accesssubjectId- the subject code or numberissuerSpace- the namespace- Returns:
- UUID of corresponding Ehr or null
- Throws:
IllegalArgumentException- if retrieving failed for given input
-
retrieveInstanceByStatus
static I_EhrAccess retrieveInstanceByStatus(I_DomainAccess domainAccess, UUID ehrId, UUID status, int version) retrieve an Ehr for a known status entry- Parameters:
domainAccess- SQL accessehrId- EHR ID of current contextstatus- status UUIDversion- optional version, will assume latest if null- Returns:
- UUID of corresponding Ehr or null
- Throws:
IllegalArgumentException- if retrieving failed for given input
-
checkExist
-
retrieveInstance
Retrieve the Ehr entry from its ID (incl latest STATUS).- Parameters:
domainAccess- SQL accessehrId- the Ehr UUID- Returns:
- UUID of corresponding Ehr or null
- Throws:
IllegalArgumentException- when either no EHR for ID, or problem with data structure of EHR, or DB inconsistency
-
fetchSubjectIdentifiers
retrieve the list of identifiers for a subject owning an Ehr
the identifiers are formatted as: "CODE:ISSUER"- Parameters:
domainAccess- SQL accessehrId- the Ehr Id to search the subject from- Returns:
- a list of identifiers
- Throws:
IllegalArgumentException- when no EHR found for ID
-
getCompositionList
TODO: doc- Parameters:
domainAccess-ehrId-- Returns:
- Throws:
IllegalArgumentException- when no EHR found for ID
-
setModifiable
-
setArchetypeNodeId
-
getArchetypeNodeId
String getArchetypeNodeId() -
setName
void setName(com.nedap.archie.rm.datavalues.DvText name) -
setName
void setName(com.nedap.archie.rm.datavalues.DvCodedText name) -
setQueryable
-
commit
-
update
Boolean update(UUID committerId, UUID systemId, UUID contributionId, ContributionDef.ContributionState state, I_ConceptAccess.ContributionChangeType contributionChangeType, String description, UUID audit) Updates the whole EHR access in the DB, e.g. to update the status. Embeds contribution and audit handling.- Parameters:
committerId- ID of committersystemId- ID of committing systemcontributionId- Optional custom contribution ID, can be nullstate- State of contributioncontributionChangeType- Change type of contributiondescription- Description fieldaudit-- Returns:
- True for success
- Throws:
InvalidApiParameterException- when marshalling of EHR_STATUS / OTHER_DETAILS failed
-
setAccess
set access id- Parameters:
access- UUID
-
setSystem
set system Id- Parameters:
system- UUID
-
reload
UUID reload()TODO: doc or is this one really not needed anymore? delete if so.- Returns:
- Throws:
IllegalArgumentException- when instance's EHR ID can't be matched to existing one
-
isNew
boolean isNew()check if Ehr is newly created (uncommitted)- Returns:
- true if new, false otherwise
-
getParty
UUID getParty() -
setParty
-
getId
UUID getId() -
isModifiable
Boolean isModifiable() -
isQueryable
Boolean isQueryable() -
getSystemId
UUID getSystemId() -
getStatusId
UUID getStatusId() -
getAccessId
UUID getAccessId() -
setContributionAccess
-
getStatusAccess
I_StatusAccess getStatusAccess() -
setStatusAccess
-
setOtherDetails
void setOtherDetails(com.nedap.archie.rm.datastructures.ItemStructure otherDetails, String templateId) -
getOtherDetails
com.nedap.archie.rm.datastructures.ItemStructure getOtherDetails() -
getEhrRecord
EhrRecord getEhrRecord() -
setStatus
void setStatus(com.nedap.archie.rm.ehr.EhrStatus status) -
getStatus
com.nedap.archie.rm.ehr.EhrStatus getStatus()Gets latest EHR_STATUS, which is attached to this EHR instance after retrieving it.- Returns:
- Latest EHR_STATUS
-
adminDeleteEhr
void adminDeleteEhr()Invoke physical deletion. -
hasEhr
Check for existence of given ID as EHR.- Parameters:
domainAccess- ContextehrId- EHR ID to check- Returns:
- true or false
-
isModifiable
Check if the EHR identified by the given ID is marked as modifiable. Use this method if you do not need a full I_EhrAccess instance.- Parameters:
domainAccess- ContextehrId- EHR ID to check- Returns:
- true if EHR.ehr_status.isModifiable, false if not, null if EHR does not exist
-