Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: OOPSGUI6

OOPSGUI6.m

Go to the documentation of this file.
  1. OOPSGUI6 ;WIOFO/LLH-RPC routines for ASISTS Gui ;9/18/01
  1. ;;2.0;ASISTS;**4,8,7,25**;Jun 03, 2002;Build 4
  1. ;
  1. UNIGET(RESULTS) ; Returns entries in the Union table
  1. N DATA,CNT,SUP,UIEN,UNI
  1. S CNT=0,UNI=""
  1. F S UNI=$O(^OOPS(2263.7,"B",UNI)) Q:UNI="" D
  1. .S UIEN=0
  1. .F S UIEN=$O(^OOPS(2263.7,"B",UNI,UIEN)) Q:UIEN="" D
  1. ..S DATA=$G(^OOPS(2263.7,UIEN,0))
  1. ..S SUP=$$GET1^DIQ(200,$P($G(DATA),U,3),.01)
  1. ..S RESULTS(CNT)=DATA_U_SUP_U_UIEN,CNT=CNT+1
  1. Q
  1. UNIKILL(RESULTS,INPUT) ;
  1. ; Input - INPUT contains the IEN for Union to be deleted
  1. ; Output - RESULTS will contain a message indicating the record
  1. ; was successfully deleted.
  1. N DA,DIK
  1. S RESULTS="No Changes Filed"
  1. S DIK="^OOPS(2263.7,",DA=INPUT
  1. D ^DIK
  1. S RESULTS="Record Successfully Deleted"
  1. Q
  1. UNIADD ; Files a new record in ^OOPS(2263.7
  1. N X,DIC,DLAYGO
  1. K DO
  1. S DLAYGO=2263.7,DIC="^OOPS(2263.7,",DIC(0)="L",X=NM
  1. D FILE^DICN
  1. I Y=-1 S RESULTS="Failed" Q
  1. S DA=+Y,RESULTS=X_" union added"
  1. Q
  1. UNIEDT(RESULTS,INPUT) ; Edits the input in ^OOPS(2263.7
  1. ; Input - INPUT contains the IEN of Union to be edited or NULL if a
  1. ; new union is being added. Also has the Union Name,
  1. ; Acronym, and Representative in the format:
  1. ; IEN^UNION NAME^UNION ACRONYM^UNION REP
  1. ; Output - RESULTS contains a status message regarding the filing of
  1. ; the data
  1. N DA,DIE,DR,IEN,NM,ACR,REP
  1. S RESULTS="No Changes Filed"
  1. S DIE="^OOPS(2263.7,",IEN=$P($G(INPUT),U),NM=$P($G(INPUT),U,2)
  1. I $G(NM)="" Q
  1. I $G(IEN)="" D UNIADD S IEN=DA
  1. I RESULTS="Failed" Q
  1. S ACR=$P($G(INPUT),U,3),REP=$P($G(INPUT),U,4)
  1. S DA=IEN,DR=".01///^S X=NM;1///^S X=ACR;2///^S X=REP"
  1. D ^DIE
  1. I $G(Y)="" D Q
  1. .;if next line executed, then straight edit, not an add
  1. .I RESULTS="No Changes Filed" S RESULTS="Union Update Successful."
  1. S RESULTS="Union Update NOT Successful."
  1. Q
  1. SITEPGET(RESULTS,FORM) ;
  1. ; Input - FORM = contains either a blank for 'normal' site parameter
  1. ; look ups or 'OSHA300' if for the OSHA 300A summary input
  1. ; Output - RESULTS is an array whose 0 node contains the Site
  1. ; parameter name, IEN, and District Office in the format:
  1. ; SITE NAME^DISTRICT OFFICE^SITE IEN
  1. ; Subsequent nodes starting from 1 contain Station information
  1. ; in the following format:
  1. ; STANM_U_PNM_U_PADD_U_PCTY_U_PST_U_PZIP_U_PTITLE_
  1. ; U_CHGBKCODE_U_SUB_U_STA
  1. N CNT,DOFF,IENS,SIEN,STA,SUB,SNAME,STR,STR2,CBCSUF,OOPSST
  1. S SIEN=$P($G(^OOPS(2262,0)),U,3)
  1. N CBC,STANM,STATION,PNM,PADD,PCTY,PST,PZIP,PTITLE
  1. S (CBC,STATION,PNM,PADD,PCTY,PST,PZIP,PTITLE)=""
  1. N NA,TTL,PHN,EXT,IND,NAICS,SIC
  1. S (NA,TTL,PHN,EXT,IND,NAICS,SIC)=""
  1. I '$G(SIEN) S RESULTS(0)="No Site Parameter File was Found" Q
  1. L +^OOPS(2262,SIEN):2
  1. E S RESULTS(0)="This option in use by another user, try again later." Q
  1. S SNAME=$$GET1^DIQ(2262,SIEN,.01),DOFF=$$GET1^DIQ(2262,SIEN,2,"E")
  1. S RESULTS(0)=SNAME_U_DOFF_U_SIEN
  1. S CNT=1,SUB=""
  1. F S SUB=$O(^OOPS(2262,SIEN,SUB)) Q:SUB="" S STA=0 D
  1. .F S STA=$O(^OOPS(2262,SIEN,SUB,STA)) Q:STA'>0 D
  1. ..S STR=$G(^OOPS(2262,SIEN,SUB,STA,0)),IENS=STA_","_SUB_","
  1. ..S STR2=$G(^OOPS(2262,SIEN,SUB,STA,1))
  1. ..S STATION=$$GET1^DIQ(2262.03,IENS,".01:99")
  1. ..S STANM=$$GET1^DIQ(2262.03,IENS,.01)_" = "_STATION
  1. ..;RRA OOPS*25 - 781436 after STA is sent back as null STA needs to be
  1. ..;set back to original value for proper "$O"rdering.
  1. ..; Patch 5 llh - if station inactive blank STA
  1. ..I $$GET1^DIQ(4,$P(STR,U),101)'="" S OOPSST=STA,STA=""
  1. ..I $G(FORM)="" D
  1. ...S PNM=$P(STR,U,2),PADD=$P(STR,U,3),PCTY=$P(STR,U,4),PZIP=$P(STR,U,6)
  1. ...I $P(STR,U,5)'="" S PST=$$GET1^DIQ(2262.03,IENS,4)
  1. ...I $P(STR,U,7)'="" S PTITLE=$$GET1^DIQ(2262.03,IENS,6)
  1. ...S CBC=$P(STR,U,8) I $G(CBC)'="" S CBC=$$GET1^DIQ(2263.6,CBC,.01)
  1. ...;Patch 5 llh - added CBCSUF sets
  1. ...S CBCSUF=$P(STR,U,9)
  1. ...S RESULTS(CNT)=STANM_U_PNM_U_PADD_U_PCTY_U_PST_U_PZIP_U_PTITLE_U_CBC_U_SUB_U_STA_U_CBCSUF
  1. ..I $G(FORM)="OSHA300" D
  1. ...I $P(STR2,U,1)'="" S NA=$$GET1^DIQ(2262.03,IENS,7)
  1. ...S TTL=$P(STR2,U,2),PHN=$P(STR2,U,3),EXT=$P(STR2,U,4)
  1. ...S IND=$P(STR2,U,5),SIC=$$GET1^DIQ(2262.03,IENS,12)
  1. ...S NAICS=$$GET1^DIQ(2262.03,IENS,13)
  1. ...S RESULTS(CNT)=STANM_U_NA_U_TTL_U_PHN_U_EXT_U_IND_U_SIC_U_NAICS_U_SUB_U_STA_U_$P(STR,U,1)_U
  1. ..I $G(FORM)="" S (STANM,PNM,PADD,PCTY,PST,PZIP,PTITLE,CBC,CBCSUF)=""
  1. ..E S (NA,TTL,PHN,EXT,IND,NAICS,SIC)=""
  1. ..I STA="" S STA=OOPSST
  1. ..S CNT=CNT+1
  1. L -^OOPS(2262,SIEN)
  1. Q
  1. SITEPADD ; Creates a new Station Subfile in the Site Parameter
  1. ; File (#2262
  1. N X,DIC,DLAYGO
  1. S DLAYGO=2262,DIC="^OOPS(2262,"_SIEN_","_SUBF_",",DIC(0)="L"
  1. S DA(1)=SIEN,X=STANM
  1. D FILE^DICN
  1. I Y=-1 S RESULTS="Failed" Q
  1. S DA=+Y,RESULTS="Successfully Added"
  1. Q
  1. SITEPKIL(RESULTS,INPUT) ; Deletes the Station Subfile whose IEN was passed in
  1. ; Input - INPUT contains the Site Parameter file IEN, the subfile IEN,
  1. ; and the Station IEN in the format: SIEN^SUBF^STAIEN
  1. ; Output - RESULTS contains a message with the filing status
  1. N DA,DIK,SIEN,SUBF,STAIEN
  1. S SIEN=$P($G(INPUT),U),SUBF=$P($G(INPUT),U,2),STAIEN=$P($G(INPUT),U,3)
  1. I $G(SIEN)=""!($G(SUBF)="")!($G(STAIEN)="") D Q
  1. .S RESULTS="Missing Record Identifiers, Cannot file."
  1. S DIK="^OOPS(2262,"_SIEN_","_SUBF_","
  1. S DA=STAIEN,DA(1)=SIEN
  1. D ^DIK
  1. I $G(Y)="" S RESULTS="Deletion did not occur." Q
  1. S RESULTS="Record successfully deleted"
  1. Q
  1. SITEPEDT(RESULTS,INPUT,DATA,FORM) ;
  1. ; Edits the Station Subfile whose data and IEN have been passed in
  1. ; Input - INPUT contains the IEN of the Site Parameter file, subfile
  1. ; & Station IEN. If adding new station, the Station IEN
  1. ; = "". INPUT format: SITE IEN^SUBFILE IEN^STATION IEN
  1. ; DATA contains the data to be filed
  1. ; FORM is either "" or "OSHA300" to signify data for filing
  1. ; Output - RESULTS is a single value with a message regarding the
  1. ; filing status
  1. N CBC,DA,DIE,DR,PNM,PADD,PCTY,PST,PZIP,PTITLE,SIEN,SUBF,CBCSUF
  1. N STANM,STAIEN,NA,TTL,PHN,EXT,IND,SIC,NAICS
  1. S RESULTS="Filing"
  1. S SIEN=$P($G(INPUT),U),SUBF=$P($G(INPUT),U,2),STAIEN=$P($G(INPUT),U,3)
  1. I $G(SIEN)="" S RESULTS="Missing Record Identifiers, Cannot file." Q
  1. I '$G(SUBF) S SUBF=$O(^OOPS(2262,SIEN,0)) I '$G(SUBF) S SUBF=1
  1. S STANM=$P($G(DATA),U)
  1. I $G(STANM)="" S RESULTS="Missing Station, Cannot continue." Q
  1. I $G(STAIEN)="" D SITEPADD S STAIEN=DA
  1. I $G(STAIEN)="" S RESULTS="Missing Station, cannot file." Q
  1. S DIE="^OOPS(2262,"_SIEN_","_SUBF_","
  1. S DA=STAIEN,DA(1)=SIEN,DR=""
  1. I $G(FORM)="" D
  1. .S PNM=$P($G(DATA),U,2),PADD=$P($G(DATA),U,3)
  1. .S PCTY=$P($G(DATA),U,4),PST=$P($G(DATA),U,5),PZIP=$P($G(DATA),U,6)
  1. .S PTITLE=$P($G(DATA),U,7),CBC=$P($G(DATA),U,8)
  1. .; Patch 5 llh - Added CBCSUF sets
  1. .S CBCSUF=$P($G(DATA),U,9)
  1. .S DR=".7///^S X=CBC;.8///^S X=CBCSUF;1///^S X=PNM;2///^S X=PADD;3///^S X=PCTY;4///^S X=PST;5///^S X=PZIP;6///^S X=PTITLE"
  1. I $G(FORM)="OSHA300" D
  1. .S NA=$P($G(DATA),U,2),TTL=$P($G(DATA),U,3),PHN=$P($G(DATA),U,4)
  1. .S EXT=$P($G(DATA),U,5),IND=$P($G(DATA),U,6),SIC=$P($G(DATA),U,7)
  1. .S NAICS=$P($G(DATA),U,8)
  1. .S DR="7///^S X=NA;8///^S X=TTL;9///^S X=PHN;10///^S X=EXT"
  1. .S DR=DR_";11///^S X=IND;12///^S X=SIC;13///^S X=NAICS"
  1. I $G(DR)'="" D ^DIE
  1. I $G(Y)="" D Q
  1. .; if line below executed, then no Add, only edit
  1. .I RESULTS="Filing" S RESULTS="Update Successful"
  1. S RESULTS="Update was not Successful"
  1. Q
  1. PARMEDT(RESULTS,INPUT) ; Files changes to top level file (#2262)
  1. ; Input: INPUT - This variable contains the IEN, Site Name, and
  1. ; District Office Name to be filed in the format:
  1. ; IEN^SITE NAME^DISTRICT OFFICE
  1. ; Output: RESULTS - Results will contain a filing status message
  1. N DA,DIE,DR,IEN,SITENM,DISOFF
  1. S IEN=$P($G(INPUT),U),SITENM=$P($G(INPUT),U,2),DISOFF=$P($G(INPUT),U,3)
  1. I '$G(IEN) S RESULTS="Cannot File Changes, no Record Number" Q
  1. S DIE="^OOPS(2262,",DA=IEN
  1. S DR=".01///^S X=SITENM;2///^S X=DISOFF"
  1. D ^DIE
  1. I $G(Y)="" S RESULTS="Update Site data Successful" Q
  1. S RESULTS="Update Site data was NOT Successful"
  1. Q
  1. CHGCASE(RESULTS,INPUT,FLD58) ; File Change Case Status
  1. ; Input: INPUT - IEN^STAT where IEN = the ASISTS case IEN and
  1. ; STAT = the new case status
  1. ; DELETE - Reason for Deletion, field #58, file #2260
  1. ; Output: RESULTS - Message back to client with new Case Status
  1. ;
  1. N CURRENT,DR,DIE,IEN,Y,STATUS
  1. S IEN=$P(INPUT,U),(STATUS,Y)=$P(INPUT,U,2)
  1. I '$G(IEN) S RESULTS="Missing Record Identifier, cannot file." Q
  1. I $$GET1^DIQ(2260,IEN,66)'="",(Y=2) D Q
  1. .S RESULTS="Case transmitted to DOL, cannot change status to Deleted."
  1. S CURRENT=$$GET1^DIQ(2260,IEN,51,"I")
  1. CLOSE ; Close
  1. S DR=""
  1. S DR="51////"_Y
  1. ;If current status goes from closed/deleted to Open, reset field 57
  1. I (CURRENT=1!(CURRENT=2)),(Y=0) S DR=DR_";57////@"
  1. I FLD58]"" S DR=DR_";58////"_FLD58
  1. S DIE="^OOPS(2260,",DA=IEN
  1. D ^DIE K DIE,DA
  1. I $D(Y)'=0 Q
  1. S RESULTS="Case Status has been changed to: "_$$GET1^DIQ(2260,IEN,51)
  1. ;01/02/04 Patch 4 llh- if case = closed, send bulletin
  1. I STATUS=1 D CLSCASE^OOPSMBUL(IEN)
  1. Q