BMXADOX2	; IHS/CIHA/GIS - RPC CALL: GENERATE AN ADO SCHEMA STRING AND DATA SET ;
	;;2.1;BMX;;Jul 26, 2009
	; EXMAPLES OF FILEMAN SCHEMA GENERATION
	;
DISP(OUT)	;
	D DISP^BMXADOX(OUT)
	Q
	;
SCHEMA(NAME)	; GIVEN SCHEMA NAME, RETURN THE IEN
	N IEN
	S IEN=$O(^BMXADO("B",NAME,0))
	Q IEN
	;
	; ----------------------------------------  LISTS  ------------------------------------------
	;
FIFOLIST	N OUT,%,SIEN,NODE,NEXT
	S NEXT="70470;8"
	S SIEN=$$SCHEMA("VEN MOJO LIST DE FIFO")
	D SS^BMXADO(.OUT,SIEN,"","~~~") ; GET ENCOUNTER LIST TO BE PROCESSED BY DATA ENTRY
	D DISP(OUT) R %:$G(DTIME,60)
	K ^TMP("BMX ADO",$J)
	Q
	;
PROBLIST	; LIST PROBLEMS
	S SIEN=$$SCHEMA("VEN MOJO DE DX PROBLEM")
	D SS^BMXADO(.OUT,SIEN,"","AC~5~5~") ; GET PROBLEM LIST TO BE PROCESSED BY DATA ENTRY
	D DISP(OUT) R %:$G(DTIME,60)
	K ^TMP("BMX ADO",$J)
	Q
	;
PTLIST	; LIST PATIENT WITH A SPECIFIC LOOKUP VALUE
	N VAL
	R "PATIENT: ",VAL:DTIME E  Q
	I '$L(VAL) Q
	I VAL?1."^" Q
	S SIEN=$$SCHEMA("VEN MOJO LIST PATIENTS")
	D SS^BMXADO(.OUT,SIEN,"","~~~~~PT~BMXADOV2~"_VAL)
	D DISP(OUT) R %:$G(DTIME,60)
	K ^TMP("BMX ADO",$J)
	Q
	;
CLINLIST	; LIST CLINICS
	S SIEN=$$SCHEMA("VEN MOJO LIST CLINICS")
	D SS^BMXADO(.OUT,SIEN,"","B~~~") ; GET PROBLEM LIST TO BE PROCESSED BY DATA ENTRY
	D DISP(OUT) R %:$G(DTIME,60)
	K ^TMP("BMX ADO",$J)
	Q
	;
SEGLIST	; LIST DE SEGMENTS
	S SIEN=$$SCHEMA("VEN MOJO DE SEGMENT")
	D SS^BMXADO(.OUT,SIEN,"","~~~") ; GET PROBLEM LIST TO BE PROCESSED BY DATA ENTRY
	D DISP(OUT) R %:$G(DTIME,60)
	K ^TMP("BMX ADO",$J)
	Q
	;
NOTELIST	; LIST NOTES
	;N SIEN
	;D NOTELIST^VENPCCTG(.OUT,"70470")
	;D DISP(OUT) R %:$G(DTIME,60)
	;K ^TMP("BMX ADO",$J)
	Q
	;
PRVLIST	; PROVIDER LIST
	N SIEN,OUT
	S SIEN=$$SCHEMA("VEN MOJO LIST PROVIDERS")
	D SS^BMXADO(.OUT,SIEN,"","B~~~5000") ; GET NOTE LIST TO BE PROCESSED BY DATA ENTRY
	D DISP(OUT) R %:$G(DTIME,60)
	K ^TMP("BMX ADO",$J)
	Q
	;
MLIST	; LIST MEASUREMNTS
	S SIEN=$$SCHEMA("VEN MOJO LIST MEASUREMENTS")
	D SS^BMXADO(.OUT,SIEN,"","B~~~") ; GET PROBLEM LIST TO BE PROCESSED BY DATA ENTRY
	D DISP(OUT) R %:$G(DTIME,60)
	K ^TMP("BMX ADO",$J)
	Q
	;
RXLIST	; A RX LIST FOR A PATIENT
	N SIEN,OUT
	S SIEN=$$SCHEMA("VEN MOJO RX LIST")
	D SS^BMXADO(.OUT,SIEN,"","~~~~~MED~MOJORX~3") ; GET RX LIST
	D DISP(OUT) R %:$G(DTIME,60)
	K ^TMP("BMX ADO",$J)
	Q
	;
TQLIST	; TABLET QUEUE LIST
	N SIEN,OUT
	S SIEN=$$SCHEMA("VEN MOJO LIST TABLET QUEUE")
	D SS^BMXADO(.OUT,SIEN,"","ATS~~~") ; GET PATIENT LIST
	D DISP(OUT) R %:$G(DTIME,60)
	K ^TMP("BMX ADO",$J)
	Q
	; 
UHCLIST	; LIST HIDDEN COLUMNS
	N SIEN,OUT
	; S SIEN=$$SCHEMA("VEN MOJO DE GFMT UHC")
	D SS^BMXADO(.OUT,"VEN MOJO DE FMT GRID","","~~~") ; GET RX LIST
	D DISP(OUT) R %:$G(DTIME,60)
	K ^TMP("BMX ADO",$J)
	Q
	;
GSEGLIST	; LIST GRID PROPERTIES FOR SEGMENTS
	N SIEN,OUT
	D SS^BMXADO(.OUT,"VEN MOJO DE GRID FMT","","B~~~") ; GET RX LIST
	D DISP(OUT) R %:$G(DTIME,60)
	K ^TMP("BMX ADO",$J)
	Q
	;
ICDLIST	; LIST ICD CODE MATCHES
	;N NARR,OUT
	;W !,"Provider narrative: " R NARR:60 E  Q
	;I '$L(NARR) Q
	;D ICDMATCH^VENPCCTP(.OUT,NARR) W !!
	;D DISP(OUT) R %:$G(DTIME,60)
	;K ^TMP("BMX ADO",$J)
	Q
	;
IMAGE	; LIST SEGMENT IMAGE CONTROL PARAMETERS
	N SIEN,OUT
	D SS^BMXADO(.OUT,"VEN MOJO DE SEG IMAGE","1,","~~~") ; GET RX LIST
	D DISP(OUT) R %:$G(DTIME,60)
	K ^TMP("BMX ADO",$J)
	Q
