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

OREORV2.m

Go to the documentation of this file.
  1. OREORV2 ; SLC/GDU - Orderable Item Records Validation [10/15/04 09:16]
  1. ;;3.0;ORDER ENTRY/RESULTS REPORTING;**217**;Dec 17, 1997
  1. ;OREORV2 - Orderable Item Record Validation
  1. ;
  1. ;FIX FOR NOIS CASES:
  1. ;DAN-0204-42157, ALB-1001-51034, SBY-0803-30443, NJH-0402-20607
  1. ;
  1. ;This prints a report of the results from OREORV1.
  1. ;The results are stored in ^TMP($J,"OIC".
  1. ;^TMP($J,"OIC" is fully documented in OREORV1.
  1. ;The output is sorted and printed in the following manner:
  1. ;
  1. ;A report summary of the overall findings
  1. ;Section 1, details of OI records with null ID field
  1. ;Section 2, details of OI records without source IENs
  1. ;Section 3, details of OI records without source package codes
  1. ;Section 4, details of OI records with bad source package codes
  1. ;Section 5, details of OI records with packages with package
  1. ; codes not listed in the OE/RR Interface Specifications
  1. ; of July 2001. These records have properly formatted
  1. ; package codes but can not be validated with this
  1. ; utility.
  1. ;Section 6, summary of OI records validated with source records
  1. ;Section 7, details of OI records not validated with source records
  1. ;
  1. ;External Variables
  1. ; IOF - Standard FileMan/Kernel IO variable, Form Feed
  1. ; IOM - Standard FileMan/Kernel IO variable, Margin width
  1. ; IOSL - Standard FileMan/Kernel IO variable, Page Length
  1. ; IOST - Standard FileMan/Kernel IO variable, Terminal type
  1. ; U - Standard FileMan/Kernel delimiter variable
  1. ;
  1. ;External References
  1. ; ^DIR DBIA 10026
  1. ; $$REPEAT^XLFSTR DBIA 10104
  1. ;
  1. MAIN ;Main entry point for this program
  1. ;Local Variables
  1. ; PAGE - Page number counter
  1. ; STOP - Stop report execution
  1. ;
  1. N PAGE,STOP
  1. S PAGE=1,STOP=0
  1. D RPTSUM I STOP=1 G EXIT ;Report Summary
  1. D PS(1) I STOP=1 G EXIT
  1. D PS(2) I STOP=1 G EXIT
  1. D PS(3) I STOP=1 G EXIT
  1. D PS(4) I STOP=1 G EXIT
  1. D PS(5) I STOP=1 G EXIT
  1. D PS(6) I STOP=1 G EXIT
  1. D PS(7)
  1. EXIT ;Exit point for this program
  1. Q
  1. RPTSUM ;Report Summary - Summary of ZGOIRV1 findings
  1. ;Local Variables
  1. ; RSL - Report Summary Line, indirect variable to print summary type
  1. ; X - Standard FileMan work variable
  1. ;
  1. N RSL,X
  1. D RPH
  1. W !,$P($T(RS),";",3),!
  1. F X=0:1:7 D
  1. . S RSL="RS"_X
  1. . W !,$P($T(@RSL),";",3),?65,$J(^TMP($J,"OIC",X),10)
  1. D @$S($E(IOST,1,2)="C-":"NS",1:"RPF")
  1. Q
  1. PS(SN) ;Print Sections
  1. ;Variable Passed to PS
  1. ; SN - Section Number
  1. ;Local Variables
  1. ; SH - Section Header
  1. ; SF - Section Footer
  1. ; PACK - Package Code
  1. ; PH - Package Subsection Header
  1. ; PF - Package Subsection Footer
  1. ; NAME - Orderable Item Name
  1. ;
  1. N SH,SF,PACK,PH,PF,NAME
  1. S SH="SH"_SN,SF="SF"_SN
  1. W !,$P($T(@SH),";",3)
  1. W ! D LCC Q:STOP=1
  1. I SN=1!(SN=2)!(SN=3) D
  1. . I ^TMP($J,"OIC",SN)>0 D
  1. .. W !,$P($T(@SH),";",3) D LCC Q:STOP=1
  1. .. W !,$$REPEAT^XLFSTR("-",IOM) D LCC Q:STOP=1
  1. .. S NAME="" F S NAME=$O(^TMP($J,"OIC",SN,"B",NAME)) Q:NAME=""!(STOP=1) D
  1. ... W !,NAME,?65,$P(^TMP($J,"OIC",SN,"B",NAME),U,2)
  1. I SN=4!(SN=5) D
  1. . I ^TMP($J,"OIC",SN)>0 D
  1. .. S PACK="" F S PACK=$O(^TMP($J,"OIC",SN,PACK)) Q:PACK=""!(STOP=1) D
  1. ... S PH=$P($T(PHT),";",3)_" : "_PACK_" - "_$P($T(@$E(PACK,3,5)),";",3)
  1. ... S PF=$P($T(PFT),";",3)_" : "_PACK_" - "_$P($T(@$E(PACK,3,5)),";",3)
  1. ... W !,PH D LCC Q:STOP=1
  1. ... W !,$P($T(CH1),";",3),?65,$P($T(CH2),";",3) D LCC Q:STOP=1
  1. ... W !,$$REPEAT^XLFSTR("-",IOM) D LCC Q:STOP=1
  1. ... S NAME="" F S NAME=$O(^TMP($J,"OIC",SN,PACK,"B",NAME)) Q:NAME=""!(STOP=1) D
  1. .... W !,NAME,?65,$P(^TMP($J,"OIC",SN,PACK,"B",NAME),U,2) D LCC Q:STOP=1
  1. ... W !,PF,?65,$J(^TMP($J,"OIC",SN,PACK),10) D LCC Q:STOP=1
  1. ... W ! D LCC Q:STOP=1
  1. I SN=6 D
  1. . I ^TMP($J,"OIC",SN)>0 D
  1. . S PACK="" F S PACK=$O(^TMP($J,"OIC",SN,PACK)) Q:PACK=""!(STOP=1) D
  1. .. S PH=PACK_" - "_$P($T(@$E(PACK,3,5)),";",3)
  1. .. W !,PH,?65,$J(^TMP($J,"OIC",SN,PACK),10) D LCC Q:STOP=1
  1. I SN=7 D PS7
  1. W ! D LCC Q:STOP=1
  1. W !,$P($T(@SF),";",3),?65,$J(^TMP($J,"OIC",SN),10) D LCC Q:STOP=1
  1. I SN=7 S STOP=1
  1. D @$S($E(IOST,1,2)="C-":"NS",1:"RPF")
  1. Q
  1. PS7 ;Print Section 7
  1. ;Local Variables
  1. ; AH - Activity Type Subsection Header
  1. ; AF - Activity Type Subsection Footer
  1. ; AI - Active / Inactive Indicator
  1. ;
  1. N AH,AF,AI
  1. I ^TMP($J,"OIC",SN)=0 Q
  1. S AI="" F S AI=$O(^TMP($J,"OIC",SN,AI)) Q:AI=""!(STOP=1) D
  1. . S AH=AI_"HT",AF=AI_"FT"
  1. . W !,$P($T(@AH),";",3) D LCC Q:STOP=1
  1. . S PACK="" F S PACK=$O(^TMP($J,"OIC",SN,AI,PACK)) Q:PACK=""!(STOP=1) D
  1. .. S PH=$P($T(PHT),";",3)_" : "_PACK_" - "_$P($T(@$E(PACK,3,5)),";",3)
  1. .. S PF=PACK_" - "_$P($T(@$E(PACK,3,5)),";",3)
  1. .. W !,PH D LCC Q:STOP=1
  1. .. W !,$P($T(CH1),";",3),?65,$P($T(CH2),";",3) D LCC Q:STOP=1
  1. .. W !,$$REPEAT^XLFSTR("-",IOM) D LCC Q:STOP=1
  1. .. S NAME="" F S NAME=$O(^TMP($J,"OIC",SN,AI,PACK,"B",NAME)) Q:NAME=""!(STOP=1) D
  1. ... W !,NAME,?65,$P(^TMP($J,"OIC",SN,AI,PACK,"B",NAME),U,2) D LCC Q:STOP=1
  1. .. W !,PF,?65,$J(^TMP($J,"OIC",SN,AI,PACK),10) D LCC Q:STOP=1
  1. .. W ! D LCC Q:STOP=1
  1. . W ! D LCC Q:STOP=1
  1. . W !,$P($T(@AF),";",3),?65,$J(^TMP($J,"OIC",SN,AI),10) D LCC Q:STOP=1
  1. Q
  1. RPH ;Report Page Header
  1. W:$E(IOST,1,2)="C-"!(PAGE>1) @IOF
  1. W $P($T(RH),";",3),?65,"PAGE: ",PAGE
  1. Q
  1. NS ;Next Screen - Advances user to next screen if output directed to
  1. ;video console
  1. ;Local Variables
  1. ; DIR - Input array variable for ^DIR
  1. ; DTOUT - Time out indicator, output variable for ^DIR
  1. ; DUOUT - Up arrow out indicator, "^", output variable for ^DIR
  1. ; Y - Processed User response, output variable for ^DIR
  1. ;
  1. N DIR,DTOUT,DUOUT,Y
  1. S DIR(0)="E"
  1. W ! D ^DIR I $D(DTOUT)!($D(DUOUT)) S Y=0
  1. I Y=0 S STOP=1 Q
  1. S PAGE=$$PCI(PAGE)
  1. D:STOP=0 RPH
  1. Q
  1. RPF ;Report Page Footer - Prints page footer if output directed to printer
  1. ;Local Variables
  1. ; LF - Line Feed, Advances 1 line down the page
  1. ; LFC - Line Feed Count, number of lines to advance to end of page
  1. N LF,LFC
  1. S LFC=(IOSL-4)-$Y
  1. F LF=1:1:LFC W !
  1. W $P($T(RF),";",3),?65,"PAGE: ",PAGE
  1. S PAGE=$$PCI(PAGE)
  1. D:STOP=0 RPH
  1. Q
  1. LCC ;Line Count Check - Determine if it is time for end of page/screen logic
  1. I $Y>(IOSL-4) D @$S($E(IOST,1,2)="C-":"NS",1:"RPF") I STOP=1 G EXIT
  1. Q
  1. PCI(PN) ;Page Counter
  1. ;Variable Passed to PCI
  1. ; PN - Page Number
  1. S PN=PN+1 Q PN
  1. ;Text used by the program to print the report
  1. ;Text for the report page/screen headers
  1. RH ;;Orderable Items File Record Validation Report
  1. ;Text for the report page footers
  1. RF ;;Orderable Items File Record Validation Report
  1. ;Text for report summary
  1. RS ;;Summary of Orderable Items Validation:
  1. RS0 ;;Total number of records processed:
  1. RS1 ;;Total number of records with null ID fields:
  1. RS2 ;;Total number of records without source IENs:
  1. RS3 ;;Total number of records without source package codes:
  1. RS4 ;;Total number of records with bad source package codes:
  1. RS5 ;;Total number of records requiring manual confirmation:
  1. RS6 ;;Total number of records with source record matches (validated):
  1. RS7 ;;Total number of records without source record matches:
  1. ;
  1. ;Section header/footer text
  1. SH1 ;;Section 1, Records with null ID field
  1. SH2 ;;Section 2, Records without source IENs
  1. SH3 ;;Section 3, Records without source package codes
  1. SH4 ;;Section 4, Records with incorrect source package code formats
  1. SH5 ;;Section 5, Records with package codes not in current spec
  1. SH6 ;;Section 6, Records with source record matches (Validated)
  1. SH7 ;;section 7, Records without source record matches
  1. SF1 ;;Total with null ID field
  1. SF2 ;;Total without source IENs:
  1. SF3 ;;Total without source package codes:
  1. SF4 ;;Total with bad source package codes:
  1. SF5 ;;Total with package codes not in spec:
  1. SF6 ;;Total validated:
  1. SF7 ;;Total without source record matches:
  1. ;
  1. ;Package title text
  1. CON ;;Consult Request Services file
  1. FHD ;;Diets file
  1. FHT ;;Tubefeeding file
  1. LRT ;;Laboratory Test file
  1. ORD ;;Orderable Items file
  1. PRC ;;Consult Procedure file
  1. PRO ;;Protocol file
  1. PSP ;;Pharmacy Orderable Item file
  1. RAP ;;Radiology/Nuclear Medicine Procedures file
  1. ;
  1. ;Column Header text
  1. CH1 ;;OI Name
  1. CH2 ;;Inactive Date
  1. ;
  1. ;Package Header/Footer Text
  1. PHT ;;Records for package
  1. PFT ;;Sub-total for package
  1. ;
  1. ;Active OI records Header/Footer Text
  1. AHT ;;Active OI records w/o matching source record
  1. AFT ;;Sub-total active OI records w/o matching source record
  1. ;
  1. ;Inactive OI records Header/Footer Text
  1. IHT ;;Inactive OI records w/o matching source record
  1. IFT ;;Sub-total inactive OI records w/o matching source record