VPR MEDICATION (56)    ENTITY (1.5)

Name Value
NAME VPR MEDICATION
DEFAULT FILE NUMBER 100
DATA MODEL SDA
DISPLAY NAME Medication
ITEM
  • EnteredAt
    SEQUENCE:   30
    ITEM TYPE:   ENTITY
    FILE NUMBER:   100
    FIELD NUMBER:   6
    RETURN INTERNAL VALUE:   YES
    ENTITY:   VPR FACILITY
    OUTPUT TRANSFORM:   S VALUE=$$FAC^VPRSDA(VALUE) ;#4 ien
    GET ACTION:   S VALUE=$P($G(OR0),U,10)
  • Status
    SEQUENCE:   15
    ITEM TYPE:   SIMPLE FIELD
    FILE NUMBER:   100
    FIELD NUMBER:   5
    EXTENDED POINTER LKUP:   .02
    OUTPUT TRANSFORM:   N X S X=VALUE,VALUE=$S(X="dc":"D",X="canc":"C",X="laps":"C",X="dc/e":"R",X="comp":"E",X="exp":"E",X="hold":"H",X="part":"A",1:"IP")
  • PlacerId
    SEQUENCE:   1
    ITEM TYPE:   ID
  • EnteringOrganization
    SEQUENCE:   9
    ITEM TYPE:   ENTITY
    FILE NUMBER:   100
    FIELD NUMBER:   6
    RETURN INTERNAL VALUE:   YES
    ENTITY:   VPR LOCATION
    OUTPUT TRANSFORM:   S VALUE=+VALUE
    GET ACTION:   S VALUE=$P($G(OR0),U,10) S:VALUE<1 VALUE=$$LOC^VPRSDAP(DFN,ORPK) S:VALUE<1 DDEOUT=1
  • FromTime
    SEQUENCE:   32
    ITEM TYPE:   SIMPLE FIELD
    FILE NUMBER:   100
    FIELD NUMBER:   21
    RETURN INTERNAL VALUE:   YES
    OUTPUT TRANSFORM:   S VALUE=$$DATE^VPRSDA(VALUE)
    GET ACTION:   S VALUE=$P($G(OR0),U,8)
  • ToTime
    SEQUENCE:   33
    ITEM TYPE:   SIMPLE FIELD
    FILE NUMBER:   100
    FIELD NUMBER:   22
    RETURN INTERNAL VALUE:   YES
    OUTPUT TRANSFORM:   S VALUE=$$DATE^VPRSDA(VALUE)
    GET ACTION:   S VALUE=$P($G(OR0),U,9)
  • UpdatedOn
    SEQUENCE:   58
    ITEM TYPE:   SIMPLE FIELD
    FILE NUMBER:   100
    FIELD NUMBER:   31
    RETURN INTERNAL VALUE:   YES
    OUTPUT TRANSFORM:   S VALUE=$$DATE^VPRSDA(VALUE)
    GET ACTION:   S VALUE=$P($G(OR3),U)
  • EnteredBy
    SEQUENCE:   29
    ITEM TYPE:   ENTITY
    FILE NUMBER:   100
    FIELD NUMBER:   3
    RETURN INTERNAL VALUE:   YES
    ENTITY:   VPR USER
    GET ACTION:   S VALUE=$P($G(OR0),U,6)
  • AuthorizationTime
    SEQUENCE:   23
    ITEM TYPE:   SIMPLE FIELD
    FILE NUMBER:   100.008
    FIELD NUMBER:   6
    RETURN INTERNAL VALUE:   YES
    OUTPUT TRANSFORM:   S VALUE=$$DATE^VPRSDA(VALUE)
    GET ACTION:   S VALUE=$P($G(ORSIG),U,3),IEN="1,"_DIEN
  • VerifiedBy
    SEQUENCE:   10
    ITEM TYPE:   ENTITY
    FILE NUMBER:   100
    ENTITY:   VPR PROVIDER
    GET ACTION:   S VALUE=$P($G(@VPRPS@("RXN",0)),U,5) ;pharmacist
  • TextInstruction
    SEQUENCE:   19
    ITEM TYPE:   SIMPLE FIELD
    FILE NUMBER:   100.045
    FIELD NUMBER:   1
    GET ACTION:   S VPRPI=$$WP^VPRSDAOR(DIEN,"PI"),VALUE=VPRPI S:VALUE="" DDEOUT=1 ;save for Sig
  • DrugProduct
    SEQUENCE:   34
    ITEM TYPE:   ENTITY
    FILE NUMBER:   100.045
    FIELD NUMBER:   1
    ENTITY:   VPR DRUG PRODUCT
    GET ACTION:   S:$G(PSTYPE)'="V" VALUE=$$VALUE^ORX8(DIEN,"DRUG",1) S:'VALUE DDEOUT=1
  • DosageForm
    SEQUENCE:   44
    ITEM TYPE:   ENTITY
    FILE NUMBER:   50.7
    FIELD NUMBER:   .02
    RETURN INTERNAL VALUE:   YES
    ENTITY:   VPR CODE TABLE
    GET ACTION:   S VALUE=$$DOSEFORM^VPRSDAP(DIEN),IEN=+$G(PSOI) S:VALUE="" DDEOUT=1
  • DosageSteps
    SEQUENCE:   51
    ITEM TYPE:   LIST
    ENTITY:   VPR DOSAGE STEP
    LIST TYPE:   ARRAY
    XML NAME:   DosageStep
    GET ACTION:   D DOSES^VPRSDAP(DIEN)
  • Route
    SEQUENCE:   45
    ITEM TYPE:   ENTITY
    FILE NUMBER:   100.045
    FIELD NUMBER:   1
    ENTITY:   VPR MED ROUTE
    GET ACTION:   S VALUE=$$VALUE^ORX8(DIEN,"ROUTE") S:VALUE="" DDEOUT=1
  • OrderQuantity
    SEQUENCE:   7
    ITEM TYPE:   SIMPLE FIELD
    FILE NUMBER:   100.045
    FIELD NUMBER:   1
    GET ACTION:   S VALUE=$$VALUE^ORX8(DIEN,"QTY") S:VALUE="" DDEOUT=1
  • EnteredOn
    SEQUENCE:   31
    ITEM TYPE:   SIMPLE FIELD
    FILE NUMBER:   100
    FIELD NUMBER:   4
    RETURN INTERNAL VALUE:   YES
    OUTPUT TRANSFORM:   S VALUE=$$DATE^VPRSDA(VALUE)
    GET ACTION:   S VALUE=$P($G(OR0),U,7)
  • NumberOfRefills
    SEQUENCE:   43
    ITEM TYPE:   SIMPLE FIELD
    FILE NUMBER:   100.045
    FIELD NUMBER:   1
    GET ACTION:   S:$G(PSTYPE)="O" VALUE=$$VALUE^ORX8(DIEN,"REFILLS") S:VALUE="" DDEOUT=1
  • PrescriptionNumber
    SEQUENCE:   48
    ITEM TYPE:   SIMPLE FIELD
    FILE NUMBER:   52
    FIELD NUMBER:   .01
    GET ACTION:   S:$G(PSTYPE)="O" VALUE=$P($G(@VPRPS@("RXN",0)),U),IEN=+$G(ORPK) S:VALUE="" DDEOUT=1
  • RefillNumber
    SEQUENCE:   49
    ITEM TYPE:   FIXED STRING
    GET ACTION:   S:$G(PSTYPE)="O" VALUE=$O(@VPRPS@("REF",""),-1) ;last#
  • ComponentMeds
    SEQUENCE:   53
    ITEM TYPE:   LIST
    ENTITY:   VPR IV PRODUCT
    LIST TYPE:   ARRAY
    XML NAME:   DrugProduct
    GET ACTION:   I $G(PSTYPE)="V" D IVMEDS^VPRSDAP(ORIFN)
  • RateAmount
    SEQUENCE:   37
    ITEM TYPE:   SIMPLE FIELD
    FILE NUMBER:   100.045
    FIELD NUMBER:   1
    GET ACTION:   S:$G(PSTYPE)="V" VALUE=$$IVRATE^VPRSDAP(ORIFN) S:VALUE="" DDEOUT=1
  • RateUnits
    SEQUENCE:   38
    ITEM TYPE:   ENTITY
    ENTITY:   VPR CODE ONLY
    GET ACTION:   S:$G(PSTYPE)="V"&$G(VPRATE) VALUE="ml"
  • RateTimeUnit
    SEQUENCE:   39
    ITEM TYPE:   FIXED STRING
    GET ACTION:   S:$G(PSTYPE)="V"&$G(VPRATE) VALUE="per hour"
  • Frequency
    SEQUENCE:   13
    ITEM TYPE:   ENTITY
    FILE NUMBER:   100.045
    FIELD NUMBER:   1
    ENTITY:   VPR CODE ONLY
    GET ACTION:   S:$G(PSTYPE)="V" VALUE=$$VALUE^ORX8(DIEN,"SCHEDULE") S:VALUE="" DDEOUT=1
  • Duration
    SEQUENCE:   14
    ITEM TYPE:   ENTITY
    FILE NUMBER:   100.045
    FIELD NUMBER:   1
    ENTITY:   VPR TEXT ONLY
    GET ACTION:   S:$G(PSTYPE)="V" VALUE=$$VALUE^ORX8(DIEN,"DAYS") S:VALUE="" DDEOUT=1
  • StrengthVolume
    SEQUENCE:   35
    ITEM TYPE:   SIMPLE FIELD
    FILE NUMBER:   100.045
    FIELD NUMBER:   1
    GET ACTION:   S:$G(PSTYPE)="V" VALUE=$$VALUE^ORX8(DIEN,"VOLUME"),VPRUNTS=$S(VALUE:"ML",1:"") S:VALUE="" DDEOUT=1
  • FillerId
    SEQUENCE:   3
    ITEM TYPE:   SIMPLE FIELD
    FILE NUMBER:   100
    FIELD NUMBER:   33
    GET ACTION:   S VALUE=$$PKGID^ORX8(DIEN)
  • StrengthVolumeUnits
    SEQUENCE:   36
    ITEM TYPE:   FIXED STRING
    FILE NUMBER:   100
    GET ACTION:   I $G(PSTYPE)="V" S VALUE=$G(VPRUNTS) K VPRUNTS
  • Extension
    SEQUENCE:   62
    ITEM TYPE:   ENTITY
    FILE NUMBER:   100
    ENTITY:   VPR MED EXTENSION
    GET ACTION:   S VALUE=DIEN
  • PharmacyStatus
    SEQUENCE:   47
    ITEM TYPE:   SIMPLE FIELD
    FILE NUMBER:   52
    FIELD NUMBER:   100
    GET ACTION:   S IEN=+ORPK I +ORPK'=ORPK,$E(ORPK,$L(ORPK))'="R" S VALUE=$P($G(@VPRPS@(0)),U,6) S:VALUE="" DDEOUT=1 ;use API value for non-Rx
  • Comments
    SEQUENCE:   21
    ITEM TYPE:   SIMPLE FIELD
    FILE NUMBER:   100.045
    FIELD NUMBER:   1
    GET ACTION:   S VALUE=$$WP^VPRSDAOR(DIEN,"COMMENT") S:VALUE="" DDEOUT=1
  • GroupId
    SEQUENCE:   26
    ITEM TYPE:   SIMPLE FIELD
    FILE NUMBER:   100
    FIELD NUMBER:   36
    RETURN INTERNAL VALUE:   YES
    GET ACTION:   S VALUE=$G(ORDAD)
  • Administrations
    SEQUENCE:   52
    ITEM TYPE:   LIST
    ENTITY:   VPR MED ADMINISTRATION
    LIST TYPE:   ARRAY
    XML NAME:   Administration
    GET ACTION:   D BCMA^VPRSDAP(DIEN)
  • ExternalId
    SEQUENCE:   59
    ITEM TYPE:   ID
  • Indication
    SEQUENCE:   46
    ITEM TYPE:   SIMPLE FIELD
    FILE NUMBER:   100.045
    FIELD NUMBER:   1
    GET ACTION:   S VALUE=$$VALUE^ORX8(DIEN,"INDICATION") S:VALUE="" DDEOUT=1
  • OrderCategory
    SEQUENCE:   6
    ITEM TYPE:   ENTITY
    FILE NUMBER:   100
    FIELD NUMBER:   23
    RETURN INTERNAL VALUE:   YES
    ENTITY:   VPR DISPLAY GROUP
    GET ACTION:   S VALUE=$P($G(OR0),U,11),DATA=$S($G(PSTYPE)="N":"OTC",$G(PSTYPE)="O":"Prescription",1:"") ;HITSP category
  • OrderItem
    SEQUENCE:   5
    ITEM TYPE:   ENTITY
    FILE NUMBER:   100.001
    FIELD NUMBER:   .01
    RETURN INTERNAL VALUE:   YES
    ENTITY:   VPR ORDERABLE ITEM
    GET ACTION:   N OI S OI=$$OI^VPRSDAP(DIEN),VALUE=+OI,PSOI=+$P(OI,U,3),IEN="1,"_DIEN S:VALUE<1 DDEOUT=1 ;first/only
  • OrderedBy
    SEQUENCE:   8
    ITEM TYPE:   ENTITY
    FILE NUMBER:   100
    FIELD NUMBER:   1
    RETURN INTERNAL VALUE:   YES
    ENTITY:   VPR PROVIDER
    GET ACTION:   S VALUE=$P($G(OR0),U,4)
  • Priority
    SEQUENCE:   16
    ITEM TYPE:   ENTITY
    FILE NUMBER:   100.045
    FIELD NUMBER:   1
    ENTITY:   VPR ORDER URGENCY
    GET ACTION:   S VALUE=$$VALUE^ORX8(DIEN,"URGENCY") S:VALUE="" DDEOUT=1
DESCRIPTION
This entity populates the Medication container in HealthShare from the
ORDER (#100) file; it expects the record ien as its ID (DIEN).
Additional data is pulled from the PHARMACY PATIENT (#55) and
PRESCRIPTION (#52) files.
 
This entity is supported by code in routines VPRSDAOR and VPRSDAP,
which uses various PS* calls to extract medication data. Data in SDA
is maintained by monitoring the OR EVSEND PS, PS EVSEND OR, and
PSB EVSEND VPR protocol events.
GET EXIT ACTION K:$D(VPRPS) @VPRPS K ORIFN,ORPK,PSTYPE,VPRATE,VPRPS,^TMP("VPRX",$J),PSOI,VPRPI,OR0,OR3,OR6,OR8,ORDAD,ORSIG
GET ID ACTION D PS1^VPRSDAP(DIEN),OR1^VPRSDAOR(DIEN)
GET QUERY ROUTINE ORDERS^VPRSDAOR("RX")