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

SCMCFPOS.m

Go to the documentation of this file.
SCMCFPOS ;ALB/ART - PCMM Web-Fix Standard Position ;02/27/2015
 ;;5.3;Scheduling;**603**;Aug 13, 1993;Build 79
 ;
 QUIT
 ;
 ;Public, Supported ICRs
 ; #2053 - Data Base Server API: Editing Utilities (DIE)
 ; #2056 - Data Base Server API: Data Retriever Utilities (DIQ) 
 ; #10112 - VASITE - Supported APIs for site info
 ; #10103 - XLFDT - Supported APIs for date & time
 ;
 ; This routine will fix entries in the Team Position (404.57) file at sites that deviated from
 ;  the gold Standard Position (403.46) file.
 ;
 ; >>> THIS ROUTINE MAY ONLY BE RUN ONCE PER AFFECTED SITE <<<
 ; >>> (unless the global backup of 404.57 is restored)    <<<
 ;
EN ;Main Entry Point
 ;
 IF $DATA(^XTMP("SCMCFPOS")) DO  QUIT
 . WRITE !!,"This cleanup process has already been run at this site.",!
 . WRITE "To run it again:",!
 . WRITE "  Restore the backup of the Team Position File",!
 . WRITE "  Delete the ^XTMP(SCMCFPOS) global",!
 . WRITE "  Rerun this routine",!
 . WRITE "Steps may be found in the PCMM Web-VistA Installation Guide",!!
 ;
 NEW SCI,SCSITE,SCCODE,SCIEN,SCPOS
 NEW SCIENS,SCFDA,SCERR
 ;
 KILL ^TMP("SCMCFPOS",$JOB)
 ;
 ;Get local site ID
 SET SCSITE=$PIECE($$SITE^VASITE(),U,3)
 ;Build ^TMP global with position IENs
 FOR SCI=1:1 SET SCCODE=$PIECE($TEXT(POSDATA+SCI),";;",2) QUIT:SCCODE="$$END"  DO
 . SET ^TMP("SCMCFPOS",$JOB,$PIECE(SCCODE,U,1),$PIECE(SCCODE,U,2))=$PIECE(SCCODE,U,3)
 ;If site needs conversion
 IF $DATA(^TMP("SCMCFPOS",$JOB,SCSITE)) DO
 . SET ^XTMP("SCMCFPOS",0)=$$FMADD^XLFDT($$DT^XLFDT(),365)_U_$$DT^XLFDT()_U_"Standard Position Fix"
 . SET SCIEN=0
 . FOR  SET SCIEN=$ORDER(^SCTM(404.57,SCIEN)) QUIT:+SCIEN=0  DO
 . . SET SCPOS=$$GET1^DIQ(404.57,SCIEN,.03,"I")
 . . QUIT:SCPOS=""
 . . IF $DATA(^TMP("SCMCFPOS",$JOB,SCSITE,SCPOS)) DO
 . . . SET ^XTMP("SCMCFPOS",SCIEN,"1-Before")=^SCTM(404.57,SCIEN,0)
 . . . SET SCIENS=SCIEN_","
 . . . NEW SCFDA
 . . . SET SCFDA(404.57,SCIENS,.03)=^TMP("SCMCFPOS",$JOB,SCSITE,SCPOS)
 . . . DO FILE^DIE("K","SCFDA","SCERR")
 . . . SET ^XTMP("SCMCFPOS",SCIEN,"2-After")=^SCTM(404.57,SCIEN,0)
 ELSE  DO
 . W !,"Site does not deviate from gold Standard Position reference file.",!
 ;
 KILL ^TMP("SCMCFPOS",$JOB)
 QUIT
 ;
