Skip to content

Instantly share code, notes, and snippets.

@ebot
Last active January 3, 2019 16:33
Show Gist options
  • Save ebot/77ebb2bb9a25b96fc1ab019f358c39e9 to your computer and use it in GitHub Desktop.
Save ebot/77ebb2bb9a25b96fc1ab019f358c39e9 to your computer and use it in GitHub Desktop.
CCL Cheatsheet

CCL Cheatsheet

This gist will contain a collection of my commonly used CCL scripts.

You can run all of these by openening discern from the support folder

  1. Next, click on Discern Visual Developer
  2. Create a new blank CCL script.
  3. Copy and paste the contents of one of the scripts below into the new blank script.
  4. Make sure you always end your script with a max rec and a timeout. I reccommend WITH MAXREC = 100, time=60

To save from visual developer:

  1. Click the save button.
  2. Select CCLUSERDIR: to save permanently or cer_tmp: to save to a location that is delete every so often.
  3. Always make sure the node is default so that the script is replicated across all app servers.
  4. Prefix your script with something so that yours are all grouped together. For example cdev_my_coolscript.prg where cdev_ is the prefix.
SELECT
ea.alias
, p.name_full_formatted
, cbr.valid_from_dt_tm
, cbr.valid_until_dt_tm
, cbr.blob_handle
, cbr.format_cd
, UAR_GET_CODE_DISPLAY(cbr.format_cd)
, cbr.storage_cd
, UAR_GET_CODE_DISPLAY(cbr.storage_cd)
FROM
encntr_alias ea
, clinical_event ce
, ce_blob_result cbr
, encounter e
, person p
PLAN cbr WHERE cbr.blob_handle = "blob_handle_here#1.00"
JOIN ce WHERE cbr.event_id = ce.event_id
JOIN ea WHERE ce.encntr_id = ea.encntr_id
JOIN e WHERE ea.encntr_id = e.encntr_id
JOIN p WHERE e.person_id = p.person_id
WITH MAXREC = 100, time=60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment