Click or drag to resize
Database Table OrgUnit 4.17 and later

[This is preliminary documentation and is subject to change.]

In data model version 4.17 and later, the field combination (Type,Code) is the primary key to the OrgUnit table (so this combination is guaranteed to be unique).

The OrgUnit table therefore contains one row per organizational unit - current and logically deleted ones. Historic data (that is automatically saved on each update) is kept OrgUnitHistory).

The view OrgUnitCurrent filters out logically deleted organizational units, returning only current ones. Since this view returns data from the OrgUnit table, where (Type,Code) combinations are unique, the same is true for the view.

Fields

Field name

Type

Note

Description

Type

VARCHAR(20)

Part of primary key, foreign key to OrgunitType

Refers to a type defined in the OrgUnitType table

Code

VARCHAR(20)

Part of primary key

Identifying code (not unique)

CreatedDateTime

datetime

date and time for creating the organizational unit in the database

CreatedBy

int

Employee id for employee who created the organizational unit in the database

UpdatedDateTime

datetime

Date and time for lastest update of the organizational unit in the database

UpdatedBy

int

Employee id for latest employee who has updated the organizational unit in the database

DeletedDateTime

datetime

date and time for logically deletion of the organizational unit in the database

DeletedBy

int

Employee id for employee who logically deleted the organizational unit in the database

Name

VARCHAR(255)

The name of the organizational unit

ShortName

VARCHAR(20)

The short name of the organizational unit

Alias

VARCHAR(20)

An alias for the organizational unit

Capacity

int

The capacity of the organizational unit. Can be used looesely to define things such as; number of beds, number of patients etc.

ParentType

VARCHAR(20)

Foreign key to Orgunit

The organizational unit can refer to another organizational unit that is the parent. ParentType holds the type of that organizational unit. Refers to a type defined in the OrgUnitType table

ParentCode

VARCHAR(20)

Foreign key to Orgunit

The identifying code of the parent organizational unit.

ReferenceType

VARCHAR(20)

Foreign key to OrgunitType

The organizational unit referes to another organization unit with this type. Refers to a type defined in the OrgUnitType table.

ReferenceCode

VARCHAR(20)

The organizational unit referes to another organization unit with this code.

GUID

Uniqueidentifier

Internal use

For integration with Microsoft Active Directory (NOT IMPLEMENTED YET!)

Location

VARCHAR(50)

The location part of the organizational unit address

Road

VARCHAR(50)

The road part of the organizational unit address

HouseNum

VARCHAR(20)

The house number part of the organizational unit address

ZipNum

int

For holding numeric zip codes. ZipCode text can be found in lookup table ZipCodeNumeric if it exists. If this is not the case the ZipText table is used for holding the zipcode text.

ZipString

VARCHAR(10)

For holding non numeric zip codes. ZipCode text can be stored in lookup table or in ZipText column.

ZipText

VARCHAR(50)

If no lookup table exists for finding text for ZipNum or ZipString, ZipText can be used for holding this text.

CountryCode

VARCHAR(20)

Holds the country code for the organization unit. Together with the OrgUnitCountryTypeString in the .config file. this refers to another organizational unit

Phone

VARCHAR(15)

The phone number for the organizational unit

Fax

VARCHAR(15)

The fax number for the organizational unit

Email

VARCHAR(50)

The email address for the organizational unit

EANIdentifier

bigint

The EANIdentifier for the organizational unit (used for MedCom communication)

Rate

int

This field can be loosely used for holding price ratings

Accreditation

bit

Used in accreditation (see Accreditation documentation for more info)

DistributeByFunctions

bit

Used in accreditation (see Accreditation documentation for more info)

Accreditation

bit

Used in accreditation (see Accreditation documentation for more info)

AccreditationBodyNumber

bit

Used in accreditation (see Accreditation documentation for more info)

Relations

Table

Fields

Description

OrgUnit (self-relation)

ParentType, ParentCode

Parent - defines hierarchy

OrgUnit (self-relation)

ReferenceType, ReferenceCode

Defines (optional) relation "across" the hierachy. Typical use is to refer from non-standard unit to standard unit.

OrgUnit (self-relation)

CountryCode

Refers to country (as part of address). NB: to get the country, the system uses a configured type for country,

OrgUnitType

Type

N..1 relation to OrgUnitType

OrgUnitType

ParentType

N..1 relation to OrgUnitType

OrgUnitType

ReferenceType

N..1 relation to OrgUnitType

See Also