Index: ccr/trunk/p/GPLACTORS.m
===================================================================
--- ccr/trunk/p/GPLACTORS.m	(revision 75)
+++ ccr/trunk/p/GPLACTORS.m	(revision 78)
@@ -17,22 +17,21 @@
  ;with this program; if not, write to the Free Software Foundation, Inc.,
  ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-           ;
-           ;  PROCESS THE ACTORS SECTION OF THE CCR
-                   ;
-                   ; ===Revision History===
-                   ; 0.1 Initial Writing of Skeleton--GPL
-                   ; 0.2 Patient Data Extraction--SMH
-                   ; 0.3 Information System Info Extraction--SMH
-           ;
+    ;
+    ;  PROCESS THE ACTORS SECTION OF THE CCR
+    ;
+    ; ===Revision History===
+    ; 0.1 Initial Writing of Skeleton--GPL
+    ; 0.2 Patient Data Extraction--SMH
+    ; 0.3 Information System Info Extraction--SMH
+    ;
 EXTRACT(IPXML,ALST,AXML) ; EXTRACT ACTOR FROM ALST INTO PROVIDED XML TEMPLATE
-           ; IPXML is the Input Actor Template into which we are going to substitute values
-                   ; This is straight XML. Values to be substituted are in @@VAL@@ format.
+  ; IPXML is the Input Actor Template into which we  substitute values
+  ; This is straight XML. Values to be substituted are in @@VAL@@ format.
+  ; ALST is the actor list global generated by ACTLST^GPLCCR and has format:
+  ; ^TMP(7542,1,"ACTORS",0)=Count
+  ; ^TMP(7542,1,"ACTORS",n)="ActorID^ActorType^ActorIEN"
+  ; ActorType is an enum containing either "PROVIDER" "PATIENT" "SYSTEM"
 
-                   ; ALST is the actor list global generated by ACTLST^GPLCCR and is in the following format
-                   ; ^TMP(7542,1,"ACTORS",0)=Count
-                   ; ^TMP(7542,1,"ACTORS",n)="ActorID^ActorType^ActorIEN"
-                   ; ActorType is an enum containing either "PROVIDER" "PATIENT" "SYSTEM"
-
-           ; AXML is the output arrary, to contain XML.
+  ; AXML is the output arrary, to contain XML.
 
            N I,J,AMAP,AOID,ATYP,AIEN
@@ -90,6 +89,12 @@
      S @AMAP@("ACTORDATEOFBIRTH")=$$DOB^CCRDPT
      S @AMAP@("ACTORGENDER")=$$GENDER^CCRDPT
-     S @AMAP@("ACTORSSN")=$$SSN^CCRDPT
-     S @AMAP@("ACTORSSNSOURCEID")=AOID
+     S @AMAP@("ACTORSSN")=""
+     S @AMAP@("ACTORSSNTEXT")=""
+     S @AMAP@("ACTORSSNSOURCEID")=""
+     S ZX=$$SSN^CCRDPT
+     I ZX'="" D  ; IF THERE IS A SSN IN THE RECORD
+     . S @AMAP@("ACTORSSN")=ZX
+     . S @AMAP@("ACTORSSNTEXT")="SSN"
+     . S @AMAP@("ACTORSSNSOURCEID")=AOID
      S @AMAP@("ACTORADDRESSTYPE")=$$ADDRTYPE^CCRDPT
      S @AMAP@("ACTORADDRESSLINE1")=$$ADDR1^CCRDPT
@@ -98,11 +103,27 @@
      S @AMAP@("ACTORADDRESSSTATE")=$$STATE^CCRDPT
      S @AMAP@("ACTORADDRESSZIPCODE")=$$ZIP^CCRDPT
