Ignore:
Timestamp:
May 5, 2011, 2:24:58 AM (14 years ago)
Author:
Sam Habiel
Message:

Documenation and error handling for new radiology sections of BSDX01.m

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Scheduling/branches/Radiology-Support/m/BSDX01.m

    r1141 r1167  
    1 BSDX01  ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 4/10/11 4:50pm
     1BSDX01  ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 5/5/11 8:59am
    22        ;;1.5V3;BSDX;;Mar 16, 2011
    33        ;
     
    318318           I $$INDIV2(27)'=1 W "ERROR",!
    319319           QUIT
    320 GETRADEX(BSDXY,DFN,SCIEN)
     320           ;
     321GETRADEX(BSDXY,DFN,SCIEN) ; Get All Pending and On Hold Radiology Exams for Patient; RPC EP; UJO/SMH new in v 1.6
     322 ; RPC: BSDX GET RAD EXAM FOR PT; Return: Global Array
     323 ;
     324 ; Input: DFN - you should know; SCIEN - IEN of Hospital Location
     325 ; Output: ADO Datatable with the following columns:
     326 ; - BMXIEN: Radiology Exam IEN in file 75.1 (RAD/NUC MED ORDERS)
     327 ; - STATUS: Pending Or Hold Status
     328 ; - PROCEDURE: Text Procedure Name
     329 ; - REQUEST_DATE: Date Procedure was requested
     330 ;
     331 ; Error Processing: Silent failure.
     332 ;
    321333 S BSDXY=$NA(^BMXTEMP($J))
    322334 K @BSDXY
    323  N BSDXRLIEN S BSDXRLIEN=$ORDER(^RA(79.1,"B",SCIEN,""))  ; IEN of HL in file 79.1, to get Radiology Imaging IEN
    324  I 'BSDXRLIEN QUIT  ; This will crash the client. Intentionally!!!!
     335 ;
    325336 N BSDXI S BSDXI=0
    326337 S @BSDXY@(BSDXI)="I00015BMXIEN^T00015STATUS^T00100PROCEDURE^D00030REQUEST_DATE"_$C(30)
     338 ;
     339 N BSDXRLIEN S BSDXRLIEN=$ORDER(^RA(79.1,"B",SCIEN,""))  ; IEN of HL in file 79.1, to get Radiology Imaging IEN
     340 I 'BSDXRLIEN GOTO END
     341 ;
    327342 N BSDXOUT,BSDXERR ; Out, Error
     343 ;
     344 ; File 75.1 = RAD/NUC MED ORDERS
     345 ; Fields 5 = Request Status; 2 = Procedure; 16 = Requested Entered Date Time
     346 ; Filter Field: First piece is DFN, 5th piece is 3 or 5 (Status of Pending Or Hold); 20th piece is Radiology Location requested
    328347 D LIST^DIC(75.1,"","@;5;2;16","P","","","","B","I $P(^(0),U)=DFN&(35[$P(^(0),U,5))&($P(^(0),U,20)=BSDXRLIEN)","","BSDXOUT","BSDXERR")
    329  ;TODO: do something about BSDXERR
    330  I +BSDXOUT("DILIST",0)>0 FOR BSDXI=1:1:+BSDXOUT("DILIST",0) DO
     348 ;
     349 IF $DATA(BSDXERR) GOTO END
     350 ;
     351 I +BSDXOUT("DILIST",0)>0 FOR BSDXI=1:1:+BSDXOUT("DILIST",0) DO  ; if we have data, fetch the data in each row and store it in the return variable
    331352 . N BMXIEN,BMXSTAUS,BMXPROC,BMXDATE ; Proc IEN, Proc Status, Proc Name
    332  . S BMXIEN=$P(BSDXOUT("DILIST",BSDXI,0),U)
    333  . S BMXSTATUS=$P(BSDXOUT("DILIST",BSDXI,0),U,2)
    334  . S BMXPROC=$P(BSDXOUT("DILIST",BSDXI,0),U,3)
    335  . S BMXDATE=$TR($P(BSDXOUT("DILIST",BSDXI,0),U,4),"@"," ")
     353 . S BMXIEN=$P(BSDXOUT("DILIST",BSDXI,0),U) ; IEN
     354 . S BMXSTATUS=$P(BSDXOUT("DILIST",BSDXI,0),U,2) ; Status
     355 . S BMXPROC=$P(BSDXOUT("DILIST",BSDXI,0),U,3) ; Procedure Name
     356 . S BMXDATE=$TR($P(BSDXOUT("DILIST",BSDXI,0),U,4),"@"," ") ; Request Entered Date Time
    336357 . S @BSDXY@(BSDXI)=BMXIEN_U_BMXSTATUS_U_BMXPROC_U_BMXDATE_$C(30)
     358END ; Errors Jump Here...
    337359 S @BSDXY@(BSDXI+1)=$C(31)
    338360 QUIT
    339361 ;
    340 SCHRAEX(BSDXY,RADFN,RAOIFN) ; Schedule a Radiology Exam
     362SCHRAEX(BSDXY,RADFN,RAOIFN,RAOSCH) ; Schedule a Radiology Exam; RPC EP; UJO/SMH new in v 1.6
     363 ; RPC: BSDX SCHEDULE RAD EXAM; Return: Single Value
     364 ;
     365 ; Input:
     366 ; - RADFN -> DFN
     367 ; - RAOIFN -> Radiology Order IEN in file 75.1
     368 ; - RAOSCH -> Scheduled Time for Exam
     369 ; Output: Always "1"
     370 ;
     371 S RAOSCH=+RAOSCH ; Strip the trailing zeros from the Fileman Date produced by C#
    341372 N RAOSTS S RAOSTS=8  ; Status of Scheduled
    342  D ^RAORDU  ; API in Rad expects RADFN, RAOIFN, and RAOSTS
     373 D ^RAORDU  ; API in Rad expects RADFN, RAOIFN, RAOSCH, and RAOSTS
    343374 S BSDXY=1 ; Success
    344375 QUIT
    345 HOLDRAEX(BSDXY,RADFN,RAOIFN) ; Hold a Radiology Exam
     376 ;
     377HOLDRAEX(BSDXY,RADFN,RAOIFN) ; Hold a Radiology Exam; RPC EP; UJO/SMH new in v 1.6
     378 ; RPC: BSDX HOLD RAD EXAM; Return: Single Vale
     379 ;
     380 ; Input:
     381 ; - RADFN -> DFN
     382 ; - RAOIFN -> Radiology Order IEN in file 75.1
     383 ; Output: Always "1"
    346384 N RAOSTS S RAOSTS=3  ; Status of Hold
    347385 N RAOREA S RAOREA=20 ; Reason: Exam Cancelled
Note: See TracChangeset for help on using the changeset viewer.