- Timestamp:
- Dec 4, 2009, 12:11:15 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WorldVistAEHR/trunk/r/ZZREGIONAL-A1C-A5C-CRHD-RGED-RGUT-RGWB-RG/RGRSBUL1.m
r613 r623 1 RGRSBUL1 ;ALB/RJS,CML-RGRSTEXT BULLETIN ROUTINE (PART 2) ;07/24/98 2 ;;1.0;CLINICAL INFO RESOURCE NETWORK;**1,3,19,52**;30 Apr 99;Build 2 3 ; 4 SSNBULL(DFN,ARRAY,NAME,SSN,ICN,CMOR) ; 5 ;Entry point generates a bulletin to the RG CIRN DEMOGRAPHIC 6 ;ISSUES mail group about an SSN change for a given patient. 7 ; 8 ;Input: Required Variables 9 ; 10 ; DFN - IEN in the PATIENT file (#2) 11 ; ARRAY - Array of data containing sending sites station number 12 ; NAME - Patient's Name 13 ; SSN - Patient's SSN 14 ; ICN - Patient's ICN (Integration Control Number) 15 ; CMOR - Patient's CMOR (Coordinating Master of Record) 16 ; 17 Q:$G(DFN)=""!($G(ARRAY)="") 18 N LOCDATA,RGRSTEXT,INDEX,COUNTER 19 S RGRSTEXT(1)="The MPI/PD Package has received an SSN change from:" 20 S RGRSTEXT(2)=$$INST(@ARRAY@("SENDING SITE")) 21 S RGRSTEXT(3)=" " 22 S RGRSTEXT(4)="This change has been made in your local data base for:" 23 S RGRSTEXT(5)=NAME 24 S RGRSTEXT(6)=" " 25 S RGRSTEXT(7)="=> Local "_$P($$SITE^VASITE(),"^",2)_" data PRIOR to update:" 26 S RGRSTEXT(8)="NAME: "_NAME 27 S RGRSTEXT(9)="SSN: "_SSN 28 S RGRSTEXT(10)="ICN: "_ICN 29 S RGRSTEXT(11)="CMOR: "_CMOR 30 S RGRSTEXT(12)="--------------------------------------------------------" 31 S RGRSTEXT(13)="=> Update received from "_$P($$INST(@ARRAY@("SENDING SITE"))," -->")_":" 32 S RGRSTEXT(14)="SSN: "_@ARRAY@("SSN") 33 D BULL2^RGRSBULL("MPI/PD SSN CHANGE - "_NAME,"RGRSTEXT(") 34 Q 35 ; 36 NOT2(ARRAY) ; 37 ;Entry point generates a bulletin to the RG CIRN DEMOGRAPHIC 38 ;ISSUES mail group about invalid subscription information for a given 39 ;patient. 40 ; 41 ;Input: Required Variables 42 ; 43 ; ARRAY - Array of information regarding the invalid subscription 44 ; 45 Q:($G(ARRAY)="") 46 N RGRSTEXT,INDEX,COUNTER 47 S RGRSTEXT(1)="The MPI/PD Package has received a message from:" 48 S RGRSTEXT(2)=$$INST(@ARRAY@("SENDING SITE")) 49 S RGRSTEXT(3)="This patient has your station as a subscriber, however" 50 S RGRSTEXT(4)="the patient was not found in your database." 51 S RGRSTEXT(5)="--------------------------------------------------------" 52 S RGRSTEXT(6)="Remote Data" 53 S RGRSTEXT(7)=" " 54 S INDEX=0,COUNTER=8 55 F S INDEX=$O(@ARRAY@("MESSAGE",INDEX)) Q:INDEX']"" D 56 . S RGRSTEXT(COUNTER)=@ARRAY@("MESSAGE",INDEX) 57 . S COUNTER=COUNTER+1 58 D BULL2^RGRSBULL("MPI/PD - PATIENT NOT FOUND","RGRSTEXT(") 59 Q 60 ; 61 SENSTIVE(DFN,ARRAY,NAME) ;FIRES WHEN PT. IS FLAGGED AS SENSITIVE AT ANOTHER SITE 62 ;Entry point generates a bulletin to the RG CIRN DEMOGRAPHIC 63 ;ISSUES mail group when a given patient is flagged as sensitive at 64 ;another site. 65 ; 66 ;Input: Required Variables 67 ; 68 ; DFN - IEN in the PATIENT file (#2) 69 ; ARRAY - Array of data containing sending sites station number and SSN 70 ; NAME - Patient's name 71 ; CMOR - Coordinating Master of Record 72 ; 73 Q:($G(ARRAY)="")!($G(DFN)="") 74 N RGRSTEXT,INDEX,COUNTER,CMOR 75 S CMOR=$$CMOR2^MPIF001(DFN) I $P(CMOR,"^")<0 S CMOR="not assigned" 76 S RGRSTEXT(1)="The MPI/PD Package has received a message from:" 77 S RGRSTEXT(2)=$$INST(@ARRAY@("SENDING SITE")) 78 S RGRSTEXT(3)=" " 79 S RGRSTEXT(4)="This message indicates that patient "_NAME_" is flagged" 80 S RGRSTEXT(5)="as Sensitive at the other facility but is not flagged as" 81 S RGRSTEXT(6)="Sensitive at your facility." 82 S RGRSTEXT(7)=" " 83 S RGRSTEXT(8)="Remote Patient SSN: "_$S(@ARRAY@("SSN")="":"Not Available",1:@ARRAY@("SSN")) 84 S RGRSTEXT(9)="Remote User who Flagged the Patient as Sensitive: "_@ARRAY@("SENSITIVITY USER") 85 S RGRSTEXT(10)="Date/Time Remote User Flagged Patient Sensitive: "_$$FMTE^XLFDT(@ARRAY@("SENSITIVITY DATE")) 86 S RGRSTEXT(11)=" " 87 S RGRSTEXT(12)="CMOR Site: "_CMOR 88 D BULL2^RGRSBULL("Remote Sensitivity Indicated","RGRSTEXT(") 89 Q 90 ; 91 ;MPIC_772 - **52; Commented out Remote Date of Death Indicated module. 92 ;Only RGADTP2 and RGRSPT called this module; and both have been commented out. 93 RMTDOD(DFN,ARRAY,NAME,RDOD,LDOD) ;Fires when patient has a Date of Death at another site 94 ;Entry point generates a bulletin to the RG CIRN DEMOGRAPHIC 95 ;ISSUES mail group when a given patient has a Date of Death at 96 ;another site. 97 ; 98 ;Input: Required Variables 99 ; 100 ; DFN - IEN in the PATIENT file (#2) 101 ; ARRAY - Array of data containing sending sites station number and SSN 102 ; NAME - Patient's name 103 ; RDOD - Date of Death at remote site 104 ; LDOD - Date of Death at local site 105 ; CMOR - Coordinating Master of Record 106 ; 107 ;Q:($G(ARRAY)="")!($G(DFN)="") 108 ;Q:(RDOD=LDOD) ;If remote DOD and local DOD same, QUIT 109 ;N CMOR 110 ;S CMOR=$$CMOR2^MPIF001(DFN) I $P(CMOR,"^")<0 S CMOR="not assigned" 111 ;N RGRSTEXT 112 ;S RGRSTEXT(1)="The MPI/PD Package has received a message from:" 113 ;S RGRSTEXT(2)=$$INST(@ARRAY@("SENDING SITE")) 114 ;S RGRSTEXT(3)=" " 115 ;S RGRSTEXT(4)="This message indicates that patient "_NAME 116 ;I 'LDOD S RGRSTEXT(5)="has a date of death at the other facility but not at your facility." G RMTMSG 117 ;I LDOD,(LDOD'=RDOD) S RGRSTEXT(5)="has a different date of death at the other facility than at your facility." 118 RMTMSG ;S RGRSTEXT(6)=" " 119 ;S RGRSTEXT(7)="Remote Patient SSN: "_$S(@ARRAY@("SSN")="":"Not Available",1:@ARRAY@("SSN")) 120 ;S RGRSTEXT(8)="Date of Death from other facility: "_$$FMTE^XLFDT(RDOD) 121 ;I LDOD,(LDOD'=RDOD) S RGRSTEXT(9)="Date of Death at your facility: "_$$FMTE^XLFDT(LDOD) 122 ;S RGRSTEXT(10)=" " 123 ;S RGRSTEXT(11)="CMOR site: "_CMOR 124 ;D BULL2^RGRSBULL("Remote Date of Death Indicated","RGRSTEXT(") 125 Q 126 ; 127 INST(SITENUM) ; 128 N RETURN,IEN,DATA,NAME,NUMBER 129 S RETURN="" 130 Q:$G(SITENUM)="" RETURN 131 S IEN=$$LKUP^XUAF4(SITENUM) 132 I IEN>0 S DATA=$$NS^XUAF4(IEN) 133 I $G(DATA)]"" D 134 . S NAME=$P(DATA,"^",1),NUMBER=$P(DATA,"^",2) 135 . S RETURN=NAME_" --> Site Number: "_NUMBER 136 Q RETURN 137 ; 138 FORMAT(DATA1,DATA2) ; 139 N SPACES,SPACENUM,LENGTH1,LENGTH2,RETURN 140 S SPACES=" " 141 S LENGTH1=$L(DATA1),LENGTH2=$L(DATA2) 142 I LENGTH1>23 S DATA1=$E(DATA1,1,23) S LENGTH1=23 143 I LENGTH2>22 S DATA2=$E(DATA2,1,22) 144 S SPACENUM=23-LENGTH1 145 S SPACES=$E(SPACES,1,SPACENUM) 146 S RETURN=DATA1_SPACES_" "_DATA2 147 Q $G(RETURN) 148 ; 149 FREE(DATA) ; 150 Q:$G(DATA)="" "" 151 Q:$G(DATA)["@" "" 152 Q:$G(DATA)=HL("Q") "" 153 Q $G(DATA) 1 RGRSBUL1 ;ALB/RJS,CML-RGRSTEXT BULLETIN ROUTINE (PART 2) ;07/24/98 2 ;;1.0;CLINICAL INFO RESOURCE NETWORK;**1,3,19**;30 Apr 99 3 SSNBULL(DFN,ARRAY,NAME,SSN,ICN,CMOR) ; 4 ;Entry point generates a bulletin to the RG CIRN DEMOGRAPHIC 5 ;ISSUES mail group about an SSN change for a given patient. 6 ; 7 ;Input: Required Variables 8 ; 9 ; DFN - IEN in the PATIENT file (#2) 10 ; ARRAY - Array of data containing sending sites station number 11 ; NAME - Patient's Name 12 ; SSN - Patient's SSN 13 ; ICN - Patient's ICN (Integration Control Number) 14 ; CMOR - Patient's CMOR (Coordinating Master of Record) 15 ; 16 Q:$G(DFN)=""!($G(ARRAY)="") 17 N LOCDATA,RGRSTEXT,INDEX,COUNTER 18 S RGRSTEXT(1)="The MPI/PD Package has received an SSN change from:" 19 S RGRSTEXT(2)=$$INST(@ARRAY@("SENDING SITE")) 20 S RGRSTEXT(3)=" " 21 S RGRSTEXT(4)="This change has been made in your local data base for:" 22 S RGRSTEXT(5)=NAME 23 S RGRSTEXT(6)=" " 24 S RGRSTEXT(7)="=> Local "_$P($$SITE^VASITE(),"^",2)_" data PRIOR to update:" 25 S RGRSTEXT(8)="NAME: "_NAME 26 S RGRSTEXT(9)="SSN: "_SSN 27 S RGRSTEXT(10)="ICN: "_ICN 28 S RGRSTEXT(11)="CMOR: "_CMOR 29 S RGRSTEXT(12)="--------------------------------------------------------" 30 S RGRSTEXT(13)="=> Update received from "_$P($$INST(@ARRAY@("SENDING SITE"))," -->")_":" 31 S RGRSTEXT(14)="SSN: "_@ARRAY@("SSN") 32 D BULL2^RGRSBULL("MPI/PD SSN CHANGE - "_NAME,"RGRSTEXT(") 33 Q 34 ; 35 NOT2(ARRAY) ; 36 ;Entry point generates a bulletin to the RG CIRN DEMOGRAPHIC 37 ;ISSUES mail group about invalid subscription information for a given 38 ;patient. 39 ; 40 ;Input: Required Variables 41 ; 42 ; ARRAY - Array of information regarding the invalid subscription 43 ; 44 Q:($G(ARRAY)="") 45 N RGRSTEXT,INDEX,COUNTER 46 S RGRSTEXT(1)="The MPI/PD Package has received a message from:" 47 S RGRSTEXT(2)=$$INST(@ARRAY@("SENDING SITE")) 48 S RGRSTEXT(3)="This patient has your station as a subscriber, however" 49 S RGRSTEXT(4)="the patient was not found in your database." 50 S RGRSTEXT(5)="--------------------------------------------------------" 51 S RGRSTEXT(6)="Remote Data" 52 S RGRSTEXT(7)=" " 53 S INDEX=0,COUNTER=8 54 F S INDEX=$O(@ARRAY@("MESSAGE",INDEX)) Q:INDEX']"" D 55 . S RGRSTEXT(COUNTER)=@ARRAY@("MESSAGE",INDEX) 56 . S COUNTER=COUNTER+1 57 D BULL2^RGRSBULL("MPI/PD - PATIENT NOT FOUND","RGRSTEXT(") 58 Q 59 ; 60 SENSTIVE(DFN,ARRAY,NAME) ;FIRES WHEN PT. IS FLAGGED AS SENSITIVE AT ANOTHER SITE 61 ;Entry point generates a bulletin to the RG CIRN DEMOGRAPHIC 62 ;ISSUES mail group when a given patient is flagged as sensitive at 63 ;another site. 64 ; 65 ;Input: Required Variables 66 ; 67 ; DFN - IEN in the PATIENT file (#2) 68 ; ARRAY - Array of data containing sending sites station number and SSN 69 ; NAME - Patient's name 70 ; CMOR - Coordinating Master of Record 71 ; 72 Q:($G(ARRAY)="")!($G(DFN)="") 73 N RGRSTEXT,INDEX,COUNTER,CMOR 74 S CMOR=$$CMOR2^MPIF001(DFN) I $P(CMOR,"^")<0 S CMOR="not assigned" 75 S RGRSTEXT(1)="The MPI/PD Package has received a message from:" 76 S RGRSTEXT(2)=$$INST(@ARRAY@("SENDING SITE")) 77 S RGRSTEXT(3)=" " 78 S RGRSTEXT(4)="This message indicates that patient "_NAME_" is flagged" 79 S RGRSTEXT(5)="as Sensitive at the other facility but is not flagged as" 80 S RGRSTEXT(6)="Sensitive at your facility." 81 S RGRSTEXT(7)=" " 82 S RGRSTEXT(8)="Remote Patient SSN: "_$S(@ARRAY@("SSN")="":"Not Available",1:@ARRAY@("SSN")) 83 S RGRSTEXT(9)="Remote User who Flagged the Patient as Sensitive: "_@ARRAY@("SENSITIVITY USER") 84 S RGRSTEXT(10)="Date/Time Remote User Flagged Patient Sensitive: "_$$FMTE^XLFDT(@ARRAY@("SENSITIVITY DATE")) 85 S RGRSTEXT(11)=" " 86 S RGRSTEXT(12)="CMOR Site: "_CMOR 87 D BULL2^RGRSBULL("Remote Sensitivity Indicated","RGRSTEXT(") 88 Q 89 ; 90 RMTDOD(DFN,ARRAY,NAME,RDOD,LDOD) ;Fires when patient has a Date of Death at another site 91 ;Entry point generates a bulletin to the RG CIRN DEMOGRAPHIC 92 ;ISSUES mail group when a given patient has a Date of Death at 93 ;another site. 94 ; 95 ;Input: Required Variables 96 ; 97 ; DFN - IEN in the PATIENT file (#2) 98 ; ARRAY - Array of data containing sending sites station number and SSN 99 ; NAME - Patient's name 100 ; RDOD - Date of Death at remote site 101 ; LDOD - Date of Death at local site 102 ; CMOR - Coordinating Master of Record 103 ; 104 Q:($G(ARRAY)="")!($G(DFN)="") 105 Q:(RDOD=LDOD) ;If remote DOD and local DOD same, QUIT 106 N CMOR 107 S CMOR=$$CMOR2^MPIF001(DFN) I $P(CMOR,"^")<0 S CMOR="not assigned" 108 N RGRSTEXT 109 S RGRSTEXT(1)="The MPI/PD Package has received a message from:" 110 S RGRSTEXT(2)=$$INST(@ARRAY@("SENDING SITE")) 111 S RGRSTEXT(3)=" " 112 S RGRSTEXT(4)="This message indicates that patient "_NAME 113 I 'LDOD S RGRSTEXT(5)="has a date of death at the other facility but not at your facility." G RMTMSG 114 I LDOD,(LDOD'=RDOD) S RGRSTEXT(5)="has a different date of death at the other facility than at your facility." 115 RMTMSG S RGRSTEXT(6)=" " 116 S RGRSTEXT(7)="Remote Patient SSN: "_$S(@ARRAY@("SSN")="":"Not Available",1:@ARRAY@("SSN")) 117 S RGRSTEXT(8)="Date of Death from other facility: "_$$FMTE^XLFDT(RDOD) 118 I LDOD,(LDOD'=RDOD) S RGRSTEXT(9)="Date of Death at your facility: "_$$FMTE^XLFDT(LDOD) 119 S RGRSTEXT(10)=" " 120 S RGRSTEXT(11)="CMOR site: "_CMOR 121 D BULL2^RGRSBULL("Remote Date of Death Indicated","RGRSTEXT(") 122 Q 123 ; 124 INST(SITENUM) ; 125 N RETURN,IEN,DATA,NAME,NUMBER 126 S RETURN="" 127 Q:$G(SITENUM)="" RETURN 128 S IEN=$$LKUP^XUAF4(SITENUM) 129 I IEN>0 S DATA=$$NS^XUAF4(IEN) 130 I $G(DATA)]"" D 131 . S NAME=$P(DATA,"^",1),NUMBER=$P(DATA,"^",2) 132 . S RETURN=NAME_" --> Site Number: "_NUMBER 133 Q RETURN 134 ; 135 FORMAT(DATA1,DATA2) ; 136 N SPACES,SPACENUM,LENGTH1,LENGTH2,RETURN 137 S SPACES=" " 138 S LENGTH1=$L(DATA1),LENGTH2=$L(DATA2) 139 I LENGTH1>23 S DATA1=$E(DATA1,1,23) S LENGTH1=23 140 I LENGTH2>22 S DATA2=$E(DATA2,1,22) 141 S SPACENUM=23-LENGTH1 142 S SPACES=$E(SPACES,1,SPACENUM) 143 S RETURN=DATA1_SPACES_" "_DATA2 144 Q $G(RETURN) 145 ; 146 FREE(DATA) ; 147 Q:$G(DATA)="" "" 148 Q:$G(DATA)["@" "" 149 Q:$G(DATA)=HL("Q") "" 150 Q $G(DATA)
Note:
See TracChangeset
for help on using the changeset viewer.