-     S @AMAP@("ACTORRESTEL")=$$RESTEL^CCRDPT
-     S @AMAP@("ACTORWORKTEL")=$$WORKTEL^CCRDPT
-         S @AMAP@("ACTORCELLTEL")=$$CELLTEL^CCRDPT
+     S @AMAP@("ACTORRESTEL")=""
+     S @AMAP@("ACTORRESTELTEXT")=""
+     S ZX=$$RESTEL^CCRDPT
+     I ZX'="" D  ; IF THERE IS A RESIDENT PHONE IN THE RECORD
+     . S @AMAP@("ACTORRESTEL")=ZX
+     . S @AMAP@("ACTORRESTELTEXT")="Residential Telephone"
+     S @AMAP@("ACTORWORKTEL")=""
+     S @AMAP@("ACTORWORKTELTEXT")=""
+     S ZX=$$WORKTEL^CCRDPT
+     I ZX'="" D  ; IF THERE IS A RESIDENT PHONE IN THE RECORD
+     . S @AMAP@("ACTORWORKTEL")=ZX
+     . S @AMAP@("ACTORWORKTELTEXT")="Work Telephone"
+     S @AMAP@("ACTORCELLTEL")=""
+     S @AMAP@("ACTORCELLTELTEXT")=""
+     S ZX=$$CELLTEL^CCRDPT
+     I ZX'="" D  ; IF THERE IS A CELL PHONE IN THE RECORD
+     . S @AMAP@("ACTORCELLTEL")=ZX
+     . S @AMAP@("ACTORCELLTELTEXT")="Cell Phone"
      S @AMAP@("ACTOREMAIL")=$$EMAIL^CCRDPT
      S @AMAP@("ACTORADDRESSSOURCEID")=AOID
      S @AMAP@("ACTORIEN")=AIEN
-     S @AMAP@("ACTORSUFFIXNAME")="" ; DOES VISTA STORE THE SUFFIX?
+     S @AMAP@("ACTORSUFFIXNAME")="" ; DOES VISTA STORE THE SUFFIX
+     S @AMAP@("ACTORSOURCEID")="ACTORSYSTEM_1" ; THE SYSTEM IS THE SOURCE
          D DESTROY^CCRDPT
      D MAP^GPLXPATH(INXML,AMAP,OUTXML) ; MAP THE VARIABLE
@@ -130,4 +151,5 @@
      S @AMAP@("ACTORRELATION")=""
      S @AMAP@("ACTORRELATIONSOURCEID")=""
+     S @AMAP@("ACTORSOURCEID")="ACTORSYSTEM_1" ; THE SYSTEM IS THE SOURCE
      D MAP^GPLXPATH(INXML,AMAP,OUTXML) ; MAP THE VARIABLE
      Q
@@ -163,8 +185,13 @@
      S @AMAP@("ACTORADDRESSSTATE")=$$STATE^CCRVA200(AIEN)
      S @AMAP@("ACTORPOSTALCODE")=$$POSTCODE^CCRVA200(AIEN)
-     S @AMAP@("ACTORTELEPHONE")=$$TEL^CCRVA200(AIEN)
-     S @AMAP@("ACTORTELEPHONETYPE")=$$TELTYPE^CCRVA200(AIEN)
+     S @AMAP@("ACTORTELEPHONE")=""
+     S @AMAP@("ACTORTELEPHONETYPE")=""
+     S ZX=$$TEL^CCRVA200(AIEN)
+     I ZX'="" D  ; THERE IS A PHONE NUMBER AVAILABLE
+     . S @AMAP@("ACTORTELEPHONE")=ZX
+     . S @AMAP@("ACTORTELEPHONETYPE")=$$TELTYPE^CCRVA200(AIEN)
      S @AMAP@("ACTOREMAIL")=$$EMAIL^CCRVA200(AIEN)
      S @AMAP@("ACTORADDRESSSOURCEID")="ACTORSYSTEM_1"
+     S @AMAP@("ACTORSOURCEID")="ACTORSYSTEM_1" ; THE SYSTEM IS THE SOURCE
      D MAP^GPLXPATH(INXML,AMAP,OUTXML) ; MAP THE VARIABLE
      Q
