Skip to content

Instantly share code, notes, and snippets.

@sultanshakir
Created October 11, 2018 22:20
Show Gist options
  • Select an option

  • Save sultanshakir/732fda7945335685eab552999dfffefa to your computer and use it in GitHub Desktop.

Select an option

Save sultanshakir/732fda7945335685eab552999dfffefa to your computer and use it in GitHub Desktop.
Find FIN from PersonID and EncounterID
drop program sshakir_find_fin go
create program sshakir_find_fin
prompt
"Output to File/Printer/MINE" = "MINE"
, "Person Id:" = 0
, "Encounter Id:" = 0
with OUTDEV, PERSONID, ENCNTRID
SELECT into $outdev
Fin = EA.ALIAS
FROM
ENCNTR_ALIAS EA,
ENCOUNTER E
PLAN E
WHERE E.person_id = $PERSONID ;can be $2 since it is 2nd prompt
JOIN EA WHERE EA.encntr_id = $ENCNTRID
WITH MAXREC = 100, NOCOUNTER, SEPARATOR=" ", FORMAT, TIME = 30
end
go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment