VPR SOCIAL HISTORY (47)    ENTITY (1.5)

Name Value
NAME VPR SOCIAL HISTORY
DEFAULT FILE NUMBER 9000010.23
DATA MODEL SDA
DISPLAY NAME SocialHistory
ITEM
  • EncounterNumber
    SEQUENCE:   2
    ITEM TYPE:   SIMPLE FIELD
    FILE NUMBER:   9000010.23
    FIELD NUMBER:   .03
    RETURN INTERNAL VALUE:   YES
    OUTPUT TRANSFORM:   S:'$D(^AUPNVSIT(VALUE,0)) VALUE=""
    GET ACTION:   S VALUE=$G(VPRVST)
  • SocialHabit
    SEQUENCE:   5
    ITEM TYPE:   ENTITY
    FILE NUMBER:   9000010.23
    FIELD NUMBER:   .01
    ENTITY:   VPR CODE TABLE
    OUTPUT TRANSFORM:   S VALUE=VALUE_"^^VHAT"
  • SocialHabitCategory
    SEQUENCE:   7
    ITEM TYPE:   ENTITY
    FILE NUMBER:   9000010.23
    FIELD NUMBER:   .01
    EXTENDED POINTER LKUP:   .03
    RETURN INTERNAL VALUE:   YES
    ENTITY:   VPR HEALTH FACTOR
  • SocialHabitComments
    SEQUENCE:   8
    ITEM TYPE:   SIMPLE FIELD
    FILE NUMBER:   9000010.23
    FIELD NUMBER:   81101
    GET ACTION:   S VALUE=$G(VPRHF("COMMENTS"))
  • EnteredBy
    SEQUENCE:   10
    ITEM TYPE:   ENTITY
    FILE NUMBER:   9000010.23
    FIELD NUMBER:   .03
    EXTENDED POINTER LKUP:   .23
    RETURN INTERNAL VALUE:   YES
    ENTITY:   VPR USER
    GET ACTION:   S VALUE=$P(VPRVST0,U,23)
  • EnteredAt
    SEQUENCE:   11
    ITEM TYPE:   ENTITY
    FILE NUMBER:   9000010.23
    FIELD NUMBER:   .03
    EXTENDED POINTER LKUP:   .06
    RETURN INTERNAL VALUE:   YES
    ENTITY:   VPR FACILITY
    GET ACTION:   S VALUE=$P(VPRVST0,U,6) S:'VALUE VALUE=$G(VASITE)
  • EnteredOn
    SEQUENCE:   12
    ITEM TYPE:   SIMPLE FIELD
    FILE NUMBER:   9000010.23
    FIELD NUMBER:   .03
    EXTENDED POINTER LKUP:   .01
    RETURN INTERNAL VALUE:   YES
    OUTPUT TRANSFORM:   S VALUE=$$DATE^VPRSDA(VALUE)
    GET ACTION:   S VALUE=$P(VPRVST0,U)
  • CustomPairs
    SEQUENCE:   3
    ITEM TYPE:   LIST
    ENTITY:   VPR CUSTOM PAIR
    GET ACTION:   N X S X=$G(VPRHF("VALUE")) I $L(X) S DLIST(1)="Severity^"_$$EXTERNAL^DILFD(9000010.23,.04,,X)
DESCRIPTION
This entity populates the Social History container in HealthShare from 
the V HEALTH FACTORS (#9000010.23) file with factors related to smoking 
or tobacco use. It expects the record IEN as the ID.
 
The VPR PCE EVENTS listener will pass in 'ien~visit' for the record ID if
it detects that the record is being deleted; control will pass to the VPR
VFILE DELETE entity to return a stub to HealthShare containing only these
two values, so the HS matching logic can find and remove the record there.
GET ENTRY ACTION S VASITE=+$$SITE^VASITE S:VASITE'>0 VASITE=$$KSP^XUPARAM("INST") I $G(ID)["~" D VDEL^VPRSDAV
GET EXIT ACTION K VPRHF,VPRVST,VPRVST0,VASITE
GET ID ACTION K VPRHF D:$D(^AUPNVHF(+DIEN)) VHF^PXPXRM(+DIEN,.VPRHF) S VPRVST=$G(VPRHF("VISIT")),VPRHF=DIEN,DIEN=+DIEN,VPRVST0=$G(^AUPNVSIT(+VPRVST,0))
GET QUERY ROUTINE HFS^VPRSDAQ