RORHL20 ;BPOIFO/ACS - HL7 NON-VA MEDS: ORC,RXE ;8/23/10
;;1.5;CLINICAL CASE REGISTRIES;**13**;Feb 17, 2006;Build 27
;
; This routine uses the following IAs:
;
; #330 ^PSOHCSUM (controlled)
; #10104 TRIM^XLFSTR (supported)
;
Q
;
;***** SEARCH FOR NON-VA MEDS
;
; DFN DFN of the patient in the PATIENT file (#2)
;.DXDTS Reference to a local variable where the
; data extraction time frames are stored.
;
; Return Values:
; 0 Ok
;
EN1(RORDFN,DXDTS) ;DATA AREA = 19
N IDX,RORSTDT,RORENDT
S IDX=0
F S IDX=$O(DXDTS(19,IDX)) Q:IDX'>0 D
. S RORSTDT=$P(DXDTS(19,IDX),U),RORENDT=$P(DXDTS(19,IDX),U,2)
. D EN2(RORDFN,RORSTDT,RORENDT) ;get Non-VA meds for patient
Q 0
;
;***** GET NON-VA MEDS
;Input
; RORDFN DFN of the patient in the PATIENT file (#2)
; RORSTDT Start date of extract
; RORENDT End date of extract
;
; Return Values:
; 0 Ok
;
EN2(RORDFN,RORSTDT,RORENDT) ;
N CS D ECH^RORHL7(.CS) ;component separator
N SCS D ECH^RORHL7(,.SCS) ;sub-component separator
N DFN S DFN=$G(RORDFN) ;must be set for call to ^PSOHCSUM
;^PSOHCSUM will return all Non-VA meds, regardless of what date is passed in.
;To minimize the number of other meds returned, set start = current date
N PSOBEGIN S PSOBEGIN=DT D ^PSOHCSUM
N COUNT,RORNVA,RORKEEP,I,DATA10,DATA0,RORTEXT
S COUNT=0 F S COUNT=$O(^TMP("PSOO",$J,"NVA",COUNT)) Q:'COUNT D
. K RORNVA
. S RORNVA("DOCDT")=$P($G(^TMP("PSOO",$J,"NVA",COUNT,0)),U,5) ;documented date
. S RORNVA("DISDT")=$P($G(^TMP("PSOO",$J,"NVA",COUNT,0)),U,7) ;discontinued date
. S RORKEEP=0
. ;Documented date or discontinued date must be in the extract range
. I $G(RORNVA("DOCDT")),RORNVA("DOCDT")\1'<RORSTDT\1,RORNVA("DOCDT")'>RORENDT\1 S RORKEEP=1
. I $G(RORNVA("DISDT")),RORNVA("DISDT")\1'<RORSTDT\1,RORNVA("DISDT")'>RORENDT\1 S RORKEEP=1
. I 'RORKEEP Q ;quit if not in range
. ;Populate RORNVA with data
. S RORNVA("ORDNUM")=$P($G(^TMP("PSOO",$J,"NVA",COUNT,0)),U,4) ;CPRS order#
. S RORNVA("IEN522")=COUNT ;Non-VA med IEN in sub-file 52.2
. S DATA10=$G(^TMP("PSOO",$J,"NVA",COUNT,1,0)) ;1,0 node
. S DATA0=$G(^TMP("PSOO",$J,"NVA",COUNT,0)) ;0 node
. S RORNVA("DOSE")=$P($G(DATA10),U,1) ;dosage
. S RORNVA("MEDROUTE")=$P($G(DATA10),U,2) ;med route
. S RORNVA("SCHED")=$P($G(DATA10),U,3) ;schedule
. S RORNVA("DRUGINFO")=$P($G(DATA10),U,4) ;drug IEN;name
. S RORNVA("DRUGIEN")=$P($G(RORNVA("DRUGINFO")),";",1) ;drug IEN
. S RORNVA("DRUGNAME")=$P($G(RORNVA("DRUGINFO")),";",2) ;drug name
. S RORNVA("CLINICINFO")=$P($G(DATA10),U,5) ;clinic IEN;name
. S RORNVA("CLIEN")=$P($G(RORNVA("CLINICINFO")),";",1) ;clinic IEN
. S RORNVA("CLNAME")=$P($G(RORNVA("CLINICINFO")),";",2) ;clinic name
. S RORNVA("OIDF")=$P($G(DATA0),U,1) ;orderable item + dose form
. S RORNVA("STATUS")=$P($G(DATA0),U,2) ;status
. S RORNVA("STATUS")=$$UPCASE($G(RORNVA("STATUS")))
. S RORNVA("START")=$P($G(DATA0),U,3) ;start date
. S RORNVA("DOCBY")=$P($G(DATA0),U,6) ;doc by IEN;name
. S RORNVA("DBIEN")=$P($G(RORNVA("DOCBY")),";",1) ;doc by IEN
. S RORNVA("DBNAME")=$P($G(RORNVA("DOCBY")),";",2) ;doc by name
. S RORNVA("STOPCD")=$$STOPCODE^RORUTL18($G(RORNVA("CLIEN"))) ;clinic stop
. K RORNVA("DISCL") S I=0 F S I=$O(^TMP("PSOO",$J,"NVA",COUNT,"DSC",I)) Q:'I D
. . S RORTEXT=$G(^TMP("PSOO",$J,"NVA",COUNT,"DSC",I,0))
. . I $L($G(RORNVA("DISCL")))>0 S RORNVA("DISCL")=RORNVA("DISCL")_" "_$$TRIM^XLFSTR($G(RORTEXT))
. . I $L($G(RORNVA("DISCL")))'>0 S RORNVA("DISCL")=$$TRIM^XLFSTR($G(RORTEXT))
. D ORC(CS,SCS,.RORNVA)
. D RXE(CS,SCS,.RORNVA)
K RORNVA,^TMP("PSOO",$J)
Q 0
;
;***** NON-VA MEDS ORC SEGMENT BUILDER
;
;Input
; CS Component separator
; SCS Sub-component separator
; RORNVA Array containing Non-VA medication information:
; RORNVA("IEN522") Non-VA med IEN in sub-file 52.2
; RORNVA("ORDNUM") CPRS Order Number
; RORNVA("DOCDT") Documented Date
; RORNVA("DISDT") Discontinued Date
; RORNVA("DOSE") Dosage
; RORNVA("MEDROUTE") Medication Route
; RORNVA("SCHED") Schedule
; RORNVA("DRUGIEN") Drug IEN
; RORNVA("DRUGNAME") Drug name
; RORNVA("STOPCD") Clinic Stop Code
; RORNVA("CLIEN") Clinic IEN
; RORNVA("CLNAME") Clinic Name
; RORNVA("OIDF") Orderable Item + Dose Form
; RORNVA("STATUS") Status
; RORNVA("START") Start Date
; RORNVA("DBIEN") Documented by IEN
; RORNVA("DBNAME") Documented by Name
; RORNVA("DISCL") Disclaimer text
;
ORC(CS,SCS,RORNVA) ;
;--- Initialize the segment
N RORSEG S RORSEG(0)="ORC"
;
;--- ORC-1 - Order Control
S RORSEG(1)="NW"
;
;--- ORC-2 - Placer Order #
S RORSEG(2)=$G(RORNVA("IEN522"))_CS_"NVA"
;
;--- ORC-5 - Order Status: IP for active, DC for discontinued
S RORSEG(5)=$S($G(RORNVA("STATUS"))="ACTIVE":"IP",$G(RORNVA("STATUS"))="DISCONTINUED":"DC",1:"")
;
;--- ORC-9 - Date/Time of Transaction: Documented Date/Time
I $G(RORNVA("DOCDT")) S RORSEG(9)=$$FM2HL^RORHL7(RORNVA("DOCDT"))
;
;--- ORC-12 - Documented By IEN ^^^^^^^^^^^^ Provider Class
S RORSEG(12)=$G(RORNVA("DBIEN"))
I $G(RORSEG(12))>0 D
. S $P(RORSEG(12),CS,13)=$$GET1^DIQ(200,+RORSEG(12)_",",53.5,"E",,"RORMSG")
;
;--- ORC-16 - Control Code Reason
S RORSEG(16)=CS_CS_CS_CS_"NEW"
;
;--- ORC-17 - Enterer's Organization: Division= Station Number ^ Station Name ^ 99VA4
S RORSEG(17)=$$SITE^RORUTL03(CS)
;
;--- Store the segment
D ADDSEG^RORHL7(.RORSEG)
Q
;
;***** NON-VA MEDS RXE SEGMENT BUILDER
;
;Input
; CS component separator
; SCS sub-component separator
; RORNVA Array containing Non-VA medication information:
; RORNVA("IEN522") Non-VA med IEN in sub-file 52.2
; RORNVA("ORDNUM") CPRS Order Number
; RORNVA("DOCDT") Documented Date
; RORNVA("DISDT") Discontinued Date
; RORNVA("DOSE") Dosage
; RORNVA("MEDROUTE") Medication Route
; RORNVA("SCHED") Schedule
; RORNVA("DRUGIEN") Drug IEN
; RORNVA("DRUGNAME") Drug name
; RORNVA("STOPCD") Clinic Stop Code
; RORNVA("CLIEN") Clinic IEN
; RORNVA("CLNAME") Clinic Name
; RORNVA("OIDF") Orderable Item + Dose Form
; RORNVA("STATUS") Status
; RORNVA("START") Start Date
; RORNVA("DBIEN") Documented by IEN
; RORNVA("DBNAME") Documented by Name
; RORNVA("DISCL") Disclaimer text
;
RXE(CS,SCS,RORNVA) ;
;--- Initialize the segment
N RORSEG S RORSEG(0)="RXE"
;
;--- RXE-1 - Quantity/Timing: Dosage ^ Schedule ^^ Start Date ^ Discontinue Date ^^^ Medication Route
N START I $G(RORNVA("START")) S START=$$FM2HL^RORHL7(RORNVA("START"))
N END I $G(RORNVA("DISDT")) S END=$$FM2HL^RORHL7(RORNVA("DISDT"))
S RORSEG(1)=$G(RORNVA("DOSE"))_CS_$G(RORNVA("SCHED"))_CS_CS_$G(START)_CS_$G(END)_CS_CS_CS_$G(RORNVA("MEDROUTE"))
;
;--- RXE-2 - Give Code: NDC code^VA Product Name^PSNDF^ NDF IEN + VA drug class code^Generic name^99PSD
; or: ^^^^ orderable item + dose form
N DRUGIEN,DRUGINFO,INDF,TMP S DRUGIEN=$G(RORNVA("DRUGIEN"))
I $G(DRUGIEN) S DRUGINFO="",TMP=$$RXE2^RORHL031(DRUGIEN,CS,.DRUGINFO,.INDF)
I '$G(DRUGIEN) S $P(DRUGINFO,CS,5)=$G(RORNVA("OIDF"))
S RORSEG(2)=$G(DRUGINFO)
;
;--- RXE-7 - Provider's Administration Instructions: Disclaimer text
I $L($G(RORNVA("DISCL")))>0 S RORSEG(7)=CS_$$TRIM^XLFSTR($G(RORNVA("DISCL")))
I $L($G(RORSEG(7)))>4001 S RORSEG(7)=$E(RORSEG(7),1,4001) ;CS + 4000 characters
;
;--- RXE-15 - Prescription Number: CPRS Order Number
S RORSEG(15)=$G(RORNVA("ORDNUM"))
;
;--- RXE-21 - Stop Code
S RORSEG(21)=$G(RORNVA("STOPCD"))
;
;--- Store the segment
D ADDSEG^RORHL7(.RORSEG)
Q
;
UPCASE(DATA) ;
Q $TR(DATA,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRORHL20 8025 printed Sep 15, 2024@21:06:20 Page 2
RORHL20 ;BPOIFO/ACS - HL7 NON-VA MEDS: ORC,RXE ;8/23/10
+1 ;;1.5;CLINICAL CASE REGISTRIES;**13**;Feb 17, 2006;Build 27
+2 ;
+3 ; This routine uses the following IAs:
+4 ;
+5 ; #330 ^PSOHCSUM (controlled)
+6 ; #10104 TRIM^XLFSTR (supported)
+7 ;
+8 QUIT
+9 ;
+10 ;***** SEARCH FOR NON-VA MEDS
+11 ;
+12 ; DFN DFN of the patient in the PATIENT file (#2)
+13 ;.DXDTS Reference to a local variable where the
+14 ; data extraction time frames are stored.
+15 ;
+16 ; Return Values:
+17 ; 0 Ok
+18 ;
EN1(RORDFN,DXDTS) ;DATA AREA = 19
+1 NEW IDX,RORSTDT,RORENDT
+2 SET IDX=0
+3 FOR
SET IDX=$ORDER(DXDTS(19,IDX))
if IDX'>0
QUIT
Begin DoDot:1
+4 SET RORSTDT=$PIECE(DXDTS(19,IDX),U)
SET RORENDT=$PIECE(DXDTS(19,IDX),U,2)
+5 ;get Non-VA meds for patient
DO EN2(RORDFN,RORSTDT,RORENDT)
End DoDot:1
+6 QUIT 0
+7 ;
+8 ;***** GET NON-VA MEDS
+9 ;Input
+10 ; RORDFN DFN of the patient in the PATIENT file (#2)
+11 ; RORSTDT Start date of extract
+12 ; RORENDT End date of extract
+13 ;
+14 ; Return Values:
+15 ; 0 Ok
+16 ;
EN2(RORDFN,RORSTDT,RORENDT) ;
+1 ;component separator
NEW CS
DO ECH^RORHL7(.CS)
+2 ;sub-component separator
NEW SCS
DO ECH^RORHL7(,.SCS)
+3 ;must be set for call to ^PSOHCSUM
NEW DFN
SET DFN=$GET(RORDFN)
+4 ;^PSOHCSUM will return all Non-VA meds, regardless of what date is passed in.
+5 ;To minimize the number of other meds returned, set start = current date
+6 NEW PSOBEGIN
SET PSOBEGIN=DT
DO ^PSOHCSUM
+7 NEW COUNT,RORNVA,RORKEEP,I,DATA10,DATA0,RORTEXT
+8 SET COUNT=0
FOR
SET COUNT=$ORDER(^TMP("PSOO",$JOB,"NVA",COUNT))
if 'COUNT
QUIT
Begin DoDot:1
+9 KILL RORNVA
+10 ;documented date
SET RORNVA("DOCDT")=$PIECE($GET(^TMP("PSOO",$JOB,"NVA",COUNT,0)),U,5)
+11 ;discontinued date
SET RORNVA("DISDT")=$PIECE($GET(^TMP("PSOO",$JOB,"NVA",COUNT,0)),U,7)
+12 SET RORKEEP=0
+13 ;Documented date or discontinued date must be in the extract range
+14 IF $GET(RORNVA("DOCDT"))
IF RORNVA("DOCDT")\1'<RORSTDT\1
IF RORNVA("DOCDT")'>RORENDT\1
SET RORKEEP=1
+15 IF $GET(RORNVA("DISDT"))
IF RORNVA("DISDT")\1'<RORSTDT\1
IF RORNVA("DISDT")'>RORENDT\1
SET RORKEEP=1
+16 ;quit if not in range
IF 'RORKEEP
QUIT
+17 ;Populate RORNVA with data
+18 ;CPRS order#
SET RORNVA("ORDNUM")=$PIECE($GET(^TMP("PSOO",$JOB,"NVA",COUNT,0)),U,4)
+19 ;Non-VA med IEN in sub-file 52.2
SET RORNVA("IEN522")=COUNT
+20 ;1,0 node
SET DATA10=$GET(^TMP("PSOO",$JOB,"NVA",COUNT,1,0))
+21 ;0 node
SET DATA0=$GET(^TMP("PSOO",$JOB,"NVA",COUNT,0))
+22 ;dosage
SET RORNVA("DOSE")=$PIECE($GET(DATA10),U,1)
+23 ;med route
SET RORNVA("MEDROUTE")=$PIECE($GET(DATA10),U,2)
+24 ;schedule
SET RORNVA("SCHED")=$PIECE($GET(DATA10),U,3)
+25 ;drug IEN;name
SET RORNVA("DRUGINFO")=$PIECE($GET(DATA10),U,4)
+26 ;drug IEN
SET RORNVA("DRUGIEN")=$PIECE($GET(RORNVA("DRUGINFO")),";",1)
+27 ;drug name
SET RORNVA("DRUGNAME")=$PIECE($GET(RORNVA("DRUGINFO")),";",2)
+28 ;clinic IEN;name
SET RORNVA("CLINICINFO")=$PIECE($GET(DATA10),U,5)
+29 ;clinic IEN
SET RORNVA("CLIEN")=$PIECE($GET(RORNVA("CLINICINFO")),";",1)
+30 ;clinic name
SET RORNVA("CLNAME")=$PIECE($GET(RORNVA("CLINICINFO")),";",2)
+31 ;orderable item + dose form
SET RORNVA("OIDF")=$PIECE($GET(DATA0),U,1)
+32 ;status
SET RORNVA("STATUS")=$PIECE($GET(DATA0),U,2)
+33 SET RORNVA("STATUS")=$$UPCASE($GET(RORNVA("STATUS")))
+34 ;start date
SET RORNVA("START")=$PIECE($GET(DATA0),U,3)
+35 ;doc by IEN;name
SET RORNVA("DOCBY")=$PIECE($GET(DATA0),U,6)
+36 ;doc by IEN
SET RORNVA("DBIEN")=$PIECE($GET(RORNVA("DOCBY")),";",1)
+37 ;doc by name
SET RORNVA("DBNAME")=$PIECE($GET(RORNVA("DOCBY")),";",2)
+38 ;clinic stop
SET RORNVA("STOPCD")=$$STOPCODE^RORUTL18($GET(RORNVA("CLIEN")))
+39 KILL RORNVA("DISCL")
SET I=0
FOR
SET I=$ORDER(^TMP("PSOO",$JOB,"NVA",COUNT,"DSC",I))
if 'I
QUIT
Begin DoDot:2
+40 SET RORTEXT=$GET(^TMP("PSOO",$JOB,"NVA",COUNT,"DSC",I,0))
+41 IF $LENGTH($GET(RORNVA("DISCL")))>0
SET RORNVA("DISCL")=RORNVA("DISCL")_" "_$$TRIM^XLFSTR($GET(RORTEXT))
+42 IF $LENGTH($GET(RORNVA("DISCL")))'>0
SET RORNVA("DISCL")=$$TRIM^XLFSTR($GET(RORTEXT))
End DoDot:2
+43 DO ORC(CS,SCS,.RORNVA)
+44 DO RXE(CS,SCS,.RORNVA)
End DoDot:1
+45 KILL RORNVA,^TMP("PSOO",$JOB)
+46 QUIT 0
+47 ;
+48 ;***** NON-VA MEDS ORC SEGMENT BUILDER
+49 ;
+50 ;Input
+51 ; CS Component separator
+52 ; SCS Sub-component separator
+53 ; RORNVA Array containing Non-VA medication information:
+54 ; RORNVA("IEN522") Non-VA med IEN in sub-file 52.2
+55 ; RORNVA("ORDNUM") CPRS Order Number
+56 ; RORNVA("DOCDT") Documented Date
+57 ; RORNVA("DISDT") Discontinued Date
+58 ; RORNVA("DOSE") Dosage
+59 ; RORNVA("MEDROUTE") Medication Route
+60 ; RORNVA("SCHED") Schedule
+61 ; RORNVA("DRUGIEN") Drug IEN
+62 ; RORNVA("DRUGNAME") Drug name
+63 ; RORNVA("STOPCD") Clinic Stop Code
+64 ; RORNVA("CLIEN") Clinic IEN
+65 ; RORNVA("CLNAME") Clinic Name
+66 ; RORNVA("OIDF") Orderable Item + Dose Form
+67 ; RORNVA("STATUS") Status
+68 ; RORNVA("START") Start Date
+69 ; RORNVA("DBIEN") Documented by IEN
+70 ; RORNVA("DBNAME") Documented by Name
+71 ; RORNVA("DISCL") Disclaimer text
+72 ;
ORC(CS,SCS,RORNVA) ;
+1 ;--- Initialize the segment
+2 NEW RORSEG
SET RORSEG(0)="ORC"
+3 ;
+4 ;--- ORC-1 - Order Control
+5 SET RORSEG(1)="NW"
+6 ;
+7 ;--- ORC-2 - Placer Order #
+8 SET RORSEG(2)=$GET(RORNVA("IEN522"))_CS_"NVA"
+9 ;
+10 ;--- ORC-5 - Order Status: IP for active, DC for discontinued
+11 SET RORSEG(5)=$SELECT($GET(RORNVA("STATUS"))="ACTIVE":"IP",$GET(RORNVA("STATUS"))="DISCONTINUED":"DC",1:"")
+12 ;
+13 ;--- ORC-9 - Date/Time of Transaction: Documented Date/Time
+14 IF $GET(RORNVA("DOCDT"))
SET RORSEG(9)=$$FM2HL^RORHL7(RORNVA("DOCDT"))
+15 ;
+16 ;--- ORC-12 - Documented By IEN ^^^^^^^^^^^^ Provider Class
+17 SET RORSEG(12)=$GET(RORNVA("DBIEN"))
+18 IF $GET(RORSEG(12))>0
Begin DoDot:1
+19 SET $PIECE(RORSEG(12),CS,13)=$$GET1^DIQ(200,+RORSEG(12)_",",53.5,"E",,"RORMSG")
End DoDot:1
+20 ;
+21 ;--- ORC-16 - Control Code Reason
+22 SET RORSEG(16)=CS_CS_CS_CS_"NEW"
+23 ;
+24 ;--- ORC-17 - Enterer's Organization: Division= Station Number ^ Station Name ^ 99VA4
+25 SET RORSEG(17)=$$SITE^RORUTL03(CS)
+26 ;
+27 ;--- Store the segment
+28 DO ADDSEG^RORHL7(.RORSEG)
+29 QUIT
+30 ;
+31 ;***** NON-VA MEDS RXE SEGMENT BUILDER
+32 ;
+33 ;Input
+34 ; CS component separator
+35 ; SCS sub-component separator
+36 ; RORNVA Array containing Non-VA medication information:
+37 ; RORNVA("IEN522") Non-VA med IEN in sub-file 52.2
+38 ; RORNVA("ORDNUM") CPRS Order Number
+39 ; RORNVA("DOCDT") Documented Date
+40 ; RORNVA("DISDT") Discontinued Date
+41 ; RORNVA("DOSE") Dosage
+42 ; RORNVA("MEDROUTE") Medication Route
+43 ; RORNVA("SCHED") Schedule
+44 ; RORNVA("DRUGIEN") Drug IEN
+45 ; RORNVA("DRUGNAME") Drug name
+46 ; RORNVA("STOPCD") Clinic Stop Code
+47 ; RORNVA("CLIEN") Clinic IEN
+48 ; RORNVA("CLNAME") Clinic Name
+49 ; RORNVA("OIDF") Orderable Item + Dose Form
+50 ; RORNVA("STATUS") Status
+51 ; RORNVA("START") Start Date
+52 ; RORNVA("DBIEN") Documented by IEN
+53 ; RORNVA("DBNAME") Documented by Name
+54 ; RORNVA("DISCL") Disclaimer text
+55 ;
RXE(CS,SCS,RORNVA) ;
+1 ;--- Initialize the segment
+2 NEW RORSEG
SET RORSEG(0)="RXE"
+3 ;
+4 ;--- RXE-1 - Quantity/Timing: Dosage ^ Schedule ^^ Start Date ^ Discontinue Date ^^^ Medication Route
+5 NEW START
IF $GET(RORNVA("START"))
SET START=$$FM2HL^RORHL7(RORNVA("START"))
+6 NEW END
IF $GET(RORNVA("DISDT"))
SET END=$$FM2HL^RORHL7(RORNVA("DISDT"))
+7 SET RORSEG(1)=$GET(RORNVA("DOSE"))_CS_$GET(RORNVA("SCHED"))_CS_CS_$GET(START)_CS_$GET(END)_CS_CS_CS_$GET(RORNVA("MEDROUTE"))
+8 ;
+9 ;--- RXE-2 - Give Code: NDC code^VA Product Name^PSNDF^ NDF IEN + VA drug class code^Generic name^99PSD
+10 ; or: ^^^^ orderable item + dose form
+11 NEW DRUGIEN,DRUGINFO,INDF,TMP
SET DRUGIEN=$GET(RORNVA("DRUGIEN"))
+12 IF $GET(DRUGIEN)
SET DRUGINFO=""
SET TMP=$$RXE2^RORHL031(DRUGIEN,CS,.DRUGINFO,.INDF)
+13 IF '$GET(DRUGIEN)
SET $PIECE(DRUGINFO,CS,5)=$GET(RORNVA("OIDF"))
+14 SET RORSEG(2)=$GET(DRUGINFO)
+15 ;
+16 ;--- RXE-7 - Provider's Administration Instructions: Disclaimer text
+17 IF $LENGTH($GET(RORNVA("DISCL")))>0
SET RORSEG(7)=CS_$$TRIM^XLFSTR($GET(RORNVA("DISCL")))
+18 ;CS + 4000 characters
IF $LENGTH($GET(RORSEG(7)))>4001
SET RORSEG(7)=$EXTRACT(RORSEG(7),1,4001)
+19 ;
+20 ;--- RXE-15 - Prescription Number: CPRS Order Number
+21 SET RORSEG(15)=$GET(RORNVA("ORDNUM"))
+22 ;
+23 ;--- RXE-21 - Stop Code
+24 SET RORSEG(21)=$GET(RORNVA("STOPCD"))
+25 ;
+26 ;--- Store the segment
+27 DO ADDSEG^RORHL7(.RORSEG)
+28 QUIT
+29 ;
UPCASE(DATA) ;
+1 QUIT $TRANSLATE(DATA,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
+2 ;