Difference between revisions of "What is a Namespace?"

From VistApedia
Jump to: navigation, search
(Slight elaboration)
 
Line 2: Line 2:
  
 
Lack of understanding about potential conflicts can hurt adopters or programmers who aren't
 
Lack of understanding about potential conflicts can hurt adopters or programmers who aren't
as familiar with the way VistA is coded.
+
as familiar with the way VistA is organized in code and data.
  
 
As a new programmer in this space, you may not be aware that VistA is
 
As a new programmer in this space, you may not be aware that VistA is
Line 37: Line 37:
 
KBAD and Sam Habiel's is KBAN.  These are usually for small programs
 
KBAD and Sam Habiel's is KBAN.  These are usually for small programs
 
that are not really part of an overarching project. At the current
 
that are not really part of an overarching project. At the current
time, [[Rick Marshall]] of the [[VistA Expertise Network]] administers this
+
time (August 2015), [[Rick Marshall]] of the [[VistA Expertise Network]]  
namespace.
+
administers this namespace.
  
 
There are institutional namespaces, such as JJOH for Oroville
 
There are institutional namespaces, such as JJOH for Oroville
Line 44: Line 44:
 
are very specific to that institution's needs. In the VA, the
 
are very specific to that institution's needs. In the VA, the
 
individual hospitals and development centers use names that start with
 
individual hospitals and development centers use names that start with
the letter "A". Usually these namespaces are three letters long.
+
the letter "A". Within the VA these namespaces are three letters long
 +
and the hospital or development center may have up to three base name
 +
spaces.
  
 
There are national namespaces, which start with the letter "U" and are
 
There are national namespaces, which start with the letter "U" and are
Line 51: Line 53:
 
names have been pre-assigned using the ISO two letter name for the
 
names have been pre-assigned using the ISO two letter name for the
 
country, much like the URLS that exist like company.de or website.jp
 
country, much like the URLS that exist like company.de or website.jp
or those kinds of names.
+
or those kinds of nation specific names.
  
 
There are vendor namespaces which start with the letter "V" and
 
There are vendor namespaces which start with the letter "V" and
Line 63: Line 65:
 
institution or to a project. In those cases, North Carolina Central
 
institution or to a project. In those cases, North Carolina Central
 
Regional Hospital uses "C9C", and the E-pharmacy program written by
 
Regional Hospital uses "C9C", and the E-pharmacy program written by
George Lilly uses "C0P".  If you want one of these, please send me an
+
George Lilly uses "C0P".  If you want one of these, please send whitten@netcom.com an
e-mail, as I administer that namespace.
+
e-mail, as I (David Whitten) administer that namespace.
  
 
Please get a namespace so other people can use your programs without
 
Please get a namespace so other people can use your programs without
 
worrying about accidentally loading code that might disrupt their
 
worrying about accidentally loading code that might disrupt their
 
operations when they use it.
 
operations when they use it.

Latest revision as of 00:40, 18 August 2015

This is one of the steps to help you create the programs you need to get your customers happy.

Lack of understanding about potential conflicts can hurt adopters or programmers who aren't as familiar with the way VistA is organized in code and data.

As a new programmer in this space, you may not be aware that VistA is a shared architecture, and programs written by one person usually end up in a common environment with other code written by other people.

One of the ways the community looks out for each other and makes sure code and data can coexist with many people developing is to agree to work within Namespaces and Numberspaces. This is a method and convention for programmers to only name programs using an assigned prefix to the name of the program. For example, all Pharmacy programs are written starting with the letters "PS" and FileMan programs start with the letter "DI" or "DD" or "DJ", or the VA KERNEL programs start with the letter "X". In general programs that start with the letter "Z" don't follow this convention, but VistA programmers know that these programs could be wiped out accidentally very easily.

In general, most namespaces follow a very defined pattern, so a VistA programmer isn't free to just use any program name they like. When you start to write code that you expect could be useful to anyone else, it is better to use your namespace. Any of the VistA Database Administrator Council can coordinate with you, and make sure you are given a permanent namespace you can depend upon as your own.

When your program is in another programmer or project's namespace, it will not fit in well in a VistA system, you should be rename it to not conflict.

There are several kinds of namespaces.

There are personal/programmer specific namespaces that start with the letter "K" and are usually four letters long. For example, mine is KBAD and Sam Habiel's is KBAN. These are usually for small programs that are not really part of an overarching project. At the current time (August 2015), Rick Marshall of the VistA Expertise Network administers this namespace.

There are institutional namespaces, such as JJOH for Oroville hospital. Usually these are for projects within the institution that are very specific to that institution's needs. In the VA, the individual hospitals and development centers use names that start with the letter "A". Within the VA these namespaces are three letters long and the hospital or development center may have up to three base name spaces.

There are national namespaces, which start with the letter "U" and are usually three letters long. These usually are for Nation-wide entities like EHS for the Kingdom of Jordan (whose namespace is UJO ) These names have been pre-assigned using the ISO two letter name for the country, much like the URLS that exist like company.de or website.jp or those kinds of nation specific names.

There are vendor namespaces which start with the letter "V" and usually start with the letters "VE" or "VF". These are for programs written by a company or commercial entity. This namespace is administered by Julie Harvey in the VA.

There is a pool of names which start with the letter "C" followed by a number and an alphabetic character, which is assigned by WorldVistA. Examples of these are "C0P" or "C9C". These may be assigned to an institution or to a project. In those cases, North Carolina Central Regional Hospital uses "C9C", and the E-pharmacy program written by George Lilly uses "C0P". If you want one of these, please send whitten@netcom.com an e-mail, as I (David Whitten) administer that namespace.

Please get a namespace so other people can use your programs without worrying about accidentally loading code that might disrupt their operations when they use it.