Skip to main content

Desktop Client Data Model

Module: suredms-desktop-client-data
Source root: SC/suredms-desktop-client-data/src/main/java/com/sureclinical/suredms/

This module defines the shared domain entity hierarchy for all desktop client modules. It provides plain Java (POJO) representations of every clinical data concept — archives, documents, users, persons, organizations, content types, metadata, annotations, discrepancies, and forms. It has no framework annotations, no UI components, and no network logic.

Purpose

suredms-desktop-client-data is the leaf dependency of the desktop module graph. Every other desktop module imports it. The connector module populates entity instances by reading XML (local mode) or deserializing Nuxeo API responses (remote mode). The shell and quality modules consume those instances to build the UI.

Package Structure

PackageContents
com.sureclinical.suredms.entity40+ entity classes and interfaces
com.sureclinical.suredms.commonShared enums, flags, constants, and utility types
com.sureclinical.suredms.endpointsIEndPoints interface referenced by Archive
com.sureclinical.suredms.utilEntity utility helpers

Entity Hierarchy

IBaseEntity
└── BaseEntity (abstract)
└── TaxonEntity (abstract)
├── Archive
│ ├── CloudArchive
│ ├── ImagingArchive
│ └── QualityArchive
├── Document
├── Category / ContentType
├── Person
├── Organization
├── PersonRole / OrganizationRole
├── User
├── DocDiscrepancy
├── Audit
└── NewsItem

Core Entity Reference

BaseEntity

SC/suredms-desktop-client-data/src/main/java/com/sureclinical/suredms/entity/BaseEntity.java

Abstract root of all entities. Implements IBaseEntity, Comparable<BaseEntity>, and EditableEntity.

Internal infrastructure:

  • OBJECT_FACTORIES: Map<String, EntFactory> — registry mapping Nuxeo document type strings to entity constructors. Populated by each entity's static register() block.
  • LOADED_OBJECTS: Map<String, BaseEntity> — concurrent cache of all live entities by external ID.
  • instanceId — monotonically incrementing AtomicLong used by LeakDetector.

Key fields:

FieldTypePurpose
entTypeStringNuxeo document type (e.g., "SureDocs_Archive")
dbDocorg.nuxeo.ecm.automation.client.jaxrs.model.DocumentRaw Nuxeo document; null in local mode
dcModifiedEDateDublinCore last-modified date
dcCreatedEDateDublinCore creation date
dcCreatorStringUsername of creator
pathStringNuxeo repository path
isDetachedbooleanEntity removed from active graph; updates ignored
isModifiedbooleanDirty flag for deferred sync

All entities have a BaseEntity.save(Session) method that writes changes back to Nuxeo in remote mode.

Archive

SC/suredms-desktop-client-data/src/main/java/com/sureclinical/suredms/entity/Archive.java

Extends TaxonEntity. Represents one SureDrive or study container.

Key fields:

FieldTypePurpose
identifierStringInternal archive ID
nameStringDisplay name
duplicationPolicyDuplicationPolicyControls duplicate document behavior
contentModelVersionContentModelVersionCUSTOM by default
contentModelNameStringNamed content model
contentModelDateDateLast content model update
numberingSchemeNumberingSchemeDocument numbering policy
prefetchedbooleanWhether data has been loaded ahead of display
deletedbooleanSoft-delete flag
lockedbooleanArchive locked from edits
lockArchiveLockLock metadata (who locked, when)
isSelectedbooleanWhether archive is active in the navigator
copyIndexintAppended to name when > 0 to indicate a copied archive
endPointsIEndPointsEndpoint reference scoped to this archive
dataLoadingLockReentrantLockGuards concurrent data-load operations

Archive.getName() returns identifier when name == null; appends " Copy N" when copyIndex > 0.

Subtypes: CloudArchive, ImagingArchive, QualityArchive.

Document

SC/suredms-desktop-client-data/src/main/java/com/sureclinical/suredms/entity/Document.java

Extends TaxonEntity. Implements ExtensibleEntity and EditableDocumentEntity. The central clinical document entity.

Key fields:

FieldTypePurpose
archiveArchiveOwning archive
nameStringDocument title
suffixStringFile extension
contentTypeContentTypeFolder/section assignment
organizationOrganizationAssociated organization
personPersonAssociated investigator/person
versionlongVersion number
formDocFormCustom metadata form
numberOfPagesintPage count for PDF documents
documentTypeDocumentTypeDT_DOCUMENT by default
annotationsAnnotationFormFree-form annotations
sourceDocumentIdStringOriginal document ID if derived
signatureintSignature count
signedByStringSigner username
signatureDateDateSigning date
signatureTypePdfSignatureTypeNO_SIGNATURE by default
certificationTypeCertificationLevelNOT_CERTIFIED by default
remoteUrlStringURL if stored externally
obsoletebooleanMarked obsolete
documentLockedbooleanLock from edits
stickyNotesbooleanPDF sticky note annotations present
freeTextAnnotationsbooleanPDF free-text annotations present
draftbooleanDraft state flag
surveybooleanSurvey document flag
siteDocumentbooleanSite-level document flag
reportArchiveIdsList<String>Archives this report document is linked to
controlledControlledTypeControlled document classification
trainingTrainingTypeTraining classification
documentStatusDocumentLifeCycleStatusLifecycle state
reviewedDateReview date
approvedDateApproval date
effectiveDateEffective date
periodicReviewDateNext periodic review date
documentNumberStringAssigned document number
DCRStringDocument change request reference

Static constants for original document type: ORIGINAL_DOC_PDF = "PDF", ORIGINAL_DOC_PDF_IMAGE = "PDF Image".

User

SC/suredms-desktop-client-data/src/main/java/com/sureclinical/suredms/entity/User.java

Extends BaseEntity. Implements ArchiveAclUserGroup. Represents the authenticated desktop session user.

Key fields:

FieldTypePurpose
loginNameStringUsername
loginPasswordStringHashed/stored password (not shown in UI)
firstName / lastName / middleNameStringName components
fullNameStringPre-composed display name
legalSigningNameStringName used on signature blocks
jobTitleStringRole title
groupsListPropertyListNuxeo group memberships

Nuxeo property key constants used during save/load:

  • user:active — whether the account is enabled
  • user:verified — email/identity verified
  • user:signer — user is authorized to sign documents (isRemoteSigner() checks this)
  • user:loginEmailSent — login invitation sent
  • user:external — externally managed user

User.isRemoteSigner() is the primary check used by ESignServiceProxy to set remoteEnabled.

DocDiscrepancy

SC/suredms-desktop-client-data/src/main/java/com/sureclinical/suredms/entity/DocDiscrepancy.java

Extends TaxonEntity. Represents a quality issue on a document.

Key fields:

FieldTypeDefault
itemNumberLongSequential QC item number
archiveArchiveOwning archive
discrepancyTypeDiscrepancyTypeDT_DOCUMENT_AND_METADATA_ERROR
docDiscrepancyTypeDocDiscrepancyTypeSub-classification
resolvedEDateResolution date
reportedByStringUsername of reporter
resolvedByStringUsername of resolver
commentStringDescription of the issue
documentDocumentThe document under review
discrepancyContentStringSpecific content reference
discrepancyStatusDiscrepancyStatusOpen / resolved / waived
assignedToStringAssigned reviewer username
assignedToCommentStringAssignment note
reminderTypeEmailReminderTypeReminder schedule

Standard key constants used in the discrepancy form fields: DISCR_KEY_ARCHIVE, DISCR_KEY_CONTENT_TYPE, DISCR_KEY_ORGANIZATION, DISCR_KEY_PERSON, DISCR_KEY_MANUAL_VERSION, DISCR_KEY_PAGE_TEMPLATE (= "Page_%d").

ContentType

SC/suredms-desktop-client-data/src/main/java/com/sureclinical/suredms/entity/ContentType.java

Extends TaxonEntity. Implements IHierarchicalEntity, ILabel, EditableContentTypeEntity.

Key fields:

FieldTypePurpose
archiveArchiveOwning archive
parentIHierarchicalEntityParent folder in the content model tree
idlongNumeric ID within the content model
nameStringInternal name
labelStringDisplay label
reservedbooleanSystem-reserved — cannot be deleted (sdms_contenttype:reserved)
requiredbooleanMust have at least one document (sdms_contenttype:required)
lockedbooleanChanges locked
metadataAssociationsList<MetadataAssociation>Linked metadata term definitions
metadataTypeMetadataTypeMT_CORE by default
manualVersioningbooleanRead-only; set by server

Person

