Class StatusAccess

    • Constructor Detail

    • Method Detail

      • commit

        public UUID commit​(LocalDateTime timestamp,
                           UUID committerId,
                           UUID systemId,
                           String description)
        Description copied from interface: I_VersionedCRUD
        Commit the object with the necessary metadata.
        Specified by:
        commit in interface I_VersionedCRUD
        Parameters:
        timestamp - Time of operation
        committerId - Audit committer
        systemId - Audit system
        description - (Optional) Audit description
        Returns:
        ID of object
      • commit

        public UUID commit​(LocalDateTime timestamp,
                           UUID contribution)
        Description copied from interface: I_VersionedCRUD
        Commit the object with the necessary metadata, which will be derived from the contribution.
        Specified by:
        commit in interface I_VersionedCRUD
        Parameters:
        timestamp - Time of operation
        contribution - Given contribution to use and derive audit data from
        Returns:
        ID of object
      • update

        public boolean update​(LocalDateTime timestamp,
                              UUID committerId,
                              UUID systemId,
                              String description,
                              I_ConceptAccess.ContributionChangeType changeType)
        Description copied from interface: I_VersionedCRUD
        Update the object with the necessary metadata.
        Specified by:
        update in interface I_VersionedCRUD
        Parameters:
        timestamp - Time of operation
        committerId - Audit committer
        systemId - Audit system
        description - (Optional) Audit description
        changeType - Specific change type, because there are more than DELETED.
        Returns:
        Boolean representing success of update
      • update

        public boolean update​(LocalDateTime timestamp,
                              UUID contribution)
        Description copied from interface: I_VersionedCRUD
        Update the object with the necessary metadata, which will be derived from the contribution.
        Specified by:
        update in interface I_VersionedCRUD
        Parameters:
        timestamp - Time of operation
        contribution - Given contribution to use and derive audit data from
        Returns:
        Boolean representing success of update
      • delete

        public int delete​(LocalDateTime timestamp,
                          UUID committerId,
                          UUID systemId,
                          String description)
        Description copied from interface: I_VersionedCRUD
        Delete the object with the necessary metadata.
        Specified by:
        delete in interface I_VersionedCRUD
        Parameters:
        timestamp - Time of operation
        committerId - Audit committer
        systemId - Audit system
        description - (Optional) Audit description
        Returns:
        Number of deleted objects
      • delete

        public int delete​(LocalDateTime timestamp,
                          UUID contribution)
        Description copied from interface: I_VersionedCRUD
        Delete the object with the necessary metadata, which will be derived from the contribution.
        Specified by:
        delete in interface I_VersionedCRUD
        Parameters:
        timestamp - Time of operation
        contribution - Given contribution to use and derive audit data from
        Returns:
        Number of deleted objects
      • retrieveInstance

        public static I_StatusAccess retrieveInstance​(I_DomainAccess domainAccess,
                                                      UUID statusId)
        Description copied from interface: I_StatusAccess
        retrieve a status by given status ID
        Parameters:
        domainAccess - SQL access
        statusId - Id of an status to retrieve
        Returns:
        UUID or null
      • retrieveInstanceByNamedSubject

        public static I_StatusAccess retrieveInstanceByNamedSubject​(I_DomainAccess domainAccess,
                                                                    String partyName)
        Description copied from interface: I_StatusAccess
        retrieve a status for a named subject (patient)
        NB. for security reason, most deployment will not provide an explicit subject name, this method is provided for small deployment or test purpose.
        Parameters:
        domainAccess - SQL access
        partyName - a subject name
        Returns:
        UUID or null
      • retrieveInstanceByParty

        public static I_StatusAccess retrieveInstanceByParty​(I_DomainAccess domainAccess,
                                                             UUID partyIdentified)
        Description copied from interface: I_StatusAccess
        retrieve a status by an identified party id
        Parameters:
        domainAccess - SQL access
        partyIdentified - Id of an identified party
        Returns:
        UUID or null
      • retrieveInstanceByEhrId

        public static I_StatusAccess retrieveInstanceByEhrId​(I_DomainAccess domainAccess,
                                                             UUID ehrId)
        Description copied from interface: I_StatusAccess
        retrieve latest status by given EHR ID
        Parameters:
        domainAccess - SQL access
        ehrId - Id of associated EHR
        Returns:
        UUID or null
      • retrieveInstanceByContribution

        public static Map<com.nedap.archie.rm.support.identification.ObjectVersionId,​I_StatusAccess> retrieveInstanceByContribution​(I_DomainAccess domainAccess,
                                                                                                                                          UUID contributionId,
                                                                                                                                          String node)
        Description copied from interface: I_StatusAccess
        Retrieve a map of status accesses for all statuses referencing a contribution
        Parameters:
        domainAccess - SQL context, knowledge
        contributionId - contribution object uuid
        node - Name of local node, for creation of object version ID
        Returns:
        a map of I_StatusAccess and their version ID, that match the condition
      • getVersionMapOfStatus

        public static Map<Integer,​I_StatusAccess> getVersionMapOfStatus​(I_DomainAccess domainAccess,
                                                                              UUID statusId)
        Description copied from interface: I_StatusAccess
        Get complete version list, mapped to their version number.
        Parameters:
        domainAccess - Access
        Returns:
      • historyRecToNormalRec

        protected static StatusRecord historyRecToNormalRec​(StatusHistoryRecord statusHistoryRecord)
        Helper method to convert result from query on history table to a record of the normal table.
        Parameters:
        statusHistoryRecord - Given history record
        Returns:
        Converted normal record
      • getLatestVersionNumber

        public static Integer getLatestVersionNumber​(I_DomainAccess domainAccess,
                                                     UUID statusId)
        Description copied from interface: I_StatusAccess
        Get latest version number of EHR_STATUS by versioned object UID.
        Parameters:
        domainAccess - access
        statusId - versioned object UID
        Returns:
        version number
      • exists

        public static boolean exists​(I_DomainAccess domainAccess,
                                     UUID ehrStatusId)
        Description copied from interface: I_StatusAccess
        Checks existence of given EHR_STATUS.
        Parameters:
        domainAccess - domain access
        ehrStatusId - given EHR_STATUS
        Returns:
        True if object with ID exists, false if not
      • getEhrStatusVersionFromTimeStamp

        public int getEhrStatusVersionFromTimeStamp​(Timestamp time)
        Description copied from interface: I_StatusAccess
        Get a specific version number of the associated EHR_STATUS of this instance by timestamp. General idea behind the algorithm: 'what version was the top version at moment T?'
        Specified by:
        getEhrStatusVersionFromTimeStamp in interface I_StatusAccess
        Parameters:
        time - Timestamp
        Returns:
        version number
      • getStatus

        public com.nedap.archie.rm.ehr.EhrStatus getStatus()
        Description copied from interface: I_StatusAccess
        Get current record as EhrStatus representation.
        Specified by:
        getStatus in interface I_StatusAccess
        Returns:
        Current status object
      • setOtherDetails

        public void setOtherDetails​(com.nedap.archie.rm.datastructures.ItemStructure otherDetails)
        Specified by:
        setOtherDetails in interface I_StatusAccess
      • getOtherDetails

        public com.nedap.archie.rm.datastructures.ItemStructure getOtherDetails()
        Specified by:
        getOtherDetails in interface I_StatusAccess