HMPWBPL ;;EJK/AGX - ENTRY POINT FOR ALL PROBLEM WRITEBACK ACTIVITY; 3/11/2016
;;2.0;ENTERPRISE HEALTH MANAGEMENT PLATFORM;**2**;DEC 11 2014;Build 28
;Per VA Directive 6402, this routine should not be modified.
; INPUT PARAMETERS
; DFN - Patient Identifier.
; PRV - IEN of provider updating the comment/note for this problem
; VAMC - IEN of location from ^AUTTLOC (file 9999999.06)
; GMPFLD(list) - array of related data
; .01 ;DIAGNOSIS - ICD DIAGNOSIS FILE (FILE
; .03 ;DATE LAST MODIFIED - DEFAULTS TO CURRENT DATE, FILEMAN DATE FORMAT
; .05 ;PROVIDER NARRATIVE - PROVIDER NARRATIVE FILE, FREE TEXT
; .08 ;DATE ENTERED - FILEMAN DATE FORMAT
; .12 ;STATUS - VALUES ARE (A)CTIVE OR (I)NACTIVE
; .13 ;DATE OF ONSET - FILEMAN DATE FORMAT
; 1.01 ;PROBLEM - EXPRESSIONS FILE - Search text from file 9999999.27
; 1.02 ;CONDITION - VALUES ARE (T)RANSCRIBED, (P)ERMANENT OR (H)IDDEN
; 1.03 ;ENTERED BY - DUZ OF THE PERSON ENTERING THE PROBLEM (NEW PERSON FILE)
; 1.04 ;RECORDING PROVIDER - IEN FROM NEW PERSON FILE
; 1.05 ;RESPONSIBLE PROVIDER - IEN FROM NEW PERSON FILE
; 1.06 ;SERVICE - IEN to SERVICE/SECTION FILE (#49)
; 1.07 ;DATE RESOLVED - FILEMAN DATE FORMAT
; 1.08 ;IEN TO HOSPITAL LOCATION (FILE 44)
; 1.09 ;DATE RECORDED - FILEMAN DATE FORMAT
; 1.1 ;SERVICE CONNECTED - 1 FOR YES, 0 FOR NO
; 1.11 ;AGENT ORANGE EXPOSURE - 1 FOR YES, 0 FOR NO
; 1.12 ;IONIZING RADIATION EXPOSURE - 1 FOR YES, 0 FOR NO
; 1.13 ;PERSIAN GULF EXPOSURE - 1 FOR YES, 0 FOR NO
; 1.14 ;PRIORITY - (A)CUTE OR (C)HRONIC
; 1.15 ;HEAD AND/OR NECK CANCER - 1 FOR YES, 0 FOR NO
; 1.16 ;MILITARY SEXUAL TRAUMA - 1 FOR YES, 0 FOR NO
; 1.17 ;COMBAT VETERAN - 1 FOR YES, 0 FOR NO
; 1.18 ;SHIPBOARD HAZARD & DEFENSE - 1 FOR YES, 0 FOR NO
; (10,"NEW",1) ;FREE TEXT 60 CHARACTER LIMIT - 1 INDICATES THE NOTE NUMBER
; 10,0) ;WHICH NOTE IS BEING ADDED OR CHANGED
;
Q
;
PL(RSLT,DFN,PRV,VAMC,GMPFLD) ; MAIN ENTRY POINT FROM RPC HMP WRITEBACK PROBLEM
N GMPDFN,GMPVAMC
S GMPDFN=$G(DFN)
;if VAMC is not sent, get the default VAMC site id
S GMPVAMC=$S($G(VAMC)'="":VAMC,1:+$$SITE^VASITE())
S RETURN=0
;
;Lock the problem file. This is a carryover from the GMPLSAVE routine.
;For new entries, an IEN to the problem file is not yet assigned so the
;entire file is locked to avoid a collission.
;
L +^AUPNPROB(0):10 I '$T D MSG^HMPTOOLS("Unable to lock problem file",1) Q
;
;save patient problem
D NEW^GMPLSAVE
;if record field, DA will be populated.
I $G(DA)'>0 D MSG^HMPTOOLS("Problem was not successfully filed",1) Q
L -^AUPNPROB(0)
;set filters for building the JSON result
S FILTER("id")=DA
S FILTER("noHead")=1
S FILTER("domain")="problem"
S FILTER("patientId")=GMPDFN
;create the JSON response
D GET^HMPDJ(.RSLT,.FILTER)
;do not need the 'total' node
K ^TMP("HMP",$J,"total")
;return everything else.
S RSLT=$NA(^TMP("HMP",$J))
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HHMPWBPL 3148 printed Dec 13, 2024@01:54:49 Page 2
HMPWBPL ;;EJK/AGX - ENTRY POINT FOR ALL PROBLEM WRITEBACK ACTIVITY; 3/11/2016
+1 ;;2.0;ENTERPRISE HEALTH MANAGEMENT PLATFORM;**2**;DEC 11 2014;Build 28
+2 ;Per VA Directive 6402, this routine should not be modified.
+3 ; INPUT PARAMETERS
+4 ; DFN - Patient Identifier.
+5 ; PRV - IEN of provider updating the comment/note for this problem
+6 ; VAMC - IEN of location from ^AUTTLOC (file 9999999.06)
+7 ; GMPFLD(list) - array of related data
+8 ; .01 ;DIAGNOSIS - ICD DIAGNOSIS FILE (FILE
+9 ; .03 ;DATE LAST MODIFIED - DEFAULTS TO CURRENT DATE, FILEMAN DATE FORMAT
+10 ; .05 ;PROVIDER NARRATIVE - PROVIDER NARRATIVE FILE, FREE TEXT
+11 ; .08 ;DATE ENTERED - FILEMAN DATE FORMAT
+12 ; .12 ;STATUS - VALUES ARE (A)CTIVE OR (I)NACTIVE
+13 ; .13 ;DATE OF ONSET - FILEMAN DATE FORMAT
+14 ; 1.01 ;PROBLEM - EXPRESSIONS FILE - Search text from file 9999999.27
+15 ; 1.02 ;CONDITION - VALUES ARE (T)RANSCRIBED, (P)ERMANENT OR (H)IDDEN
+16 ; 1.03 ;ENTERED BY - DUZ OF THE PERSON ENTERING THE PROBLEM (NEW PERSON FILE)
+17 ; 1.04 ;RECORDING PROVIDER - IEN FROM NEW PERSON FILE
+18 ; 1.05 ;RESPONSIBLE PROVIDER - IEN FROM NEW PERSON FILE
+19 ; 1.06 ;SERVICE - IEN to SERVICE/SECTION FILE (#49)
+20 ; 1.07 ;DATE RESOLVED - FILEMAN DATE FORMAT
+21 ; 1.08 ;IEN TO HOSPITAL LOCATION (FILE 44)
+22 ; 1.09 ;DATE RECORDED - FILEMAN DATE FORMAT
+23 ; 1.1 ;SERVICE CONNECTED - 1 FOR YES, 0 FOR NO
+24 ; 1.11 ;AGENT ORANGE EXPOSURE - 1 FOR YES, 0 FOR NO
+25 ; 1.12 ;IONIZING RADIATION EXPOSURE - 1 FOR YES, 0 FOR NO
+26 ; 1.13 ;PERSIAN GULF EXPOSURE - 1 FOR YES, 0 FOR NO
+27 ; 1.14 ;PRIORITY - (A)CUTE OR (C)HRONIC
+28 ; 1.15 ;HEAD AND/OR NECK CANCER - 1 FOR YES, 0 FOR NO
+29 ; 1.16 ;MILITARY SEXUAL TRAUMA - 1 FOR YES, 0 FOR NO
+30 ; 1.17 ;COMBAT VETERAN - 1 FOR YES, 0 FOR NO
+31 ; 1.18 ;SHIPBOARD HAZARD & DEFENSE - 1 FOR YES, 0 FOR NO
+32 ; (10,"NEW",1) ;FREE TEXT 60 CHARACTER LIMIT - 1 INDICATES THE NOTE NUMBER
+33 ; 10,0) ;WHICH NOTE IS BEING ADDED OR CHANGED
+34 ;
+35 QUIT
+36 ;
PL(RSLT,DFN,PRV,VAMC,GMPFLD) ; MAIN ENTRY POINT FROM RPC HMP WRITEBACK PROBLEM
+1 NEW GMPDFN,GMPVAMC
+2 SET GMPDFN=$GET(DFN)
+3 ;if VAMC is not sent, get the default VAMC site id
+4 SET GMPVAMC=$SELECT($GET(VAMC)'="":VAMC,1:+$$SITE^VASITE())
+5 SET RETURN=0
+6 ;
+7 ;Lock the problem file. This is a carryover from the GMPLSAVE routine.
+8 ;For new entries, an IEN to the problem file is not yet assigned so the
+9 ;entire file is locked to avoid a collission.
+10 ;
+11 LOCK +^AUPNPROB(0):10
IF '$TEST
DO MSG^HMPTOOLS("Unable to lock problem file",1)
QUIT
+12 ;
+13 ;save patient problem
+14 DO NEW^GMPLSAVE
+15 ;if record field, DA will be populated.
+16 IF $GET(DA)'>0
DO MSG^HMPTOOLS("Problem was not successfully filed",1)
QUIT
+17 LOCK -^AUPNPROB(0)
+18 ;set filters for building the JSON result
+19 SET FILTER("id")=DA
+20 SET FILTER("noHead")=1
+21 SET FILTER("domain")="problem"
+22 SET FILTER("patientId")=GMPDFN
+23 ;create the JSON response
+24 DO GET^HMPDJ(.RSLT,.FILTER)
+25 ;do not need the 'total' node
+26 KILL ^TMP("HMP",$JOB,"total")
+27 ;return everything else.
+28 SET RSLT=$NAME(^TMP("HMP",$JOB))
+29 QUIT