SC/suredms-desktop-client-data/src/main/java/com/sureclinical/suredms/entity/Person.java

Extends TaxonEntity. Implements ExtensibleEntity, IContactEntity, ILabel, EditablePersonEntity.

Stores investigator and team member identity: firstName, lastName, middleName, fullName, credential, title, email, address1/2, city, state, postalCode, countryCode, phone, fax, mobile, esig (e-signature string), inactive. Contact date range tracked via DATE_ACTIVE_PROPERTY and DATE_INACTIVE_PROPERTY.

Full Entity Inventory

All entity types registered via static register() blocks:

Entity ClassNuxeo TypePurpose
ArchiveSureDocs_ArchiveSureDrive / study container
DocumentSureDocs_DocumentClinical document
ContentTypeSureDocs_ContentTypeFolder in the content model
Categorysdms_categoryGrouping category
PersonSureDocs_PersonInvestigator or team member
PersonRoleSureDocs_PersonRolePerson's role definition
OrganizationSureDocs_OrganizationSite or sponsor org
OrganizationRoleSureDocs_OrganizationRoleOrg's role definition
UserSureDocs_UserAuthenticated system user
UserRolesdms_userRoleUser-level role assignment
DocDiscrepancySureDocs_DiscrepancyQuality discrepancy
DocDiscrepancyTypesdms_discrepancyTypeDiscrepancy classification
Auditsdms_auditAudit record
DocumentAuditReviewsdms_docAuditReviewPer-document audit review record
DocQItemsdms_docQItemDocument quality item
DocForm(embedded)Custom metadata form for a document
FormField(embedded)Single field value in a form
AnnotationDefsdms_annotationDefAnnotation field definition
AnnotationField(embedded)Single annotation value
AnnotationForm(embedded)Collection of annotations
DataPropertyDefsdms_dataPropertyDefCustom metadata field definition
MetadataAssociation(embedded)Link between content type and metadata field
PropertyDefsdms_propertyDefProperty definition
PropertyField(embedded)Field value for a property
PropertyForm(embedded)Collection of property fields
CloudArchive(extends Archive)Cloud-hosted archive
ImagingArchive(extends Archive)Medical imaging archive
QualityArchive(extends Archive)Quality-flagged archive
NewsItemsdms_newsNews or announcement
Registrarsdms_registrarStudy registrar record

Common Enumerations

EnumValues / Notes
DiscrepancyTypeDT_DOCUMENT_AND_METADATA_ERROR (default), and others
DiscrepancyStatusOpen / Resolved / Waived
DocumentLifeCycleStatusLifecycle states (pending, approved, rejected, etc.)
DocumentTypeDT_DOCUMENT (default) and specialized types
PdfSignatureTypeNO_SIGNATURE (default), and signed variants
CertificationLevelNOT_CERTIFIED (default)
ControlledTypeControlled document classification
TrainingTypeTraining document classification
DuplicationPolicyControls how duplicate documents are handled
ContentModelVersionCUSTOM (default)
NumberingSchemeArchive document numbering policy
MetadataTypeMT_CORE (default)

Design Notes

  • Entities are plain POJOs with no Spring, JPA, or Jackson annotations.
  • BaseEntity.OBJECT_FACTORIES is populated by each entity's static { register(); } block. New entity types must call registerObjFactory(TYPE, factory) to be discoverable.
  • The LOADED_OBJECTS cache in BaseEntity allows entity deduplication during a parse session. Call BaseEntity.reset() between sessions.
  • DocForm and its FormField entries are the mechanism by which custom metadata values (entered via the Content Model Editor) are attached to documents.
  • The IHierarchicalEntity interface (implemented by ContentType and Category) provides parent/child traversal for building the content model tree.

Dependencies

This module has no dependencies on other suredms-* desktop modules. It imports only from suredms-common (shared enums and constants) and the Nuxeo client library (for the Session, Document, and PropertyMap types used in persistence methods).

Endpoint Interface Layer

This module (suredms-desktop-client-data) also defines the endpoint interface layer: IEndPoints, IAuth, IDocument, EndPointsType, FetchMode, EndPointListener, EndPointParameters, and TimedReloadService. These interfaces are consumed by the connector module for its NuxeoEndPoints and XMLEndPoints implementations, and by the shell module's EntityDataSource. For full documentation of these interfaces see Data Access Layer — Endpoint Interface Hierarchy.