ORFEDT ;SLC/AGP - GENERIC EDIT FORM ;Aug 25, 2022@11:34:47
;;3.0;ORDER ENTRY/RESULTS REPORTING;**405**;Dec 17, 1997;Build 211
Q
;
BLDPRMPT(PROMPTS) ;
S PROMPTS("pnumCode")=2
S PROMPTS("pnumPrvdrIEN")=2
S PROMPTS("pnumCategory")=3
S PROMPTS("pnumNarrative")=4
S PROMPTS("pnumExamResults")=5
S PROMPTS("pnumSkinResults")=5
S PROMPTS("pnumHFLevel")=5
S PROMPTS("pnumImmSeries")=5
S PROMPTS("pnumProcQty")=5
S PROMPTS("pnumPEDLevel")=5
S PROMPTS("pnumDiagPrimary")=5
S PROMPTS("pnumPrvdrName")=5
S PROMPTS("pnumProvider")=6
S PROMPTS("pnumPrvdrPrimary")=6
S PROMPTS("pnumWarnDate")=6
S PROMPTS("pnumSkinReading")=7
S PROMPTS("pnumImmReaction")=7
S PROMPTS("pnumDiagAdd2PL")=7
S PROMPTS("pnumSkinDTRead")=8
S PROMPTS("pnumImmContra")=8
S PROMPTS("pnumSkinDTGiven")=9
S PROMPTS("pnumImmRefused")=9
S PROMPTS("pnumCPTMods")=9
S PROMPTS("pnumComment")=10
;S PROMPTS("pnumOutSideLocation")=11
S PROMPTS("pnumSkinReader")=11
S PROMPTS("pnumSkinReaderIEN")=11
S PROMPTS("pnumWHPapResult")=11
S PROMPTS("pnumWHNotPurp")=12
S PROMPTS("pnumDataSource")=12
S PROMPTS("pnumSkinOrderBy")=12
S PROMPTS("pnumDate")=13
S PROMPTS("pnumImmDosage")=13
S PROMPTS("pnumSkinSite")=13
S PROMPTS("pnumImmOrderByIEN")=20
S PROMPTS("pnumRemGenFindID")=14
S PROMPTS("pnumImmRoute")=14
S PROMPTS("pnumSkinReadingComment")=14
S PROMPTS("pnumImmSite")=15
S PROMPTS("pnumImmLot")=16
S PROMPTS("pnumRemGenFindNewData")=16
S PROMPTS("pnumRemGenFindGroup")=17
S PROMPTS("pnumImmManufacturer")=17
S PROMPTS("pnumExpirationDate")=18
S PROMPTS("pnumImmRouteIEN")=18
S PROMPTS("pnumGFPrint")=18
S PROMPTS("pnumAdminDate")=19
S PROMPTS("pnumImmOrderByIEN")=20
S PROMPTS("pnumIMMVIS")=21
S PROMPTS("pnumImmOverride")=24
;S PROMPTS("pnumImmDocumType")=30
;S PROMPTS("pnumImmCPTCodes")=31
S PROMPTS("pnumOutSideLocation")=32
;S PROMPTS("pnumImmDXCodes")=33
S PROMPTS("pnumReadingIEN")=16
S PROMPTS("pnumRefusedGroup")=11
S PROMPTS("pnumAdminByPolicy")=31
Q
;
BLDPARR(RESULT) ;
S RESULT("ADMIN ROUTE")="pnumImmRoute"
S RESULT("ADMIN SITE")="pnumImmSite"
S RESULT("ANATOMIC LOC")="pnumImmSite"
S RESULT("COMMENTS")="pnumComment"
;S RESULT("CODES CPT")="pnumImmCPTCodes"
;S RESULT("CODES DX")="pnumImmDXCodes"
S RESULT("CONTRAINDICATED")="pnumImmContra"
S RESULT("CONTRA/REFUSAL")="CONTRA"
S RESULT("REFUSAL")="pnumImmRefused"
S RESULT("CVX")=""
S RESULT("DATA SOURCE")=""
S RESULT("DATE RECORDED")=""
S RESULT("DOCUMENTER")=""
S RESULT("DOSE")="pnumImmDosage"
S RESULT("DOSE UNITS")=""
S RESULT("ENCOUNTER PROVIDER")="pnumProvider"
S RESULT("EVENT DATE AND TIME")="pnumAdminDate"
S RESULT("EXPIRATION DATE")="pnumExpirationDate"
S RESULT("FACILITY")=""
S RESULT("IMMUN")=4
S RESULT("IMMUNIZATION")=4
S RESULT("INFO SOURCE")="pnumDataSource"
S RESULT("LOCATION")="pnumOutSideLocation"
S RESULT("LOT NUMBER")="pnumImmLot"
S RESULT("MANUFACTURER")="pnumImmManufacturer"
S RESULT("ORDERING PROVIDER")="pnumImmOrderByIEN"
S RESULT("OVERRIDE REASON")="pnumImmOverride"
S RESULT("REACTION")="pnumImmReaction"
S RESULT("PLACEMENT IEN")="pnumReadingIEN"
S RESULT("READING")="pnumSkinReading"
S RESULT("RESULTS")="pnumSkinResults"
S RESULT("READING COMMENTS")="pnumComment"
S RESULT("SERIES")="pnumImmSeries"
S RESULT("SKIN TEST")=4
S RESULT("VACCINE GROUP",1,0)=""
S RESULT("VALUE")=""
S RESULT("VIS OFFERED")="pnumIMMVIS"
S RESULT("VISIT")=""
S RESULT("VISIT DATE TIME")="pnumAdminDate"
S RESULT("WARN UNTIL DATE")="pnumWarnDate"
S RESULT("WARNING ACK")=""
S RESULT("READER")="pnumSkinReader"
S RESULT("DATE READ")="pnumSkinDTRead"
S RESULT("CVXONLY")="pnumRefusedGroup"
S RESULT("ORDERED BY POLICY")="pnumAdminByPolicy"
Q
;
GETLAYOT(RESULT,INPUTS,DEFAULTS) ;
N DATAARR,DATATYPE,DEFLIST,NODE,X
M DATAARR=INPUTS("DATA")
;M EDITARR=INPUTS("EDIT DATA")
S DATATYPE=DATAARR("TYPE")
I $D(DEFAULTS) D BLDDEFLS(.DEFAULTS,.DEFLIST)
I DATATYPE="SKIN TEST" D GET^ORFSKT(.RESULT,.DATAARR,.DEFLIST) Q
I DATATYPE="IMMUNIZATION" D GET^ORFIMM(.RESULT,.DATAARR,.DEFLIST) Q
;I DATATYPE="ZZAGP" D GET^ZZAGPFEDT(.RESULT,.DATAARR,.DEFLIST) Q
Q
;
BLDLAYOT(RESULT,INPUTS,TYPE,CONTROL) ;
I CONTROL="SKIN TEST" D BLDLAYOT^ORFSKT(.RESULT,.INPUTS,TYPE) Q
I CONTROL="IMMUNIZATION" D BLDLAYOT^ORFIMM(.RESULT,.INPUTS,TYPE) Q
;I CONTROL="ZZAGP" D BLDLAYOT^ZZAGPFEDT(.RESULT,.INPUTS,TYPE)
Q
;
BLDDEFLS(DEFAULTS,DEFLIST) ;
N CNT,LNAME,LNODE,MARRAY,MCNT,NODE
S LNAME=0,MCNT=0
S CNT=0 F S CNT=$O(DEFAULTS(CNT)) Q:CNT'>0 D
.S NODE=DEFAULTS(CNT)
.I LNAME="" S LNAME=$P(NODE,U),DEFLIST(LNAME)=$P(NODE,U,2,$L(NODE,U)) Q
.I LNAME=$P(NODE,U) S MCNT=MCNT+1,MARRAY(LNAME,MCNT)=$P(NODE,U,2,$L(NODE,U)) Q
.I LNAME'=$P(NODE,U) S LNAME=$P(NODE,U) S DEFLIST($P(NODE,U))=$P(NODE,U,2,$L(NODE,U))
I '$D(MARRAY) Q
S LNAME="" F S LNAME=$O(MARRAY(LNAME)) Q:LNAME="" D
.K DEFLIST(LNAME) S MCNT=0
.S CNT=0 F S CNT=$O(MARRAY(LNAME,CNT)) Q:CNT'>0 D
..S MCNT=MCNT+1,DEFLIST(LNAME,MCNT)=MARRAY(LNAME,CNT)
Q
;
;
BLDRESLT(RESULTS,LIST,INPUTS) ;
N CNT,DATETIME,ENCTYPE,LOC,X
I INPUTS("TYPE")="IMMUNIZATION" D BLD^ORFIMM1(.RESULTS,.LIST,.INPUTS) G BLDX
I INPUTS("TYPE")="SKIN TEST" D BLD^ORFSKT(.RESULTS,.LIST,.INPUTS) G BLDX
;I INPUTS("TYPE")="ZZAGP" D BLD^ZZAGPFEDT(.RESULTS,.LIST,.INPUTS)
BLDX ;
;
S CNT=""
S CNT=$O(RESULTS(CNT),-1)
S X=0 F S X=$O(LIST(X)) Q:X'>0 D
.S CNT=CNT+1,RESULTS(CNT)="LAYOUT"_U_LIST(X)
Q
;
GETSERIES(RESULTS) ;
N DATALST,IDX
D GETSET^ORWPCE2(.DATALST,9000010.11,.04,1)
S IDX=0 F S IDX=$O(DATALST(IDX)) Q:IDX'>0 D
.S RESULTS("series",IDX,"internal")=$P(DATALST(IDX),U)
.S RESULTS("series",IDX,"external")=$P(DATALST(IDX),U,2)
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORFEDT 5770 printed Nov 22, 2024@17:40:44 Page 2
ORFEDT ;SLC/AGP - GENERIC EDIT FORM ;Aug 25, 2022@11:34:47
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**405**;Dec 17, 1997;Build 211
+2 QUIT
+3 ;
BLDPRMPT(PROMPTS) ;
+1 SET PROMPTS("pnumCode")=2
+2 SET PROMPTS("pnumPrvdrIEN")=2
+3 SET PROMPTS("pnumCategory")=3
+4 SET PROMPTS("pnumNarrative")=4
+5 SET PROMPTS("pnumExamResults")=5
+6 SET PROMPTS("pnumSkinResults")=5
+7 SET PROMPTS("pnumHFLevel")=5
+8 SET PROMPTS("pnumImmSeries")=5
+9 SET PROMPTS("pnumProcQty")=5
+10 SET PROMPTS("pnumPEDLevel")=5
+11 SET PROMPTS("pnumDiagPrimary")=5
+12 SET PROMPTS("pnumPrvdrName")=5
+13 SET PROMPTS("pnumProvider")=6
+14 SET PROMPTS("pnumPrvdrPrimary")=6
+15 SET PROMPTS("pnumWarnDate")=6
+16 SET PROMPTS("pnumSkinReading")=7
+17 SET PROMPTS("pnumImmReaction")=7
+18 SET PROMPTS("pnumDiagAdd2PL")=7
+19 SET PROMPTS("pnumSkinDTRead")=8
+20 SET PROMPTS("pnumImmContra")=8
+21 SET PROMPTS("pnumSkinDTGiven")=9
+22 SET PROMPTS("pnumImmRefused")=9
+23 SET PROMPTS("pnumCPTMods")=9
+24 SET PROMPTS("pnumComment")=10
+25 ;S PROMPTS("pnumOutSideLocation")=11
+26 SET PROMPTS("pnumSkinReader")=11
+27 SET PROMPTS("pnumSkinReaderIEN")=11
+28 SET PROMPTS("pnumWHPapResult")=11
+29 SET PROMPTS("pnumWHNotPurp")=12
+30 SET PROMPTS("pnumDataSource")=12
+31 SET PROMPTS("pnumSkinOrderBy")=12
+32 SET PROMPTS("pnumDate")=13
+33 SET PROMPTS("pnumImmDosage")=13
+34 SET PROMPTS("pnumSkinSite")=13
+35 SET PROMPTS("pnumImmOrderByIEN")=20
+36 SET PROMPTS("pnumRemGenFindID")=14
+37 SET PROMPTS("pnumImmRoute")=14
+38 SET PROMPTS("pnumSkinReadingComment")=14
+39 SET PROMPTS("pnumImmSite")=15
+40 SET PROMPTS("pnumImmLot")=16
+41 SET PROMPTS("pnumRemGenFindNewData")=16
+42 SET PROMPTS("pnumRemGenFindGroup")=17
+43 SET PROMPTS("pnumImmManufacturer")=17
+44 SET PROMPTS("pnumExpirationDate")=18
+45 SET PROMPTS("pnumImmRouteIEN")=18
+46 SET PROMPTS("pnumGFPrint")=18
+47 SET PROMPTS("pnumAdminDate")=19
+48 SET PROMPTS("pnumImmOrderByIEN")=20
+49 SET PROMPTS("pnumIMMVIS")=21
+50 SET PROMPTS("pnumImmOverride")=24
+51 ;S PROMPTS("pnumImmDocumType")=30
+52 ;S PROMPTS("pnumImmCPTCodes")=31
+53 SET PROMPTS("pnumOutSideLocation")=32
+54 ;S PROMPTS("pnumImmDXCodes")=33
+55 SET PROMPTS("pnumReadingIEN")=16
+56 SET PROMPTS("pnumRefusedGroup")=11
+57 SET PROMPTS("pnumAdminByPolicy")=31
+58 QUIT
+59 ;
BLDPARR(RESULT) ;
+1 SET RESULT("ADMIN ROUTE")="pnumImmRoute"
+2 SET RESULT("ADMIN SITE")="pnumImmSite"
+3 SET RESULT("ANATOMIC LOC")="pnumImmSite"
+4 SET RESULT("COMMENTS")="pnumComment"
+5 ;S RESULT("CODES CPT")="pnumImmCPTCodes"
+6 ;S RESULT("CODES DX")="pnumImmDXCodes"
+7 SET RESULT("CONTRAINDICATED")="pnumImmContra"
+8 SET RESULT("CONTRA/REFUSAL")="CONTRA"
+9 SET RESULT("REFUSAL")="pnumImmRefused"
+10 SET RESULT("CVX")=""
+11 SET RESULT("DATA SOURCE")=""
+12 SET RESULT("DATE RECORDED")=""
+13 SET RESULT("DOCUMENTER")=""
+14 SET RESULT("DOSE")="pnumImmDosage"
+15 SET RESULT("DOSE UNITS")=""
+16 SET RESULT("ENCOUNTER PROVIDER")="pnumProvider"
+17 SET RESULT("EVENT DATE AND TIME")="pnumAdminDate"
+18 SET RESULT("EXPIRATION DATE")="pnumExpirationDate"
+19 SET RESULT("FACILITY")=""
+20 SET RESULT("IMMUN")=4
+21 SET RESULT("IMMUNIZATION")=4
+22 SET RESULT("INFO SOURCE")="pnumDataSource"
+23 SET RESULT("LOCATION")="pnumOutSideLocation"
+24 SET RESULT("LOT NUMBER")="pnumImmLot"
+25 SET RESULT("MANUFACTURER")="pnumImmManufacturer"
+26 SET RESULT("ORDERING PROVIDER")="pnumImmOrderByIEN"
+27 SET RESULT("OVERRIDE REASON")="pnumImmOverride"
+28 SET RESULT("REACTION")="pnumImmReaction"
+29 SET RESULT("PLACEMENT IEN")="pnumReadingIEN"
+30 SET RESULT("READING")="pnumSkinReading"
+31 SET RESULT("RESULTS")="pnumSkinResults"
+32 SET RESULT("READING COMMENTS")="pnumComment"
+33 SET RESULT("SERIES")="pnumImmSeries"
+34 SET RESULT("SKIN TEST")=4
+35 SET RESULT("VACCINE GROUP",1,0)=""
+36 SET RESULT("VALUE")=""
+37 SET RESULT("VIS OFFERED")="pnumIMMVIS"
+38 SET RESULT("VISIT")=""
+39 SET RESULT("VISIT DATE TIME")="pnumAdminDate"
+40 SET RESULT("WARN UNTIL DATE")="pnumWarnDate"
+41 SET RESULT("WARNING ACK")=""
+42 SET RESULT("READER")="pnumSkinReader"
+43 SET RESULT("DATE READ")="pnumSkinDTRead"
+44 SET RESULT("CVXONLY")="pnumRefusedGroup"
+45 SET RESULT("ORDERED BY POLICY")="pnumAdminByPolicy"
+46 QUIT
+47 ;
GETLAYOT(RESULT,INPUTS,DEFAULTS) ;
+1 NEW DATAARR,DATATYPE,DEFLIST,NODE,X
+2 MERGE DATAARR=INPUTS("DATA")
+3 ;M EDITARR=INPUTS("EDIT DATA")
+4 SET DATATYPE=DATAARR("TYPE")
+5 IF $DATA(DEFAULTS)
DO BLDDEFLS(.DEFAULTS,.DEFLIST)
+6 IF DATATYPE="SKIN TEST"
DO GET^ORFSKT(.RESULT,.DATAARR,.DEFLIST)
QUIT
+7 IF DATATYPE="IMMUNIZATION"
DO GET^ORFIMM(.RESULT,.DATAARR,.DEFLIST)
QUIT
+8 ;I DATATYPE="ZZAGP" D GET^ZZAGPFEDT(.RESULT,.DATAARR,.DEFLIST) Q
+9 QUIT
+10 ;
BLDLAYOT(RESULT,INPUTS,TYPE,CONTROL) ;
+1 IF CONTROL="SKIN TEST"
DO BLDLAYOT^ORFSKT(.RESULT,.INPUTS,TYPE)
QUIT
+2 IF CONTROL="IMMUNIZATION"
DO BLDLAYOT^ORFIMM(.RESULT,.INPUTS,TYPE)
QUIT
+3 ;I CONTROL="ZZAGP" D BLDLAYOT^ZZAGPFEDT(.RESULT,.INPUTS,TYPE)
+4 QUIT
+5 ;
BLDDEFLS(DEFAULTS,DEFLIST) ;
+1 NEW CNT,LNAME,LNODE,MARRAY,MCNT,NODE
+2 SET LNAME=0
SET MCNT=0
+3 SET CNT=0
FOR
SET CNT=$ORDER(DEFAULTS(CNT))
if CNT'>0
QUIT
Begin DoDot:1
+4 SET NODE=DEFAULTS(CNT)
+5 IF LNAME=""
SET LNAME=$PIECE(NODE,U)
SET DEFLIST(LNAME)=$PIECE(NODE,U,2,$LENGTH(NODE,U))
QUIT
+6 IF LNAME=$PIECE(NODE,U)
SET MCNT=MCNT+1
SET MARRAY(LNAME,MCNT)=$PIECE(NODE,U,2,$LENGTH(NODE,U))
QUIT
+7 IF LNAME'=$PIECE(NODE,U)
SET LNAME=$PIECE(NODE,U)
SET DEFLIST($PIECE(NODE,U))=$PIECE(NODE,U,2,$LENGTH(NODE,U))
End DoDot:1
+8 IF '$DATA(MARRAY)
QUIT
+9 SET LNAME=""
FOR
SET LNAME=$ORDER(MARRAY(LNAME))
if LNAME=""
QUIT
Begin DoDot:1
+10 KILL DEFLIST(LNAME)
SET MCNT=0
+11 SET CNT=0
FOR
SET CNT=$ORDER(MARRAY(LNAME,CNT))
if CNT'>0
QUIT
Begin DoDot:2
+12 SET MCNT=MCNT+1
SET DEFLIST(LNAME,MCNT)=MARRAY(LNAME,CNT)
End DoDot:2
End DoDot:1
+13 QUIT
+14 ;
+15 ;
BLDRESLT(RESULTS,LIST,INPUTS) ;
+1 NEW CNT,DATETIME,ENCTYPE,LOC,X
+2 IF INPUTS("TYPE")="IMMUNIZATION"
DO BLD^ORFIMM1(.RESULTS,.LIST,.INPUTS)
GOTO BLDX
+3 IF INPUTS("TYPE")="SKIN TEST"
DO BLD^ORFSKT(.RESULTS,.LIST,.INPUTS)
GOTO BLDX
+4 ;I INPUTS("TYPE")="ZZAGP" D BLD^ZZAGPFEDT(.RESULTS,.LIST,.INPUTS)
BLDX ;
+1 ;
+2 SET CNT=""
+3 SET CNT=$ORDER(RESULTS(CNT),-1)
+4 SET X=0
FOR
SET X=$ORDER(LIST(X))
if X'>0
QUIT
Begin DoDot:1
+5 SET CNT=CNT+1
SET RESULTS(CNT)="LAYOUT"_U_LIST(X)
End DoDot:1
+6 QUIT
+7 ;
GETSERIES(RESULTS) ;
+1 NEW DATALST,IDX
+2 DO GETSET^ORWPCE2(.DATALST,9000010.11,.04,1)
+3 SET IDX=0
FOR
SET IDX=$ORDER(DATALST(IDX))
if IDX'>0
QUIT
Begin DoDot:1
+4 SET RESULTS("series",IDX,"internal")=$PIECE(DATALST(IDX),U)
+5 SET RESULTS("series",IDX,"external")=$PIECE(DATALST(IDX),U,2)
End DoDot:1
+6 QUIT
+7 ;