POSDATA ;Position Conversion Data ;site^bad pos ien^good pos ien^name
 ;;614^46^45^ADDICTION THERAPIST
 ;;614^47^46^ADDICTION THERAPIST (MHTC)
 ;;614^27^26^CARE MANAGER
 ;;614^29^28^CASE MANAGER
 ;;614^44^43^CHAPLAIN
 ;;614^45^44^CHAPLAIN (MHTC)
 ;;614^38^37^CLINICAL NURSE SPECIALIST (MHTC)
 ;;614^39^38^CLINICAL PHARMACIST (MHTC)
 ;;614^31^30^DESIGNATED WOMEN'S HEALTH PROVIDER
 ;;614^28^27^HEALTH TECHNICIAN
 ;;614^40^39^LPC
 ;;614^41^40^LPC (MHTC)
 ;;614^42^41^MFT
 ;;614^43^42^MFT (MHTC)
 ;;614^48^47^NURSE (RN) (MHTC)
 ;;614^36^35^NURSE PRACTITIONER (MHTC)
 ;;614^49^48^OCCUPATIONAL THERAPIST
 ;;614^50^49^OCCUPATIONAL THERAPIST (MHTC)
 ;;614^26^25^OIF OEF CLINICAL CASE MANAGER
 ;;614^25^24^OIF OEF PROGRAM MANAGER
 ;;614^24^23^OIF OEF TRANSITION PATIENT ADVOCATE
 ;;614^37^36^PHYSICIAN ASSISTANT (MHTC)
 ;;614^35^34^PHYSICIAN-PSYCHIATRIST (MHTC)
 ;;614^32^31^PSYCHOLOGIST (MHTC)
 ;;614^34^33^REHAB/PSYCH TECHNICIAN (MHTC)
 ;;614^23^9^SOCIAL WORKER
 ;;614^33^32^SOCIAL WORKER (MHTC)
 ;;614^30^29^TRAINEE
 ;;614^51^50^VOC REHAB SPEC/COUNSELOR
 ;;614^52^51^VOC REHAB SPEC/COUNSELOR (MHTC)
 ;;501^44^45^ADDICTION THERAPIST
 ;;501^45^46^ADDICTION THERAPIST (MHTC)
 ;;501^501001^28^CASE MANAGER
 ;;501^42^43^CHAPLAIN
 ;;501^43^44^CHAPLAIN (MHTC)
 ;;501^36^37^CLINICAL NURSE SPECIALIST (MHTC)
 ;;501^37^38^CLINICAL PHARMACIST (MHTC)
 ;;501^38^39^LPC
 ;;501^39^40^LPC (MHTC)
 ;;501^40^41^MFT
 ;;501^41^42^MFT (MHTC)
 ;;501^46^47^NURSE (RN) (MHTC)
 ;;501^34^35^NURSE PRACTITIONER (MHTC)
 ;;501^47^48^OCCUPATIONAL THERAPIST
 ;;501^48^49^OCCUPATIONAL THERAPIST (MHTC)
 ;;501^35^36^PHYSICIAN ASSISTANT (MHTC)
 ;;501^33^34^PHYSICIAN-PSYCHIATRIST (MHTC)
 ;;501^28^31^PSYCHOLOGIST (MHTC)
 ;;501^32^33^REHAB/PSYCH TECHNICIAN (MHTC)
 ;;501^31^32^SOCIAL WORKER (MHTC)
 ;;501^49^50^VOC REHAB SPEC/COUNSELOR
 ;;501^50^51^VOC REHAB SPEC/COUNSELOR (MHTC)
 ;;512^44^45^ADDICTION THERAPIST
 ;;512^45^46^ADDICTION THERAPIST (MHTC)
 ;;512^29^26^CARE MANAGER
 ;;512^51^28^CASE MANAGER
 ;;512^42^43^CHAPLAIN
 ;;512^43^44^CHAPLAIN (MHTC)
 ;;512^36^37^CLINICAL NURSE SPECIALIST (MHTC)
 ;;512^37^38^CLINICAL PHARMACIST (MHTC)
 ;;512^57^30^DESIGNATED WOMEN'S HEALTH PROVIDER
 ;;512^30^27^HEALTH TECHNICIAN
 ;;512^38^39^LPC
 ;;512^39^40^LPC (MHTC)
 ;;512^40^41^MFT
 ;;512^41^42^MFT (MHTC)
 ;;512^46^47^NURSE (RN) (MHTC)
 ;;512^32^35^NURSE PRACTITIONER (MHTC)
 ;;512^47^48^OCCUPATIONAL THERAPIST
 ;;512^48^49^OCCUPATIONAL THERAPIST (MHTC)
 ;;512^33^36^PHYSICIAN ASSISTANT (MHTC)
 ;;512^31^34^PHYSICIAN-PSYCHIATRIST (MHTC)
 ;;512^26^31^PSYCHOLOGIST (MHTC)
 ;;512^28^33^REHAB/PSYCH TECHNICIAN (MHTC)
 ;;512^27^32^SOCIAL WORKER (MHTC)
 ;;512^52^29^TRAINEE
 ;;512^49^50^VOC REHAB SPEC/COUNSELOR
 ;;512^50^51^VOC REHAB SPEC/COUNSELOR (MHTC)
 ;;528^44^45^ADDICTION THERAPIST
 ;;528^45^46^ADDICTION THERAPIST (MHTC)
 ;;528^59^26^CARE MANAGER
 ;;528^58^28^CASE MANAGER
 ;;528^42^43^CHAPLAIN
 ;;528^43^44^CHAPLAIN (MHTC)
 ;;528^36^37^CLINICAL NURSE SPECIALIST (MHTC)
 ;;528^37^38^CLINICAL PHARMACIST (MHTC)
 ;;528^60^30^DESIGNATED WOMEN'S HEALTH PROVIDER
 ;;528^61^27^HEALTH TECHNICIAN
 ;;528^38^39^LPC
 ;;528^39^40^LPC (MHTC)
 ;;528^29^41^MFT
 ;;528^30^42^MFT (MHTC)
 ;;528^46^47^NURSE (RN) (MHTC)
 ;;528^32^35^NURSE PRACTITIONER (MHTC)
 ;;528^47^48^OCCUPATIONAL THERAPIST
 ;;528^48^49^OCCUPATIONAL THERAPIST (MHTC)
 ;;528^33^36^PHYSICIAN ASSISTANT (MHTC)
 ;;528^31^34^PHYSICIAN-PSYCHIATRIST (MHTC)
 ;;528^26^31^PSYCHOLOGIST (MHTC)
 ;;528^28^33^REHAB/PSYCH TECHNICIAN (MHTC)
 ;;528^27^32^SOCIAL WORKER (MHTC)
 ;;528^62^29^TRAINEE
 ;;528^51^50^VOC REHAB SPEC/COUNSELOR
 ;;528^52^51^VOC REHAB SPEC/COUNSELOR (MHTC)
 ;;548^44^45^ADDICTION THERAPIST
 ;;548^45^46^ADDICTION THERAPIST (MHTC)
 ;;548^29^26^CARE MANAGER
 ;;548^51^28^CASE MANAGER
 ;;548^42^43^CHAPLAIN
 ;;548^43^44^CHAPLAIN (MHTC)
 ;;548^23^22^CLINICAL NURSE SPECIALIST
 ;;548^36^37^CLINICAL NURSE SPECIALIST (MHTC)
 ;;548^37^38^CLINICAL PHARMACIST (MHTC)
 ;;548^57^30^DESIGNATED WOMEN'S HEALTH PROVIDER
 ;;548^21^20^DIETITIAN
 ;;548^30^27^HEALTH TECHNICIAN
 ;;548^38^39^LPC
 ;;548^39^40^LPC (MHTC)
 ;;548^58^41^MFT
 ;;548^59^42^MFT (MHTC)
 ;;548^46^47^NURSE (RN) (MHTC)
 ;;548^32^35^NURSE PRACTITIONER (MHTC)
 ;;548^47^48^OCCUPATIONAL THERAPIST
 ;;548^48^49^OCCUPATIONAL THERAPIST (MHTC)
 ;;548^20^23^OIF OEF TRANSITION PATIENT ADVOCATE
 ;;548^33^36^PHYSICIAN ASSISTANT (MHTC)
 ;;548^31^34^PHYSICIAN-PSYCHIATRIST (MHTC)
 ;;548^26^31^PSYCHOLOGIST (MHTC)
 ;;548^28^33^REHAB/PSYCH TECHNICIAN (MHTC)
 ;;548^27^32^SOCIAL WORKER (MHTC)
 ;;548^22^21^TEAM PHARMACIST
 ;;548^52^29^TRAINEE
 ;;548^60^50^VOC REHAB SPEC/COUNSELOR
 ;;548^61^51^VOC REHAB SPEC/COUNSELOR (MHTC)
 ;;558^44^45^ADDICTION THERAPIST
 ;;558^45^46^ADDICTION THERAPIST (MHTC)
 ;;558^59^26^CARE MANAGER
 ;;558^58^28^CASE MANAGER
 ;;558^42^43^CHAPLAIN
 ;;558^43^44^CHAPLAIN (MHTC)
 ;;558^36^37^CLINICAL NURSE SPECIALIST (MHTC)
 ;;558^37^38^CLINICAL PHARMACIST (MHTC)
 ;;558^60^30^DESIGNATED WOMEN'S HEALTH PROVIDER
 ;;558^61^27^HEALTH TECHNICIAN
 ;;558^38^39^LPC
 ;;558^39^40^LPC (MHTC)
 ;;558^29^41^MFT
 ;;558^30^42^MFT (MHTC)
 ;;558^46^47^NURSE (RN) (MHTC)
 ;;558^32^35^NURSE PRACTITIONER (MHTC)
 ;;558^47^48^OCCUPATIONAL THERAPIST
 ;;558^48^49^OCCUPATIONAL THERAPIST (MHTC)
 ;;558^33^36^PHYSICIAN ASSISTANT (MHTC)
 ;;558^31^34^PHYSICIAN-PSYCHIATRIST (MHTC)
 ;;558^26^31^PSYCHOLOGIST (MHTC)
 ;;558^28^33^REHAB/PSYCH TECHNICIAN (MHTC)
 ;;558^27^32^SOCIAL WORKER (MHTC)
 ;;558^62^29^TRAINEE
 ;;558^51^50^VOC REHAB SPEC/COUNSELOR
 ;;558^52^51^VOC REHAB SPEC/COUNSELOR (MHTC)
 ;;590^23^22^CLINICAL NURSE SPECIALIST
 ;;590^21^20^DIETITIAN
 ;;590^20^23^OIF OEF TRANSITION PATIENT ADVOCATE
 ;;590^22^21^TEAM PHARMACIST
 ;;598^44^45^ADDICTION THERAPIST
 ;;598^45^46^ADDICTION THERAPIST (MHTC)
 ;;598^59^26^CARE MANAGER
 ;;598^58^28^CASE MANAGER
 ;;598^42^43^CHAPLAIN
 ;;598^43^44^CHAPLAIN (MHTC)
 ;;598^36^37^CLINICAL NURSE SPECIALIST (MHTC)
 ;;598^37^38^CLINICAL PHARMACIST (MHTC)
 ;;598^60^30^DESIGNATED WOMEN'S HEALTH PROVIDER
 ;;598^61^27^HEALTH TECHNICIAN
 ;;598^38^39^LPC
 ;;598^39^40^LPC (MHTC)
 ;;598^40^41^MFT
 ;;598^41^42^MFT (MHTC)
 ;;598^46^47^NURSE (RN) (MHTC)
 ;;598^32^35^NURSE PRACTITIONER (MHTC)
 ;;598^47^48^OCCUPATIONAL THERAPIST
 ;;598^48^49^OCCUPATIONAL THERAPIST (MHTC)
 ;;598^33^36^PHYSICIAN ASSISTANT (MHTC)
 ;;598^31^34^PHYSICIAN-PSYCHIATRIST (MHTC)
 ;;598^26^31^PSYCHOLOGIST (MHTC)
 ;;598^28^33^REHAB/PSYCH TECHNICIAN (MHTC)
 ;;598^27^32^SOCIAL WORKER (MHTC)
 ;;598^62^29^TRAINEE
 ;;598^49^50^VOC REHAB SPEC/COUNSELOR
 ;;598^50^51^VOC REHAB SPEC/COUNSELOR (MHTC)
 ;;644^44^45^ADDICTION THERAPIST
 ;;644^45^46^ADDICTION THERAPIST (MHTC)
 ;;644^29^26^CARE MANAGER
 ;;644^51^28^CASE MANAGER
 ;;644^42^43^CHAPLAIN
 ;;644^43^44^CHAPLAIN (MHTC)
 ;;644^36^37^CLINICAL NURSE SPECIALIST (MHTC)
 ;;644^37^38^CLINICAL PHARMACIST (MHTC)
 ;;644^57^30^DESIGNATED WOMEN'S HEALTH PROVIDER
 ;;644^30^27^HEALTH TECHNICIAN
 ;;644^38^39^LPC
 ;;644^39^40^LPC (MHTC)
 ;;644^58^41^MFT
 ;;644^59^42^MFT (MHTC)
 ;;644^46^47^NURSE (RN) (MHTC)
 ;;644^32^35^NURSE PRACTITIONER (MHTC)
 ;;644^47^48^OCCUPATIONAL THERAPIST
 ;;644^48^49^OCCUPATIONAL THERAPIST (MHTC)
 ;;644^33^36^PHYSICIAN ASSISTANT (MHTC)
 ;;644^31^34^PHYSICIAN-PSYCHIATRIST (MHTC)
 ;;644^26^31^PSYCHOLOGIST (MHTC)
 ;;644^28^33^REHAB/PSYCH TECHNICIAN (MHTC)
 ;;644^27^32^SOCIAL WORKER (MHTC)
 ;;644^52^29^TRAINEE
 ;;644^60^50^VOC REHAB SPEC/COUNSELOR
 ;;644^61^51^VOC REHAB SPEC/COUNSELOR (MHTC)
 ;;679^23^22^CLINICAL NURSE SPECIALIST
 ;;679^21^20^DIETITIAN
 ;;679^20^23^OIF OEF TRANSITION PATIENT ADVOCATE
 ;;679^22^21^TEAM PHARMACIST
 ;;$$END