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

MCPSGEN.m

Go to the documentation of this file.
MCPSGEN ;HCIOFO/JCC-POST INSTALL FOR G.P. (PATCH 8) ;5/27/97  09:56
 ;;2.3;Medicine;**8**;09/13/1996
EN ;This routine is to populate the PROCEDURE/SUBSPECIALTY field in 697.2
 ;and to CONVERT DATA for the field .05 and .06 for 699.5
 N MCY,MCPS
 S MCY=0 F  S MCY=$O(^MCAR(697.2,MCY)) Q:+MCY=0  D  ;
 .I $$GET1^DIQ(697.2,MCY,3,"I")="GEN" S MCPS="MCKEYGEN",DIE="^MCAR(697.2,",DR="12///^S X=MCPS",DA=MCY D ^DIE
 .Q:$$GET1^DIQ(697.2,MCY,1001,"I")'=""
 .S MCPS="P"
 .I $$GET1^DIQ(697.2,MCY,3,"I")="Z" S MCPS="S"
 .S DIE="^MCAR(697.2,",DR="1001///^S X=MCPS",DA=MCY D ^DIE
EN2 N MC005,MC006,MCP,MCS
 S MCS=$O(^MCAR(697.2,"B","GENERIC SUBSPECIALTY",0)) Q:MCS=0
 S MCP=$O(^MCAR(697.2,"B","GENERIC PROCEDURE",0)) Q:MCP=0
 S MCY=0 F  S MCY=$O(^MCAR(699.5,MCY)) Q:+MCY=0  D  ;
 .S MC005=$$GET1^DIQ(699.5,MCY,.05,"I") Q:MC005=""
 .S MC006=$$GET1^DIQ(699.5,MCY,.06,"I")
 .S MCPS=$$GET1^DIQ(697.2,MC005,1001,"I")
 .I MCPS="P" D  Q  ;move procedure to .06, add "GENERIC SUBSPECIALTY" to .05
 ..S DIE="^MCAR(699.5,",DR=".06///^S X=MC005",DA=MCY D ^DIE
 ..S DIE="^MCAR(699.5,",DR=".05///^S X=MCS",DA=MCY D ^DIE
 .I (MCPS="S"),(MC006="") D  Q  ;fill out "GENERIC PROCEDURE" to .06
 ..S DIE="^MCAR(699.5,",DR=".06///^S X=MCP",DA=MCY D ^DIE
 Q