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

SDUTL3.m

Go to the documentation of this file.
  1. SDUTL3 ;ALB/REW - Primary Care API Calls ;9/16/10 17:17
  1. ;;5.3;PIMS;**30,39,41,148,177,1015,1016**;JUN 30, 2012;Build 20
  1. ;
  1. OUTPTPR(DFN,SCDATE,SCPCROLE) ;given patient, return internal^external of the pc practitioner
  1. ; Input: DFN - ien of patient file (#2)
  1. ; SCDATE - Relevant Date (Default=DT)
  1. ; SCPCROLE - Type of PC Role (Default =1 (PC Practitioner),2=Attending
  1. ; Returned: pointer to file #200^external value of name
  1. ; or, if error or none defined, returns a 0 or null
  1. ; Note: This call will continue to be supported with the PCMM release
  1. ;
  1. ; *** SUPPORTED API ***
  1. ;
  1. Q:'$G(DFN) 0
  1. S SCDATE=$G(SCDATE,DT)
  1. S SCPCROLE=$G(SCPCROLE) I $L(SCPCROLE)'=1!(12'[SCPCROLE) S SCPCROLE=1
  1. Q $$NMPCPR^SCAPMCU2(.DFN,.SCDATE,.SCPCROLE)
  1. ;
  1. OUTPTAP(DFN,SCDATE) ;given patient, return internal^external of the pc associate provider
  1. ; Input: DFN - ien of patient file (#2)
  1. ; SCDATE - Relevant Date (Default=DT)
  1. ; Returned: pointer to file #200^external value of name
  1. ; or, if error or none defined, returns a 0 or null
  1. ;
  1. ; *** SUPPORTED API ***
  1. ;
  1. Q:'$G(DFN) 0
  1. S SCDATE=$G(SCDATE,DT)
  1. Q $$NMPCPR^SCAPMCU2(.DFN,.SCDATE,3)
  1. ;
  1. OUTPTTM(DFN,SCDATE,ASSTYPE) ;given patient, return internal^external of the pc team
  1. ;Input: DFN - ien of patient file (#2)
  1. ; SCDATE - Date of interest (Default=dt)
  1. ; ASSTYPE - Assignment Type (Default=1: PC Team)
  1. ;
  1. ; Returned: pointer to team file (#404.51)
  1. ; or, if error or none defined, returns 0 or null
  1. ; Note: This call will continue to be supported with the PCMM release
  1. ; additional, optional parameters may be added (e.g. effective dt)
  1. ;
  1. Q:'$G(DFN) 0
  1. S SCDATE=$G(SCDATE,DT)
  1. S ASSTYPE=$G(ASSTYPE,1)
  1. Q $$NMPCTM^SCAPMCU2(.DFN,.SCDATE,.ASSTYPE)
  1. ;
  1. INPTPR(DFN,PRACT) ;store current PC practitioner; return SDOKS=1, if OK
  1. ; Input: DFN: ien of patient file (#2)
  1. ; PRACT: ien of file #200 if adding,changing field
  1. ; null or '@' if deleting field
  1. ; Output:SDOKS: 0, if fails to store, 1 otherwise
  1. ;
  1. ; Note: This data is stored in field #404.01 of the patient file.
  1. ; With the release of PCMM, this is no longer a valid method
  1. ; to enter provider information for PCMM.
  1. ;
  1. ; **** PLANNED FOR REMOVAL IN THE FUTURE ****
  1. ;
  1. ; Selected NEW PERSON entry must be active and must hold provider key
  1. I '$G(DFN)!('$D(PRACT)#2)!('$D(^DPT(+DFN,0))) S SDOKS=0 Q
  1. D EN^DDIOL("Note: This is NOT automatically added to PCMM Files")
  1. D EN^DDIOL("This data should now be entered via PCMM Input Screens")
  1. S SDOKS=1
  1. N DIE,DIC,DR,DA,X
  1. I PRACT=""!(PRACT="@") D G QTIPR
  1. .S DIE="^DPT("
  1. .S DR="404.01////^S X=""@"""
  1. .S DA=DFN
  1. .D ^DIE
  1. I '$$SCREEN^DGPMDD(PRACT) S SDOKS=0 Q
  1. I $D(^VA(200,+PRACT,0)) D
  1. .S DIE="^DPT("
  1. .S DR="404.01////^S X=+PRACT"
  1. .S DA=DFN
  1. .D ^DIE
  1. E D
  1. .S SDOKS=0
  1. QTIPR Q
  1. INPTTM(DFN,TEAM) ;store current PC team; return SDOKS=0, if fails
  1. ; Input: DFN: ien of patient file (#2)
  1. ; TEAM: ien of file #404.51 if adding,changing field
  1. ; null or '@' if deleting field
  1. ; Output:SDOKS: 0, if fails to store, 1 otherwise
  1. ;
  1. ; Note: This data is stored in field #404.02 of the patient file.
  1. ; With the release of PCMM, this is no longer a valid method
  1. ; to enter team information for PCMM.
  1. ;
  1. ; **** PLANNED FOR REMOVAL IN THE FUTURE ****
  1. ;
  1. I '$G(DFN)!('$D(TEAM)#2)!('$D(^DPT(+DFN,0))) S SDOKS=0 Q
  1. D EN^DDIOL("This data should now be entered via PCMM Input Screens")
  1. N DIE,DIC,DR,DA,X
  1. S SDOKS=1
  1. I TEAM=""!(TEAM="@") D G QTITM
  1. .S DIE="^DPT("
  1. .S DR="404.02////^S X=""@"""
  1. .S DA=DFN
  1. .D ^DIE
  1. I $D(^SCTM(404.51,+TEAM,0)) D
  1. .S DIE="^DPT("
  1. .S DR="404.02////^S X=+TEAM"
  1. .S DA=DFN
  1. .D ^DIE
  1. E D
  1. .S SDOKS=0
  1. QTITM Q
  1. ;
  1. UPDLOCAL ;Called from SD EDIT LOCAL STOP CODE NAME option. Allows entry of the .01 field of file 40.7 only if the amis code indicates it is a local entry
  1. ;Entire section added in patch 568
  1. N DIC,DIE,SDASC,DA,Y,X,DR
  1. W !!,"You may only edit the NAME field of locally defined entries.",!,"Enter ?? to see the list of entries you're allowed to edit.",!
  1. S DIC=40.7,DIC(0)="AEMQ",DIC("S")="S SDASC=+$P(^DIC(40.7,+Y,0),U,2) I SDASC&(SDASC>450)&(SDASC<486)&(SDASC'=457)&(SDASC'=474)&(SDASC'=480)&(SDASC'=481)" ;only allows local amis codes
  1. D ^DIC Q:Y=-1 ;Stop if entry selected isn't one of the local entries
  1. S DIE=40.7,DA=+Y,DR=".01"
  1. D ^DIE
  1. Q ;End of section