Click or drag to resize
Database Table OrgUnit 4.16 and earlier

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

In data model version 4.16 and all earlier versions, the OrgUnit table may contain more than one row per organizational unit. And organizational unit is identified by the key (Type,Code) - so there may exist manye records with a given (Type,Code) combination.

This is so for historical reasons - the OrgUnit table was designed with an eye to a particular import format (the danish hospital/department classification, called SHAK). - this import format contains actual and historic versions of hospitals and departments, with start and end dates.

So this table contains both actual and historic information. The historic information is imported from the above mentions import format. Updates to the table (performed from the TOPICA application or by direct database update) do NOT cause creation of historic data.

Since the (Type,Code) combination is not unique, it is not a primary key.

The OrgUnitCurrent view filters out all historic rows, based on the fields DateStart and DateEnd. If there are no overlaps between date inverval per key, the OrgUnitCurrent view will contains unique (Type,Code) combinations. But there is no gurantee agains date interval overlap! That is, data errors when one key has overlapping dates, will result in multiple rows for this key in the OrgUnitCurrent view!

Fields

Field name

Type

Note

Description

Id

int

Primary key

Unique identifier for the organizational unit

Type

VARCHAR(20)

Refers to a type defined in the OrgUnitType table

Code

VARCHAR(20)

Identifying code (not unique)

DateStart

datetime

The organizational unit is valid starting from this date

DateEnd

datetime

The organizational unit is valid until this date

Name

VARCHAR(255)

The name of the organizational unit

ShortName

VARCAHR(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)

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)

The identifying code of the parent organizational unit.

ReferenceType

VARCHAR(20)

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)

Relations

Table

Relation

OrgUnit

ParentType/ParentCode, ReferenceType/ReferenceCode and CountryCode are all relations to other organizational units in the OrgUnit table (self-relation).

OrgUnitType

ParentType is a 0..1 relation to OrgUnitType

OrgUnitType

ReferenceType is a 0..1 relation to OrgUnitType

OrgUnitType

Type is a 0..1 relation to OrgUnitType

See Also